diff --git a/dist/vuex-orm-graphql.es5.js.map b/dist/vuex-orm-graphql.es5.js.map index 38f97a1d..fc388217 100644 --- a/dist/vuex-orm-graphql.es5.js.map +++ b/dist/vuex-orm-graphql.es5.js.map @@ -1 +1 @@ -{"version":3,"file":"vuex-orm-graphql.es5.js","sources":["../node_modules/graphql/jsutils/invariant.js","../node_modules/graphql/language/source.js","../node_modules/graphql/language/location.js","../node_modules/graphql/error/printError.js","../node_modules/graphql/error/GraphQLError.js","../node_modules/graphql/error/syntaxError.js","../node_modules/graphql/error/locatedError.js","../node_modules/graphql/error/formatError.js","../node_modules/graphql/error/index.js","../node_modules/graphql/language/blockStringValue.js","../node_modules/graphql/language/lexer.js","../node_modules/graphql/language/kinds.js","../node_modules/graphql/language/directiveLocation.js","../node_modules/graphql/language/parser.js","../node_modules/graphql/language/visitor.js","../node_modules/graphql/language/printer.js","../node_modules/lodash.isequal/index.js","../node_modules/lodash.clone/index.js","../node_modules/pluralize/pluralize.js","../src/support/utils.ts","../src/common/logger.ts","../src/orm/model.ts","../node_modules/fast-json-stable-stringify/index.js","../node_modules/apollo-client/node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/cloneDeep.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/transform.ts","../node_modules/src/core/networkStatus.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/errorHandling.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/zen-observable/lib/Observable.js","../node_modules/zen-observable/index.js","../node_modules/zen-observable-ts/src/zenObservable.ts","../node_modules/apollo-link/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-link/src/linkUtils.ts","../node_modules/apollo-link/src/link.ts","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/src/util/Observable.ts","../node_modules/src/errors/ApolloError.ts","../node_modules/src/core/types.ts","../node_modules/src/core/ObservableQuery.ts","../node_modules/apollo-link-dedup/src/dedupLink.ts","../node_modules/src/scheduler/scheduler.ts","../node_modules/src/data/mutations.ts","../node_modules/src/data/queries.ts","../node_modules/src/core/QueryManager.ts","../node_modules/src/data/store.ts","../node_modules/apollo-client/version.js","../node_modules/src/ApolloClient.ts","../node_modules/ts-invariant/lib/invariant.esm.js","../node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-utilities/src/fragments.ts","../node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-utilities/src/transform.ts","../node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/apollo-utilities/src/util/mergeDeep.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/utils.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/cache.ts","../node_modules/optimism/lib/cache.js","../node_modules/immutable-tuple/dist/tuple.js","../node_modules/optimism/lib/local.js","../node_modules/optimism/lib/entry.js","../node_modules/optimism/lib/index.js","../node_modules/apollo-cache-inmemory/src/fixPolyfills.ts","../node_modules/apollo-cache-inmemory/src/fragmentMatcher.ts","../node_modules/apollo-cache-inmemory/src/cacheKeys.ts","../node_modules/apollo-cache-inmemory/src/depTrackingCache.ts","../node_modules/apollo-cache-inmemory/src/readFromStore.ts","../node_modules/apollo-cache-inmemory/src/objectCache.ts","../node_modules/apollo-cache-inmemory/src/writeToStore.ts","../node_modules/apollo-cache-inmemory/src/inMemoryCache.ts","../node_modules/apollo-link-http-common/src/index.ts","../node_modules/apollo-link-http/src/httpLink.ts","../src/adapters/adapter.ts","../src/graphql/transformer.ts","../node_modules/graphql-tag/src/index.js","../src/graphql/apollo.ts","../src/graphql/schema.ts","../src/adapters/builtin/default-adapter.ts","../src/graphql/introspection-query.ts","../src/common/context.ts","../src/graphql/query-builder.ts","../src/orm/store.ts","../src/actions/action.ts","../src/actions/destroy.ts","../src/actions/fetch.ts","../src/actions/mutate.ts","../src/actions/persist.ts","../src/actions/push.ts","../src/actions/query.ts","../src/actions/simple-query.ts","../src/actions/simple-mutation.ts","../src/vuex-orm-graphql.ts","../src/plugin.ts","../src/test-utils.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = invariant;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Source = undefined;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * A representation of source input to GraphQL.\n * `name` and `locationOffset` are optional. They are useful for clients who\n * store GraphQL documents in source files; for example, if the GraphQL input\n * starts at line 40 in a file named Foo.graphql, it might be useful for name to\n * be \"Foo.graphql\" and location to be `{ line: 40, column: 0 }`.\n * line and column in locationOffset are 1-indexed\n */\nvar Source = exports.Source = function Source(body, name, locationOffset) {\n _classCallCheck(this, Source);\n\n this.body = body;\n this.name = name || 'GraphQL request';\n this.locationOffset = locationOffset || { line: 1, column: 1 };\n !(this.locationOffset.line > 0) ? (0, _invariant2.default)(0, 'line in locationOffset is 1-indexed and must be positive') : void 0;\n !(this.locationOffset.column > 0) ? (0, _invariant2.default)(0, 'column in locationOffset is 1-indexed and must be positive') : void 0;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLocation = getLocation;\n\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}\n\n/**\n * Represents a location in a Source.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.printError = printError;\n\nvar _location = require('../language/location');\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nfunction printError(error) {\n var printedLocations = [];\n if (error.nodes) {\n error.nodes.forEach(function (node) {\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, (0, _location.getLocation)(node.loc.source, node.loc.start)));\n }\n });\n } else if (error.source && error.locations) {\n var source = error.source;\n error.locations.forEach(function (location) {\n printedLocations.push(highlightSourceAtLocation(source, location));\n });\n }\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction highlightSourceAtLocation(source, location) {\n var line = location.line;\n var lineOffset = source.locationOffset.line - 1;\n var columnOffset = getColumnOffset(source, location);\n var contextLine = line + lineOffset;\n var contextColumn = location.column + columnOffset;\n var prevLineNum = (contextLine - 1).toString();\n var lineNum = contextLine.toString();\n var nextLineNum = (contextLine + 1).toString();\n var padLen = nextLineNum.length;\n var lines = source.body.split(/\\r\\n|[\\n\\r]/g);\n lines[0] = whitespace(source.locationOffset.column - 1) + lines[0];\n var outputLines = [source.name + ' (' + contextLine + ':' + contextColumn + ')', line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];\n return outputLines.filter(Boolean).join('\\n');\n}\n\nfunction getColumnOffset(source, location) {\n return location.line === 1 ? source.locationOffset.column - 1 : 0;\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GraphQLError = GraphQLError;\n\nvar _printError = require('./printError');\n\nvar _location = require('../language/location');\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined;\n\n // Compute locations in the source for the given nodes/positions.\n var _source = source;\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n return list;\n }, []);\n }\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations = void 0;\n if (positions && source) {\n var providedSource = source;\n _locations = positions.map(function (pos) {\n return (0, _location.getLocation)(providedSource, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push((0, _location.getLocation)(node.loc.source, node.loc.start));\n }\n return list;\n }, []);\n }\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n value: extensions || originalError && originalError.extensions\n }\n });\n\n // Include (non-enumerable) stack trace.\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\n\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: { value: GraphQLError },\n name: { value: 'GraphQLError' },\n toString: {\n value: function toString() {\n return (0, _printError.printError)(this);\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syntaxError = syntaxError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction syntaxError(source, position, description) {\n return new _GraphQLError.GraphQLError('Syntax Error: ' + description, undefined, source, [position]);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.locatedError = locatedError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Given an arbitrary Error, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\nfunction locatedError(originalError, nodes, path) {\n // Note: this uses a brand-check to support GraphQL errors originating from\n // other contexts.\n if (originalError && Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError);\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nexports.formatError = formatError;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nfunction formatError(error) {\n !error ? (0, _invariant2.default)(0, 'Received null or undefined error.') : void 0;\n return _extends({}, error.extensions, {\n message: error.message || 'An unknown error occurred.',\n locations: error.locations,\n path: error.path\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _GraphQLError = require('./GraphQLError');\n\nObject.defineProperty(exports, 'GraphQLError', {\n enumerable: true,\n get: function get() {\n return _GraphQLError.GraphQLError;\n }\n});\n\nvar _syntaxError = require('./syntaxError');\n\nObject.defineProperty(exports, 'syntaxError', {\n enumerable: true,\n get: function get() {\n return _syntaxError.syntaxError;\n }\n});\n\nvar _locatedError = require('./locatedError');\n\nObject.defineProperty(exports, 'locatedError', {\n enumerable: true,\n get: function get() {\n return _locatedError.locatedError;\n }\n});\n\nvar _printError = require('./printError');\n\nObject.defineProperty(exports, 'printError', {\n enumerable: true,\n get: function get() {\n return _printError.printError;\n }\n});\n\nvar _formatError = require('./formatError');\n\nObject.defineProperty(exports, 'formatError', {\n enumerable: true,\n get: function get() {\n return _formatError.formatError;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = blockStringValue;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n */\nfunction blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g);\n\n // Remove common indentation from all lines but first.\n var commonIndent = null;\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n var indent = leadingWhitespace(line);\n if (indent < line.length && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n if (commonIndent === 0) {\n break;\n }\n }\n }\n\n if (commonIndent) {\n for (var _i = 1; _i < lines.length; _i++) {\n lines[_i] = lines[_i].slice(commonIndent);\n }\n }\n\n // Remove leading and trailing blank lines.\n while (lines.length > 0 && isBlank(lines[0])) {\n lines.shift();\n }\n while (lines.length > 0 && isBlank(lines[lines.length - 1])) {\n lines.pop();\n }\n\n // Return a string of the lines joined with U+000A.\n return lines.join('\\n');\n}\n\nfunction leadingWhitespace(str) {\n var i = 0;\n while (i < str.length && (str[i] === ' ' || str[i] === '\\t')) {\n i++;\n }\n return i;\n}\n\nfunction isBlank(str) {\n return leadingWhitespace(str) === str.length;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TokenKind = undefined;\nexports.createLexer = createLexer;\nexports.getTokenDesc = getTokenDesc;\n\nvar _error = require('../error');\n\nvar _blockStringValue = require('./blockStringValue');\n\nvar _blockStringValue2 = _interopRequireDefault(_blockStringValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a Source object, this returns a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}\n\nfunction advanceLexer() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n}\n\nfunction lookahead() {\n var token = this.token;\n if (token.kind !== EOF) {\n do {\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = token.next || (token.next = readToken(this, token));\n } while (token.kind === COMMENT);\n }\n return token;\n}\n\n/**\n * The return type of createLexer.\n */\n\n\n// Each kind of token.\nvar SOF = '';\nvar EOF = '';\nvar BANG = '!';\nvar DOLLAR = '$';\nvar PAREN_L = '(';\nvar PAREN_R = ')';\nvar SPREAD = '...';\nvar COLON = ':';\nvar EQUALS = '=';\nvar AT = '@';\nvar BRACKET_L = '[';\nvar BRACKET_R = ']';\nvar BRACE_L = '{';\nvar PIPE = '|';\nvar BRACE_R = '}';\nvar NAME = 'Name';\nvar INT = 'Int';\nvar FLOAT = 'Float';\nvar STRING = 'String';\nvar BLOCK_STRING = 'BlockString';\nvar COMMENT = 'Comment';\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind = exports.TokenKind = {\n SOF: SOF,\n EOF: EOF,\n BANG: BANG,\n DOLLAR: DOLLAR,\n PAREN_L: PAREN_L,\n PAREN_R: PAREN_R,\n SPREAD: SPREAD,\n COLON: COLON,\n EQUALS: EQUALS,\n AT: AT,\n BRACKET_L: BRACKET_L,\n BRACKET_R: BRACKET_R,\n BRACE_L: BRACE_L,\n PIPE: PIPE,\n BRACE_R: BRACE_R,\n NAME: NAME,\n INT: INT,\n FLOAT: FLOAT,\n STRING: STRING,\n BLOCK_STRING: BLOCK_STRING,\n COMMENT: COMMENT\n};\n\n/**\n * A helper function to describe a token as a string for debugging\n */\nfunction getTokenDesc(token) {\n var value = token.value;\n return value ? token.kind + ' \"' + value + '\"' : token.kind;\n}\n\nvar charCodeAt = String.prototype.charCodeAt;\nvar slice = String.prototype.slice;\n\n/**\n * Helper function for constructing the Token object.\n */\nfunction Tok(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nTok.prototype.toJSON = Tok.prototype.inspect = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n};\n\nfunction printCharCode(code) {\n return (\n // NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n '\"\\\\u' + ('00' + code.toString(16).toUpperCase()).slice(-4) + '\"'\n );\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace and comments until it finds the next lexable\n * token, then lexes punctuators immediately or calls the appropriate helper\n * function for more complicated tokens.\n */\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var position = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + position - lexer.lineStart;\n\n if (position >= bodyLength) {\n return new Tok(EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, position);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(BANG, position, position + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, position, line, col, prev);\n // $\n case 36:\n return new Tok(DOLLAR, position, position + 1, line, col, prev);\n // (\n case 40:\n return new Tok(PAREN_L, position, position + 1, line, col, prev);\n // )\n case 41:\n return new Tok(PAREN_R, position, position + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, position + 1) === 46 && charCodeAt.call(body, position + 2) === 46) {\n return new Tok(SPREAD, position, position + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(COLON, position, position + 1, line, col, prev);\n // =\n case 61:\n return new Tok(EQUALS, position, position + 1, line, col, prev);\n // @\n case 64:\n return new Tok(AT, position, position + 1, line, col, prev);\n // [\n case 91:\n return new Tok(BRACKET_L, position, position + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(BRACKET_R, position, position + 1, line, col, prev);\n // {\n case 123:\n return new Tok(BRACE_L, position, position + 1, line, col, prev);\n // |\n case 124:\n return new Tok(PIPE, position, position + 1, line, col, prev);\n // }\n case 125:\n return new Tok(BRACE_R, position, position + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, position, line, col, prev);\n // - 0-9\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 return readNumber(source, position, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n return readBlockString(source, position, line, col, prev);\n }\n return readString(source, position, line, col, prev);\n }\n\n throw (0, _error.syntaxError)(source, position, unexpectedCharacterMessage(code));\n}\n\n/**\n * Report a message that an unexpected character was encountered.\n */\nfunction unexpectedCharacterMessage(code) {\n if (code === 39) {\n // '\n return \"Unexpected single quote character ('), did you mean to use \" + 'a double quote (\")?';\n }\n\n return 'Cannot parse the unexpected character ' + printCharCode(code) + '.';\n}\n\n/**\n * Reads from body starting at startPosition until it finds a non-whitespace\n * or commented character, then returns the position of that character for\n * lexing.\n */\nfunction positionAfterWhitespace(body, startPosition, lexer) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // tab | space | comma | BOM\n if (code === 9 || code === 32 || code === 44 || code === 0xfeff) {\n ++position;\n } else if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (charCodeAt.call(body, position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n } else {\n break;\n }\n }\n return position;\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code = void 0;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && (\n // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n}\n\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = charCodeAt.call(body, ++position);\n }\n\n if (code === 48) {\n // 0\n code = charCodeAt.call(body, ++position);\n if (code >= 48 && code <= 57) {\n throw (0, _error.syntaxError)(source, position, 'Invalid number, unexpected digit after 0: ' + printCharCode(code) + '.');\n }\n } else {\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n if (code === 43 || code === 45) {\n // + -\n code = charCodeAt.call(body, ++position);\n }\n position = readDigits(source, position, code);\n }\n\n return new Tok(isFloat ? FLOAT : INT, start, position, line, col, prev, slice.call(body, start, position));\n}\n\n/**\n * Returns the new position in the source after reading digits.\n */\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = charCodeAt.call(body, ++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n return position;\n }\n throw (0, _error.syntaxError)(source, position, 'Invalid number, expected digit but got: ' + printCharCode(code) + '.');\n}\n\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null &&\n // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += slice.call(body, chunkStart, position);\n return new Tok(STRING, start, position + 1, line, col, prev, value);\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n ++position;\n if (code === 92) {\n // \\\n value += slice.call(body, chunkStart, position - 1);\n code = charCodeAt.call(body, position);\n switch (code) {\n case 34:\n value += '\"';\n break;\n case 47:\n value += '/';\n break;\n case 92:\n value += '\\\\';\n break;\n case 98:\n value += '\\b';\n break;\n case 102:\n value += '\\f';\n break;\n case 110:\n value += '\\n';\n break;\n case 114:\n value += '\\r';\n break;\n case 116:\n value += '\\t';\n break;\n case 117:\n // u\n var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));\n if (charCode < 0) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: ' + ('\\\\u' + body.slice(position + 1, position + 5) + '.'));\n }\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n default:\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: \\\\' + String.fromCharCode(code) + '.');\n }\n ++position;\n chunkStart = position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\nfunction readBlockString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n rawValue += slice.call(body, chunkStart, position);\n return new Tok(BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockStringValue2.default)(rawValue));\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n // Escape Triple-Quote (\\\"\"\")\n if (code === 92 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34 && charCodeAt.call(body, position + 3) === 34) {\n rawValue += slice.call(body, chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Converts four hexidecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\nfunction readName(source, position, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var end = position + 1;\n var code = 0;\n while (end !== bodyLength && (code = charCodeAt.call(body, end)) !== null && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++end;\n }\n return new Tok(NAME, position, end, line, col, prev, slice.call(body, position, end));\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n// Name\n\nvar NAME = exports.NAME = 'Name';\n\n// Document\n\nvar DOCUMENT = exports.DOCUMENT = 'Document';\nvar OPERATION_DEFINITION = exports.OPERATION_DEFINITION = 'OperationDefinition';\nvar VARIABLE_DEFINITION = exports.VARIABLE_DEFINITION = 'VariableDefinition';\nvar VARIABLE = exports.VARIABLE = 'Variable';\nvar SELECTION_SET = exports.SELECTION_SET = 'SelectionSet';\nvar FIELD = exports.FIELD = 'Field';\nvar ARGUMENT = exports.ARGUMENT = 'Argument';\n\n// Fragments\n\nvar FRAGMENT_SPREAD = exports.FRAGMENT_SPREAD = 'FragmentSpread';\nvar INLINE_FRAGMENT = exports.INLINE_FRAGMENT = 'InlineFragment';\nvar FRAGMENT_DEFINITION = exports.FRAGMENT_DEFINITION = 'FragmentDefinition';\n\n// Values\n\nvar INT = exports.INT = 'IntValue';\nvar FLOAT = exports.FLOAT = 'FloatValue';\nvar STRING = exports.STRING = 'StringValue';\nvar BOOLEAN = exports.BOOLEAN = 'BooleanValue';\nvar NULL = exports.NULL = 'NullValue';\nvar ENUM = exports.ENUM = 'EnumValue';\nvar LIST = exports.LIST = 'ListValue';\nvar OBJECT = exports.OBJECT = 'ObjectValue';\nvar OBJECT_FIELD = exports.OBJECT_FIELD = 'ObjectField';\n\n// Directives\n\nvar DIRECTIVE = exports.DIRECTIVE = 'Directive';\n\n// Types\n\nvar NAMED_TYPE = exports.NAMED_TYPE = 'NamedType';\nvar LIST_TYPE = exports.LIST_TYPE = 'ListType';\nvar NON_NULL_TYPE = exports.NON_NULL_TYPE = 'NonNullType';\n\n// Type System Definitions\n\nvar SCHEMA_DEFINITION = exports.SCHEMA_DEFINITION = 'SchemaDefinition';\nvar OPERATION_TYPE_DEFINITION = exports.OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n\n// Type Definitions\n\nvar SCALAR_TYPE_DEFINITION = exports.SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\nvar OBJECT_TYPE_DEFINITION = exports.OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\nvar FIELD_DEFINITION = exports.FIELD_DEFINITION = 'FieldDefinition';\nvar INPUT_VALUE_DEFINITION = exports.INPUT_VALUE_DEFINITION = 'InputValueDefinition';\nvar INTERFACE_TYPE_DEFINITION = exports.INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\nvar UNION_TYPE_DEFINITION = exports.UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\nvar ENUM_TYPE_DEFINITION = exports.ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\nvar ENUM_VALUE_DEFINITION = exports.ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\nvar INPUT_OBJECT_TYPE_DEFINITION = exports.INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n\n// Type Extensions\n\nvar SCALAR_TYPE_EXTENSION = exports.SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\nvar OBJECT_TYPE_EXTENSION = exports.OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\nvar INTERFACE_TYPE_EXTENSION = exports.INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\nvar UNION_TYPE_EXTENSION = exports.UNION_TYPE_EXTENSION = 'UnionTypeExtension';\nvar ENUM_TYPE_EXTENSION = exports.ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\nvar INPUT_OBJECT_TYPE_EXTENSION = exports.INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n\n// Directive Definitions\n\nvar DIRECTIVE_DEFINITION = exports.DIRECTIVE_DEFINITION = 'DirectiveDefinition';","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation = exports.DirectiveLocation = {\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n};\n\n/**\n * The enum type representing the directive location values.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parse = parse;\nexports.parseValue = parseValue;\nexports.parseType = parseType;\nexports.parseConstValue = parseConstValue;\nexports.parseTypeReference = parseTypeReference;\nexports.parseNamedType = parseNamedType;\n\nvar _source = require('./source');\n\nvar _error = require('../error');\n\nvar _lexer = require('./lexer');\n\nvar _kinds = require('./kinds');\n\nvar _directiveLocation = require('./directiveLocation');\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\n\n\n/**\n * Configuration options to control parser behavior\n */\nfunction parse(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n if (!(sourceObj instanceof _source.Source)) {\n throw new TypeError('Must provide Source. Received: ' + String(sourceObj));\n }\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n return parseDocument(lexer);\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction parseValue(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var value = parseValueLiteral(lexer, false);\n expect(lexer, _lexer.TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\nfunction parseType(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.EOF);\n return type;\n}\n\n/**\n * Converts a name lex token into a name parse node.\n */\nfunction parseName(lexer) {\n var token = expect(lexer, _lexer.TokenKind.NAME);\n return {\n kind: _kinds.NAME,\n value: token.value,\n loc: loc(lexer, token)\n };\n}\n\n// Implements the parsing rules in the Document section.\n\n/**\n * Document : Definition+\n */\nfunction parseDocument(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SOF);\n var definitions = [];\n do {\n definitions.push(parseDefinition(lexer));\n } while (!skip(lexer, _lexer.TokenKind.EOF));\n\n return {\n kind: _kinds.DOCUMENT,\n definitions: definitions,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n */\nfunction parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n/**\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\nfunction parseExecutableDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseOperationDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n// Implements the parsing rules in the Operations section.\n\n/**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\nfunction parseOperationDefinition(lexer) {\n var start = lexer.token;\n if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n var operation = parseOperationType(lexer);\n var name = void 0;\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n name = parseName(lexer);\n }\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: parseVariableDefinitions(lexer),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationType : one of query mutation subscription\n */\nfunction parseOperationType(lexer) {\n var operationToken = expect(lexer, _lexer.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return 'query';\n case 'mutation':\n return 'mutation';\n case 'subscription':\n return 'subscription';\n }\n\n throw unexpected(lexer, operationToken);\n}\n\n/**\n * VariableDefinitions : ( VariableDefinition+ )\n */\nfunction parseVariableDefinitions(lexer) {\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, parseVariableDefinition, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * VariableDefinition : Variable : Type DefaultValue?\n */\nfunction parseVariableDefinition(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, _lexer.TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, _lexer.TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Variable : $ Name\n */\nfunction parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * SelectionSet : { Selection+ }\n */\nfunction parseSelectionSet(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.SELECTION_SET,\n selections: many(lexer, _lexer.TokenKind.BRACE_L, parseSelection, _lexer.TokenKind.BRACE_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\nfunction parseSelection(lexer) {\n return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}\n\n/**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\nfunction parseField(lexer) {\n var start = lexer.token;\n\n var nameOrAlias = parseName(lexer);\n var alias = void 0;\n var name = void 0;\n if (skip(lexer, _lexer.TokenKind.COLON)) {\n alias = nameOrAlias;\n name = parseName(lexer);\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: _kinds.FIELD,\n alias: alias,\n name: name,\n arguments: parseArguments(lexer, false),\n directives: parseDirectives(lexer, false),\n selectionSet: peek(lexer, _lexer.TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\nfunction parseArguments(lexer, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, item, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * Argument[Const] : Name : Value[?Const]\n */\nfunction parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}\n\nfunction parseConstArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseConstValue(lexer)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Fragments section.\n\n/**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\nfunction parseFragment(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SPREAD);\n if (peek(lexer, _lexer.TokenKind.NAME) && lexer.token.value !== 'on') {\n return {\n kind: _kinds.FRAGMENT_SPREAD,\n name: parseFragmentName(lexer),\n directives: parseDirectives(lexer, false),\n loc: loc(lexer, start)\n };\n }\n var typeCondition = void 0;\n if (lexer.token.value === 'on') {\n lexer.advance();\n typeCondition = parseNamedType(lexer);\n }\n return {\n kind: _kinds.INLINE_FRAGMENT,\n typeCondition: typeCondition,\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\nfunction parseFragmentDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'fragment');\n // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n if (lexer.options.experimentalFragmentVariables) {\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n variableDefinitions: parseVariableDefinitions(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentName : Name but not `on`\n */\nfunction parseFragmentName(lexer) {\n if (lexer.token.value === 'on') {\n throw unexpected(lexer);\n }\n return parseName(lexer);\n}\n\n// Implements the parsing rules in the Values section.\n\n/**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\nfunction parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}\n\nfunction parseStringLiteral(lexer) {\n var token = lexer.token;\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n block: token.kind === _lexer.TokenKind.BLOCK_STRING,\n loc: loc(lexer, token)\n };\n}\n\nfunction parseConstValue(lexer) {\n return parseValueLiteral(lexer, true);\n}\n\nfunction parseValueValue(lexer) {\n return parseValueLiteral(lexer, false);\n}\n\n/**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\nfunction parseList(lexer, isConst) {\n var start = lexer.token;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: _kinds.LIST,\n values: any(lexer, _lexer.TokenKind.BRACKET_L, item, _lexer.TokenKind.BRACKET_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\nfunction parseObject(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.BRACE_L);\n var fields = [];\n while (!skip(lexer, _lexer.TokenKind.BRACE_R)) {\n fields.push(parseObjectField(lexer, isConst));\n }\n return {\n kind: _kinds.OBJECT,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectField[Const] : Name : Value[?Const]\n */\nfunction parseObjectField(lexer, isConst) {\n var start = lexer.token;\n return {\n kind: _kinds.OBJECT_FIELD,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, isConst)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Directives section.\n\n/**\n * Directives[Const] : Directive[?Const]+\n */\nfunction parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}\n\n/**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\nfunction parseDirective(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.AT);\n return {\n kind: _kinds.DIRECTIVE,\n name: parseName(lexer),\n arguments: parseArguments(lexer, isConst),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Types section.\n\n/**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\nfunction parseTypeReference(lexer) {\n var start = lexer.token;\n var type = void 0;\n if (skip(lexer, _lexer.TokenKind.BRACKET_L)) {\n type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.BRACKET_R);\n type = {\n kind: _kinds.LIST_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n } else {\n type = parseNamedType(lexer);\n }\n if (skip(lexer, _lexer.TokenKind.BANG)) {\n return {\n kind: _kinds.NON_NULL_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n }\n return type;\n}\n\n/**\n * NamedType : Name\n */\nfunction parseNamedType(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.NAMED_TYPE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Type Definition section.\n\n/**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - TypeExtension\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\nfunction parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeDefinition(lexer);\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n case 'union':\n return parseUnionTypeDefinition(lexer);\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n case 'extend':\n return parseTypeExtension(lexer);\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\nfunction peekDescription(lexer) {\n return peek(lexer, _lexer.TokenKind.STRING) || peek(lexer, _lexer.TokenKind.BLOCK_STRING);\n}\n\n/**\n * Description : StringValue\n */\nfunction parseDescription(lexer) {\n if (peekDescription(lexer)) {\n return parseStringLiteral(lexer);\n }\n}\n\n/**\n * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ }\n */\nfunction parseSchemaDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = many(lexer, _lexer.TokenKind.BRACE_L, parseOperationTypeDefinition, _lexer.TokenKind.BRACE_R);\n return {\n kind: _kinds.SCHEMA_DEFINITION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationTypeDefinition : OperationType : NamedType\n */\nfunction parseOperationTypeDefinition(lexer) {\n var start = lexer.token;\n var operation = parseOperationType(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseNamedType(lexer);\n return {\n kind: _kinds.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\nfunction parseScalarTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\nfunction parseObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ImplementsInterfaces : implements NamedType+\n */\nfunction parseImplementsInterfaces(lexer) {\n var types = [];\n if (lexer.token.value === 'implements') {\n lexer.advance();\n do {\n types.push(parseNamedType(lexer));\n } while (peek(lexer, _lexer.TokenKind.NAME));\n }\n return types;\n}\n\n/**\n * FieldsDefinition : { FieldDefinition+ }\n */\nfunction parseFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseFieldDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\nfunction parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\nfunction parseArgumentDefs(lexer) {\n if (!peek(lexer, _lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer, _lexer.TokenKind.PAREN_L, parseInputValueDef, _lexer.TokenKind.PAREN_R);\n}\n\n/**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\nfunction parseInputValueDef(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var defaultValue = void 0;\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n defaultValue = parseConstValue(lexer);\n }\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\nfunction parseInterfaceTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? MemberTypesDefinition?\n */\nfunction parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * MemberTypesDefinition : = MemberTypes\n *\n * MemberTypes :\n * - `|`? NamedType\n * - MemberTypes | NamedType\n */\nfunction parseMemberTypesDefinition(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}\n\n/**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\nfunction parseEnumTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n return {\n kind: _kinds.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\nfunction parseEnumValuesDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseEnumValueDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\nfunction parseEnumValueDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\nfunction parseInputObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\nfunction parseInputFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseInputValueDef, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\nfunction parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\n/**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\nfunction parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\nfunction parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeExtension :\n * - extend interface Name Directives[Const]? FieldsDefinition\n * - extend interface Name Directives[Const]\n */\nfunction parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? MemberTypesDefinition\n * - extend union Name Directives[Const]\n */\nfunction parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\nfunction parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\nfunction parseInputObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? on DirectiveLocations\n */\nfunction parseDirectiveDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'directive');\n expect(lexer, _lexer.TokenKind.AT);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expectKeyword(lexer, 'on');\n var locations = parseDirectiveLocations(lexer);\n return {\n kind: _kinds.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n locations: locations,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\nfunction parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}\n\n/*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\nfunction parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n if (_directiveLocation.DirectiveLocation.hasOwnProperty(name.value)) {\n return name;\n }\n throw unexpected(lexer, start);\n}\n\n// Core parsing utility functions\n\n/**\n * Returns a location object, used to identify the place in\n * the source that created a given parsed object.\n */\nfunction loc(lexer, startToken) {\n if (!lexer.options.noLocation) {\n return new Loc(startToken, lexer.lastToken, lexer.source);\n }\n}\n\nfunction Loc(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nLoc.prototype.toJSON = Loc.prototype.inspect = function toJSON() {\n return { start: this.start, end: this.end };\n};\n\n/**\n * Determines if the next token is of a given kind\n */\nfunction peek(lexer, kind) {\n return lexer.token.kind === kind;\n}\n\n/**\n * If the next token is of the given kind, return true after advancing\n * the lexer. Otherwise, do not change the parser state and return false.\n */\nfunction skip(lexer, kind) {\n var match = lexer.token.kind === kind;\n if (match) {\n lexer.advance();\n }\n return match;\n}\n\n/**\n * If the next token is of the given kind, return that token after advancing\n * the lexer. Otherwise, do not change the parser state and throw an error.\n */\nfunction expect(lexer, kind) {\n var token = lexer.token;\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * If the next token is a keyword with the given value, return that token after\n * advancing the lexer. Otherwise, do not change the parser state and return\n * false.\n */\nfunction expectKeyword(lexer, value) {\n var token = lexer.token;\n if (token.kind === _lexer.TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected \"' + value + '\", found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Helper function for creating an error when an unexpected lexed token\n * is encountered.\n */\nfunction unexpected(lexer, atToken) {\n var token = atToken || lexer.token;\n return (0, _error.syntaxError)(lexer.source, token.start, 'Unexpected ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Returns a possibly empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction any(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}\n\n/**\n * Returns a non-empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction many(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [parseFn(lexer)];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.visit = visit;\nexports.visitInParallel = visitInParallel;\nexports.visitWithTypeInfo = visitWithTypeInfo;\nexports.getVisitFn = getVisitFn;\n\n\n/**\n * A visitor is comprised of visit functions, which are called on each node\n * during the visitor's traversal.\n */\n\n\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar QueryDocumentKeys = exports.QueryDocumentKeys = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name',\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations']\n};\n\n/**\n * A KeyMap describes each the traversable properties of each kind of node.\n */\nvar BREAK = exports.BREAK = {};\n\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\nfunction visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n node = clone;\n }\n var editOffset = 0;\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n if (inArray) {\n editKey -= editOffset;\n }\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n if (node === null || node === undefined) {\n continue;\n }\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + JSON.stringify(node));\n }\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n if (parent) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\nfunction visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\nfunction visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}\n\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\nfunction getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n var specificKindVisitor = specificVisitor[kind];\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.print = print;\n\nvar _visitor = require('./visitor');\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\nfunction print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n\n // Document\n\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet;\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n\n\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue;\n return variable + ': ' + type + wrap(' = ', defaultValue);\n },\n\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n\n // Fragments\n\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'fragment ' + name + wrap('(', join(variableDefinitions, ', '), ')') + ' ' + ('on ' + typeCondition + ' ' + wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n\n // Value\n\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return JSON.stringify(value);\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n\n // Directive\n\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n\n // Type\n\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n\n // Type System Definitions\n\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n\n ScalarTypeDefinition: function ScalarTypeDefinition(_ref22) {\n var description = _ref22.description,\n name = _ref22.name,\n directives = _ref22.directives;\n return join([description, join(['scalar', name, join(directives, ' ')], ' ')], '\\n');\n },\n\n ObjectTypeDefinition: function ObjectTypeDefinition(_ref23) {\n var description = _ref23.description,\n name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join([description, join(['type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n FieldDefinition: function FieldDefinition(_ref24) {\n var description = _ref24.description,\n name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return join([description, name + wrap('(', join(args, ', '), ')') + ': ' + type + wrap(' ', join(directives, ' '))], '\\n');\n },\n\n InputValueDefinition: function InputValueDefinition(_ref25) {\n var description = _ref25.description,\n name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([description, join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ')], '\\n');\n },\n\n InterfaceTypeDefinition: function InterfaceTypeDefinition(_ref26) {\n var description = _ref26.description,\n name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join([description, join(['interface', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n UnionTypeDefinition: function UnionTypeDefinition(_ref27) {\n var description = _ref27.description,\n name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join([description, join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ')], '\\n');\n },\n\n EnumTypeDefinition: function EnumTypeDefinition(_ref28) {\n var description = _ref28.description,\n name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join([description, join(['enum', name, join(directives, ' '), block(values)], ' ')], '\\n');\n },\n\n EnumValueDefinition: function EnumValueDefinition(_ref29) {\n var description = _ref29.description,\n name = _ref29.name,\n directives = _ref29.directives;\n return join([description, join([name, join(directives, ' ')], ' ')], '\\n');\n },\n\n InputObjectTypeDefinition: function InputObjectTypeDefinition(_ref30) {\n var description = _ref30.description,\n name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join([description, join(['input', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n ScalarTypeExtension: function ScalarTypeExtension(_ref31) {\n var name = _ref31.name,\n directives = _ref31.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n\n ObjectTypeExtension: function ObjectTypeExtension(_ref32) {\n var name = _ref32.name,\n interfaces = _ref32.interfaces,\n directives = _ref32.directives,\n fields = _ref32.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ');\n },\n\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives,\n fields = _ref33.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n\n UnionTypeExtension: function UnionTypeExtension(_ref34) {\n var name = _ref34.name,\n directives = _ref34.directives,\n types = _ref34.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n\n EnumTypeExtension: function EnumTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n values = _ref35.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n fields = _ref36.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n },\n\n DirectiveDefinition: function DirectiveDefinition(_ref37) {\n var description = _ref37.description,\n name = _ref37.name,\n args = _ref37.arguments,\n locations = _ref37.locations;\n return join([description, 'directive @' + name + wrap('(', join(args, ', '), ')') + ' on ' + join(locations, ' | ')], '\\n');\n }\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\nfunction block(array) {\n return array && array.length !== 0 ? indent('{\\n' + join(array, '\\n')) + '\\n}' : '';\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && maybeString.replace(/\\n/g, '\\n ');\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\nfunction printBlockString(value, isDescription) {\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n}","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, false, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = clone;\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Upper cased words. E.g. \"HELLO\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word\n * @param {number} count\n * @param {boolean} inclusive\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['whiskey', 'whiskies']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/(m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/(m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],\n [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'alcohol',\n 'ammo',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'manga',\n 'news',\n 'pike',\n 'plankton',\n 'pliers',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transporation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","import { parse } from \"graphql/language/parser\";\nimport { print } from \"graphql/language/printer\";\nimport { DocumentNode } from \"graphql/language/ast\";\n\n// @ts-ignore\nimport lodashIsEqual from \"lodash.isequal\";\n\n// @ts-ignore\nimport lodashClone from \"lodash.clone\";\n\n// @ts-ignore\nimport pluralizeLib from \"pluralize\";\nexport const pluralize = pluralizeLib.plural;\nexport const singularize = pluralizeLib.singular;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function upcaseFirstLetter(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n\n/**\n * Down cases the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function downcaseFirstLetter(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n\n/**\n * Takes a string with a graphql query and formats it. Useful for debug output and the tests.\n * @param {string} query\n * @returns {string}\n */\nexport function prettify(query: string | DocumentNode): string {\n return print(parseQuery(query));\n}\n\n/**\n * Returns a parsed query as GraphQL AST DocumentNode.\n *\n * @param {string | DocumentNode} query - Query as string or GraphQL AST DocumentNode.\n *\n * @returns {DocumentNode} Query as GraphQL AST DocumentNode.\n */\nexport function parseQuery(query: string | DocumentNode): DocumentNode {\n return typeof query === \"string\" ? parse(query) : query;\n}\n\n/**\n * @param {DocumentNode} query - The GraphQL AST DocumentNode.\n *\n * @returns {string} the GraphQL query within a DocumentNode as a plain string.\n */\nexport function graphQlDocumentToString(query: DocumentNode): string {\n return query.loc!.source.body;\n}\n\n/**\n * Tells if a object is just a simple object.\n *\n * @param {any} obj - Value to check.\n */\nexport function isPlainObject(obj: any): boolean {\n // Basic check for Type object that's not null\n return obj !== null && !(obj instanceof Array) && typeof obj === \"object\";\n}\n\n/**\n * Creates an object composed of the picked `object` properties.\n * @param {object} object - Object.\n * @param {array} props - Properties to pick.\n */\nexport function pick(object: any, props: Array) {\n if (!object) {\n return {};\n }\n\n let index = -1;\n const length = props.length;\n const result = {};\n\n while (++index < length) {\n const prop = props[index];\n result[prop] = object[prop];\n }\n\n return result;\n}\n\nexport function isEqual(a: object, b: object): boolean {\n // Couldn' find a simpler working implementation yet.\n return lodashIsEqual(a, b);\n}\n\nexport function clone(input: any): any {\n // Couldn' find a simpler working implementation yet.\n return lodashClone(input);\n}\n\nexport function takeWhile(\n array: Array,\n predicate: (x: any, idx: number, array: Array) => any\n) {\n let index = -1;\n\n while (++index < array.length && predicate(array[index], index, array)) {\n // just increase index\n }\n\n return array.slice(0, index);\n}\n\nexport function matches(source: any) {\n source = clone(source);\n\n return (object: any) => isEqual(object, source);\n}\n\nexport function removeSymbols(input: any) {\n return JSON.parse(JSON.stringify(input));\n}\n","import { DocumentNode } from \"graphql/language/ast\";\nimport { Arguments } from \"../support/interfaces\";\nimport { FetchPolicy } from \"apollo-client\";\nimport { isPlainObject, prettify } from \"../support/utils\";\n\n/**\n * Vuex-ORM-Apollo Debug Logger.\n * Wraps console and only logs if enabled.\n *\n * Also contains some methods to format graphql queries for the output\n */\nexport default class Logger {\n /**\n * Tells if any logging should happen\n * @type {boolean}\n */\n private readonly enabled: boolean;\n\n /**\n * Fancy Vuex-ORM-Apollo prefix for all log messages.\n * @type {string[]}\n */\n private readonly PREFIX = [\n \"%c Vuex-ORM: GraphQL Plugin %c\",\n \"background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;\",\n \"background: transparent;\"\n ];\n\n /**\n * @constructor\n * @param {boolean} enabled Tells if any logging should happen\n */\n public constructor(enabled: boolean) {\n this.enabled = enabled;\n this.log(\"Logging is enabled.\");\n }\n\n /**\n * Wraps console.group. In TEST env console.log is used instead because console.group doesn't work on CLI.\n * If available console.groupCollapsed will be used instead.\n * @param {Array} messages\n */\n public group(...messages: Array): void {\n if (this.enabled) {\n if (console.groupCollapsed) {\n console.groupCollapsed(...this.PREFIX, ...messages);\n } else {\n console.log(...this.PREFIX, ...messages);\n }\n }\n }\n\n /**\n * Wrapper for console.groupEnd. In TEST env nothing happens because console.groupEnd doesn't work on CLI.\n */\n public groupEnd(): void {\n if (this.enabled && console.groupEnd) console.groupEnd();\n }\n\n /**\n * Wrapper for console.log.\n * @param {Array} messages\n */\n public log(...messages: Array): void {\n if (this.enabled) {\n console.log(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Wrapper for console.warn.\n * @param {Array} messages\n */\n public warn(...messages: Array): void {\n if (this.enabled) {\n console.warn(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Logs a graphql query in a readable format and with all information like fetch policy and variables.\n * @param {string | DocumentNode} query\n * @param {Arguments} variables\n * @param {FetchPolicy} fetchPolicy\n */\n public logQuery(query: string | DocumentNode, variables?: Arguments, fetchPolicy?: FetchPolicy) {\n if (this.enabled) {\n try {\n let prettified = \"\";\n if (isPlainObject(query) && (query as DocumentNode).loc) {\n prettified = prettify((query as DocumentNode).loc!.source.body);\n } else {\n prettified = prettify(query as string);\n }\n\n this.group(\n \"Sending query:\",\n prettified\n .split(\"\\n\")[1]\n .replace(\"{\", \"\")\n .trim()\n );\n console.log(prettified);\n\n if (variables) console.log(\"VARIABLES:\", variables);\n if (fetchPolicy) console.log(\"FETCH POLICY:\", fetchPolicy);\n\n this.groupEnd();\n } catch (e) {\n console.error(\"[Vuex-ORM-Apollo] There is a syntax error in the query!\", e, query);\n }\n }\n }\n}\n","import { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport { Field, PatchedModel } from \"../support/interfaces\";\nimport Context from \"../common/context\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport { pluralize, singularize, pick, isEqual } from \"../support/utils\";\n\n/**\n * Wrapper around a Vuex-ORM model with some useful methods.\n *\n * Also provides a mock system, to define mocking responses for actions.\n */\nexport default class Model {\n /**\n * The singular name of a model like `blogPost`\n * @type {string}\n */\n public readonly singularName: string;\n\n /**\n * The plural name of a model like `blogPosts`\n * @type {string}\n */\n public readonly pluralName: string;\n\n /**\n * The original Vuex-ORM model\n */\n public readonly baseModel: typeof PatchedModel;\n\n /**\n * The fields of the model\n * @type {Map}\n */\n public readonly fields: Map = new Map();\n\n /**\n * Container for the mocks.\n * @type {Object}\n */\n private mocks: { [key: string]: Array } = {};\n\n /**\n * @constructor\n * @param {Model} baseModel The original Vuex-ORM model\n */\n public constructor(baseModel: typeof ORMModel) {\n this.baseModel = baseModel as typeof PatchedModel;\n\n // Generate name variants\n this.singularName = singularize(this.baseModel.entity);\n this.pluralName = pluralize(this.baseModel.entity);\n\n // Cache the fields of the model in this.fields\n const fields = this.baseModel.fields();\n Object.keys(fields).forEach((name: string) => {\n this.fields.set(name, fields[name] as Field);\n });\n }\n\n /**\n * Tells if a field is a numeric field.\n *\n * @param {Field | undefined} field\n * @returns {boolean}\n */\n public static isFieldNumber(field: Field | undefined): boolean {\n if (!field) return false;\n\n const context = Context.getInstance();\n return (\n field instanceof context.components.Number || field instanceof context.components.Increment\n );\n }\n\n /**\n * Tells if a field is a attribute (and thus not a relation)\n * @param {Field} field\n * @returns {boolean}\n */\n public static isFieldAttribute(field: Field): boolean {\n const context = Context.getInstance();\n\n return (\n field instanceof context.components.Increment ||\n field instanceof context.components.Attr ||\n field instanceof context.components.String ||\n field instanceof context.components.Number ||\n field instanceof context.components.Boolean\n );\n }\n\n /**\n * Tells if a field which represents a relation is a connection (multiple).\n * @param {Field} field\n * @returns {boolean}\n */\n public static isConnection(field: Field): boolean {\n const context = Context.getInstance();\n\n return !(\n field instanceof context.components.BelongsTo ||\n field instanceof context.components.HasOne ||\n field instanceof context.components.MorphTo ||\n field instanceof context.components.MorphOne\n );\n }\n\n /**\n * Adds $isPersisted and other meta fields to the model by overwriting the fields() method.\n * @todo is this a good way to add fields?\n * @param {Model} model\n */\n public static augment(model: Model) {\n const originalFieldGenerator = model.baseModel.fields.bind(model.baseModel);\n\n model.baseModel.fields = () => {\n const originalFields = originalFieldGenerator();\n\n originalFields[\"$isPersisted\"] = model.baseModel.boolean(false);\n\n return originalFields;\n };\n }\n\n /**\n * Returns the related model for a relation.\n * @param {Field|undefined} relation Relation field.\n * @returns {Model|null}\n */\n public static getRelatedModel(relation?: Relation) {\n if (relation === undefined) return null;\n\n const context: Context = Context.getInstance();\n\n if (\n relation instanceof context.components.BelongsToMany ||\n relation instanceof context.components.HasMany ||\n relation instanceof context.components.HasManyThrough ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphToMany ||\n relation instanceof context.components.HasOne\n ) {\n return context.getModel(relation.related.entity, true);\n } else if (\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasManyBy\n ) {\n return context.getModel(relation.parent.entity, true);\n } else if (relation instanceof context.components.MorphTo) {\n return context.getModel(relation.type, true);\n } else {\n console.warn(\"Failed relation\", typeof relation, relation);\n throw new Error(`Can't find related model for relation of type ${typeof relation}!`);\n }\n }\n\n /**\n * Returns all fields which should be included in a graphql query: All attributes which are not included in the\n * skipFields array or start with $.\n * @returns {Array} field names which should be queried\n */\n public getQueryFields(): Array {\n const fields: Array = [];\n\n this.fields.forEach((field: Field, name: string) => {\n if (Model.isFieldAttribute(field) && !this.skipField(name)) {\n fields.push(name);\n }\n });\n\n return fields;\n }\n\n /**\n * Tells if a field should be ignored. This is true for fields that start with a `$` or is it is within the skipField\n * property or is the foreignKey of a belongsTo/hasOne relation.\n *\n * @param {string} field\n * @returns {boolean}\n */\n public skipField(field: string) {\n if (field.startsWith(\"$\")) return true;\n if (this.baseModel.skipFields && this.baseModel.skipFields.indexOf(field) >= 0) return true;\n\n const context = Context.getInstance();\n\n let shouldSkipField: boolean = false;\n\n this.getRelations().forEach((relation: Relation) => {\n if (\n (relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasOne) &&\n relation.foreignKey === field\n ) {\n shouldSkipField = true;\n return false;\n }\n return true;\n });\n\n return shouldSkipField;\n }\n\n /**\n * @returns {Map} all relations of the model.\n */\n public getRelations(): Map {\n const relations = new Map();\n\n this.fields.forEach((field: Field, name: string) => {\n if (!Model.isFieldAttribute(field)) {\n relations.set(name, field as Relation);\n }\n });\n\n return relations;\n }\n\n /**\n * This accepts a field like `subjectType` and checks if this is just randomly named `...Type` or it is part\n * of a polymorphic relation.\n * @param {string} name\n * @returns {boolean}\n */\n public isTypeFieldOfPolymorphicRelation(name: string): boolean {\n const context = Context.getInstance();\n let found: boolean = false;\n\n context.models.forEach(model => {\n if (found) return false;\n\n model.getRelations().forEach(relation => {\n if (\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphTo ||\n relation instanceof context.components.MorphToMany\n ) {\n const related = (relation as Field).related;\n\n if (relation.type === name && related && related.entity === this.baseModel.entity) {\n found = true;\n return false; // break\n }\n }\n\n return true;\n });\n\n return true;\n });\n\n return found;\n }\n\n /**\n * Returns a record of this model with the given ID.\n * @param {number} id\n * @returns {any}\n */\n public getRecordWithId(id: number) {\n return this.baseModel\n .query()\n .withAllRecursive()\n .where(\"id\", id)\n .first();\n }\n\n /**\n * Determines if we should eager load (means: add as a field in the graphql query) a related entity. belongsTo,\n * hasOne and morphOne related entities are always eager loaded. Others can be added to the `eagerLoad` array\n * or `eagerSync` of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerLoadRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // HasOne, BelongsTo and MorphOne are always eager loaded\n if (\n relation instanceof context.components.HasOne ||\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.MorphOne\n ) {\n return true;\n }\n\n // Create a list of all relations that have to be eager loaded\n const eagerLoadList: Array = this.baseModel.eagerLoad || [];\n Array.prototype.push.apply(eagerLoadList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerLoadList.\n return (\n eagerLoadList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Determines if we should eager save (means: add as a field in the graphql mutation) a related entity. belongsTo\n * related entities are always eager saved. Others can be added to the `eagerSave` or `eagerSync` array of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerSaveRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // BelongsTo is always eager saved\n if (relation instanceof context.components.BelongsTo) {\n return true;\n }\n\n // Create a list of all relations that have to be eager saved\n const eagerSaveList: Array = this.baseModel.eagerSave || [];\n Array.prototype.push.apply(eagerSaveList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerSaveList.\n return (\n eagerSaveList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Adds a mock.\n *\n * @param {Mock} mock - Mock config.\n * @returns {boolean}\n */\n public $addMock(mock: Mock): boolean {\n if (this.$findMock(mock.action, mock.options)) return false;\n if (!this.mocks[mock.action]) this.mocks[mock.action] = [];\n\n this.mocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions like { variables: { id: 42 } }.\n * @returns {Mock | null} null when no mock was found.\n */\n public $findMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.mocks[action]) {\n return (\n this.mocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by all actions in order to get the mock returnValue.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public $mockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.$findMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n if (returnValue) {\n if (returnValue instanceof Array) {\n returnValue.forEach(r => (r.$isPersisted = true));\n } else {\n returnValue.$isPersisted = true;\n }\n\n return { [this.pluralName]: returnValue };\n }\n\n return null;\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new Error(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new Error(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle\r\n// the `skip` and `include` directives within GraphQL.\r\nimport {\r\n FieldNode,\r\n OperationDefinitionNode,\r\n SelectionNode,\r\n VariableNode,\r\n BooleanValueNode,\r\n DirectiveNode,\r\n DocumentNode,\r\n} from 'graphql';\r\n\r\nimport { argumentsObjectFromField } from './storeUtils';\r\n\r\nexport type DirectiveInfo = {\r\n [fieldName: string]: { [argName: string]: any };\r\n};\r\n\r\nexport function getDirectiveInfoFromField(\r\n field: FieldNode,\r\n variables: Object,\r\n): DirectiveInfo {\r\n if (field.directives && field.directives.length) {\r\n const directiveObj: DirectiveInfo = {};\r\n field.directives.forEach((directive: DirectiveNode) => {\r\n directiveObj[directive.name.value] = argumentsObjectFromField(\r\n directive,\r\n variables,\r\n );\r\n });\r\n return directiveObj;\r\n }\r\n return null;\r\n}\r\n\r\nexport function shouldInclude(\r\n selection: SelectionNode,\r\n variables: { [name: string]: any } = {},\r\n): boolean {\r\n if (!selection.directives) {\r\n return true;\r\n }\r\n\r\n let res: boolean = true;\r\n selection.directives.forEach(directive => {\r\n // TODO should move this validation to GraphQL validation once that's implemented.\r\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\r\n // Just don't worry about directives we don't understand\r\n return;\r\n }\r\n\r\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\r\n const directiveArguments = directive.arguments || [];\r\n const directiveName = directive.name.value;\r\n if (directiveArguments.length !== 1) {\r\n throw new Error(\r\n `Incorrect number of arguments for the @${directiveName} directive.`,\r\n );\r\n }\r\n\r\n const ifArgument = directiveArguments[0];\r\n if (!ifArgument.name || ifArgument.name.value !== 'if') {\r\n throw new Error(`Invalid argument for the @${directiveName} directive.`);\r\n }\r\n\r\n const ifValue = directiveArguments[0].value;\r\n let evaledValue: boolean = false;\r\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\r\n // means it has to be a variable value if this is a valid @skip or @include directive\r\n if (ifValue.kind !== 'Variable') {\r\n throw new Error(\r\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\r\n );\r\n } else {\r\n evaledValue = variables[(ifValue as VariableNode).name.value];\r\n if (evaledValue === undefined) {\r\n throw new Error(\r\n `Invalid variable referenced in @${directiveName} directive.`,\r\n );\r\n }\r\n }\r\n } else {\r\n evaledValue = (ifValue as BooleanValueNode).value;\r\n }\r\n\r\n if (directiveName === 'skip') {\r\n evaledValue = !evaledValue;\r\n }\r\n\r\n if (!evaledValue) {\r\n res = false;\r\n }\r\n });\r\n\r\n return res;\r\n}\r\n\r\nexport function flattenSelections(selection: SelectionNode): SelectionNode[] {\r\n if (\r\n !(selection as FieldNode).selectionSet ||\r\n !((selection as FieldNode).selectionSet.selections.length > 0)\r\n )\r\n return [selection];\r\n\r\n return [selection].concat(\r\n (selection as FieldNode).selectionSet.selections\r\n .map(selectionNode =>\r\n [selectionNode].concat(flattenSelections(selectionNode)),\r\n )\r\n .reduce((selections, selected) => selections.concat(selected), []),\r\n );\r\n}\r\n\r\nexport function getDirectiveNames(doc: DocumentNode) {\r\n // operation => [names of directives];\r\n const directiveNames = doc.definitions\r\n .filter(\r\n (definition: OperationDefinitionNode) =>\r\n definition.selectionSet && definition.selectionSet.selections,\r\n )\r\n // operation => [[Selection]]\r\n .map(x => flattenSelections(x as any))\r\n // [[Selection]] => [Selection]\r\n .reduce((selections, selected) => selections.concat(selected), [])\r\n // [Selection] => [Selection with Directives]\r\n .filter(\r\n (selection: SelectionNode) =>\r\n selection.directives && selection.directives.length > 0,\r\n )\r\n // [Selection with Directives] => [[Directives]]\r\n .map((selection: SelectionNode) => selection.directives)\r\n // [[Directives]] => [Directives]\r\n .reduce((directives, directive) => directives.concat(directive), [])\r\n // [Directives] => [Name]\r\n .map((directive: DirectiveNode) => directive.name.value);\r\n return directiveNames;\r\n}\r\n\r\nexport function hasDirectives(names: string[], doc: DocumentNode) {\r\n return getDirectiveNames(doc).some(\r\n (name: string) => names.indexOf(name) > -1,\r\n );\r\n}\r\n","/**\r\n * Adds the properties of one or more source objects to a target object. Works exactly like\r\n * `Object.assign`, but as a utility to maintain support for IE 11.\r\n *\r\n * @see https://github.com/apollostack/apollo-client/pull/1009\r\n */\r\nexport function assign(a: A, b: B): A & B;\r\nexport function assign(a: A, b: B, c: C): A & B & C;\r\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\r\nexport function assign(\r\n a: A,\r\n b: B,\r\n c: C,\r\n d: D,\r\n e: E,\r\n): A & B & C & D & E;\r\nexport function assign(target: any, ...sources: Array): any;\r\nexport function assign(\r\n target: { [key: string]: any },\r\n ...sources: Array<{ [key: string]: any }>\r\n): { [key: string]: any } {\r\n sources.forEach(source => {\r\n if (typeof source === 'undefined' || source === null) {\r\n return;\r\n }\r\n Object.keys(source).forEach(key => {\r\n target[key] = source[key];\r\n });\r\n });\r\n return target;\r\n}\r\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n DefinitionNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { cloneDeep } from './util/cloneDeep';\n\nimport {\n checkDocument,\n getOperationDefinitionOrDie,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n} from './getFromAST';\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isNotEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): Boolean {\n // keep selections that are still valid\n return (\n op.selectionSet.selections.filter(\n selectionSet =>\n // anything that doesn't match the compound filter is okay\n !// not an empty array\n (\n selectionSet &&\n // look into fragments to verify they should stay\n selectionSet.kind === 'FragmentSpread' &&\n // see if the fragment in the map is valid (recursively)\n !isNotEmpty(fragments[selectionSet.name.value], fragments)\n ),\n ).length > 0\n );\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode): Boolean {\n return directives.some(\n (dir: RemoveDirectiveConfig | GetDirectiveConfig) => {\n if (dir.name && dir.name === directive.name.value) return true;\n if (dir.test && dir.test(directive)) return true;\n return false;\n },\n );\n };\n}\n\nfunction addTypenameToSelectionSet(\n selectionSet: SelectionSetNode,\n isRoot = false,\n) {\n if (selectionSet.selections) {\n if (!isRoot) {\n const alreadyHasThisField = selectionSet.selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n });\n\n if (!alreadyHasThisField) {\n selectionSet.selections.push(TYPENAME_FIELD);\n }\n }\n\n selectionSet.selections.forEach(selection => {\n // Must not add __typename if we're inside an introspection query\n if (selection.kind === 'Field') {\n if (\n selection.name.value.lastIndexOf('__', 0) !== 0 &&\n selection.selectionSet\n ) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n } else if (selection.kind === 'InlineFragment') {\n if (selection.selectionSet) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n }\n });\n }\n}\n\nexport type RemoveDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n remove?: boolean;\n};\n\nfunction removeDirectivesFromSelectionSet(\n directives: RemoveDirectiveConfig[],\n selectionSet: SelectionSetNode,\n): SelectionSetNode {\n if (!selectionSet.selections) return selectionSet;\n // if any of the directives are set to remove this selectionSet, remove it\n const agressiveRemove = directives.some(\n (dir: RemoveDirectiveConfig) => dir.remove,\n );\n\n selectionSet.selections = selectionSet.selections\n .map(selection => {\n if (\n selection.kind !== 'Field' ||\n !(selection as FieldNode) ||\n !selection.directives\n )\n return selection;\n const directiveMatcher = getDirectiveMatcher(directives);\n let remove: boolean;\n selection.directives = selection.directives.filter(directive => {\n const shouldKeep = !directiveMatcher(directive);\n\n if (!remove && !shouldKeep && agressiveRemove) remove = true;\n\n return shouldKeep;\n });\n\n return remove ? null : selection;\n })\n .filter(x => !!x);\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n removeDirectivesFromSelectionSet(directives, selection.selectionSet);\n }\n });\n\n return selectionSet;\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n removeDirectivesFromSelectionSet(\n directives,\n (definition as OperationDefinitionNode).selectionSet,\n );\n });\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode) {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n const isRoot = definition.kind === 'OperationDefinition';\n addTypenameToSelectionSet(\n (definition as OperationDefinitionNode).selectionSet,\n isRoot,\n );\n });\n return docClone;\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n checkDocument(doc);\n return removeDirectivesFromDocument([connectionRemoveConfig], doc);\n}\n\nexport type GetDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n};\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n if (!(selectionSet && selectionSet.selections)) {\n return false;\n }\n const matchedSelections = selectionSet.selections.filter(selection => {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n });\n return matchedSelections.length > 0;\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n const directiveMatcher = getDirectiveMatcher(directives);\n const matchedDirectives = selection.directives.filter(directiveMatcher);\n return (\n matchedDirectives.length > 0 ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nfunction getDirectivesFromSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n) {\n selectionSet.selections = selectionSet.selections\n .filter(selection => {\n return hasDirectivesInSelection(directives, selection, true);\n })\n .map(selection => {\n if (hasDirectivesInSelection(directives, selection, false)) {\n return selection;\n }\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n selection.selectionSet = getDirectivesFromSelectionSet(\n directives,\n selection.selectionSet,\n );\n }\n return selection;\n });\n return selectionSet;\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n includeAllFragments = false,\n): DocumentNode | null {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n docClone.definitions = docClone.definitions.map(definition => {\n if (\n (definition.kind === 'OperationDefinition' ||\n (definition.kind === 'FragmentDefinition' && !includeAllFragments)) &&\n definition.selectionSet\n ) {\n definition.selectionSet = getDirectivesFromSelectionSet(\n directives,\n definition.selectionSet,\n );\n }\n return definition;\n });\n\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/networkStatus.ts"},"export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// === Symbol Support ===\n\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species');\n\n// === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n\n if (value == null) return undefined;\n\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n if (ctor === null) {\n ctor = undefined;\n }\n }\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n if (!queue) {\n return;\n }\n subscription._queue = undefined;\n subscription._state = 'ready';\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({ type: type, value: value });\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{ type: type, value: value }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = function () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: 'unsubscribe',\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: 'closed',\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = function () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: 'next',\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: 'error',\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: 'complete',\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: 'closed',\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = exports.Observable = function () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: 'subscribe',\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: 'forEach',\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: 'map',\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'filter',\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'reduce',\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'concat',\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscription = void 0;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: 'flatMap',\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: 'from',\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n\n if (x == null) throw new TypeError(x + ' is not an object');\n\n var method = getMethod(x, SymbolObservable);\n if (method) {\n var observable = method.call(x);\n\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n\n if (isObservable(observable) && observable.constructor === C) return observable;\n\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n\n observer.next(item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: 'of',\n value: function of() {\n for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","module.exports = require('./lib/Observable.js').Observable;\n","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/util/Observable.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/errors/ApolloError.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/types.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/ObservableQuery.ts"},"import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n Observable,\n} from 'apollo-link';\n\n/*\n * Expects context to contain the forceFetch field if no dedup\n */\nexport class DedupLink extends ApolloLink {\n private inFlightRequestObservables: Map<\n string,\n Observable\n > = new Map();\n private subscribers: Map = new Map();\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable {\n // sometimes we might not want to deduplicate a request, for example when we want to force fetch it.\n if (operation.getContext().forceFetch) {\n return forward(operation);\n }\n\n const key = operation.toKey();\n\n const cleanup = operationKey => {\n this.inFlightRequestObservables.delete(operationKey);\n const prev = this.subscribers.get(operationKey);\n return prev;\n };\n\n if (!this.inFlightRequestObservables.get(key)) {\n // this is a new request, i.e. we haven't deduplicated it yet\n // call the next link\n const singleObserver = forward(operation);\n let subscription;\n\n const sharedObserver = new Observable(observer => {\n // this will still be called by each subscriber regardless of\n // deduplication status\n let prev = this.subscribers.get(key);\n if (!prev) prev = { next: [], error: [], complete: [] };\n\n this.subscribers.set(key, {\n next: prev.next.concat([observer.next.bind(observer)]),\n error: prev.error.concat([observer.error.bind(observer)]),\n complete: prev.complete.concat([observer.complete.bind(observer)]),\n });\n\n if (!subscription) {\n subscription = singleObserver.subscribe({\n next: result => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) {\n previous.next.forEach(next => next(result));\n previous.complete.forEach(complete => complete());\n }\n },\n error: error => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) previous.error.forEach(err => err(error));\n },\n });\n }\n\n return () => {\n if (subscription) subscription.unsubscribe();\n this.inFlightRequestObservables.delete(key);\n };\n });\n\n this.inFlightRequestObservables.set(key, sharedObserver);\n }\n\n // return shared Observable\n return this.inFlightRequestObservables.get(key);\n }\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/scheduler/scheduler.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/mutations.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/queries.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/QueryManager.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/store.ts"},"exports.version = \"2.4.6\"",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/ApolloClient.ts"},"import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\n(function (invariant) {\r\n function warn() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.warn.apply(console, args);\r\n }\r\n invariant.warn = warn;\r\n function error() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.error.apply(console, args);\r\n }\r\n invariant.error = error;\r\n})(invariant || (invariant = {}));\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant };\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n if (!selection.directives) {\n return true;\n }\n\n let res: boolean = true;\n selection.directives.forEach(directive => {\n // TODO should move this validation to GraphQL validation once that's implemented.\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\n // Just don't worry about directives we don't understand\n return;\n }\n\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\n const directiveArguments = directive.arguments || [];\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue = directiveArguments[0].value;\n let evaledValue: boolean = false;\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue.kind === 'Variable',\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n evaledValue = variables[(ifValue as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directiveName} directive.`,\n );\n } else {\n evaledValue = (ifValue as BooleanValueNode).value;\n }\n\n if (directiveName === 'skip') {\n evaledValue = !evaledValue;\n }\n\n if (!evaledValue) {\n res = false;\n }\n });\n\n return res;\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more then one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n ((selection as FieldNode).name.value === '__typename' ||\n (selection as FieldNode).name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n },\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","\"use strict\";\n\nfunction Cache(options) {\n this.map = new Map;\n this.newest = null;\n this.oldest = null;\n this.max = options && options.max;\n this.dispose = options && options.dispose;\n}\n\nexports.Cache = Cache;\n\nvar Cp = Cache.prototype;\n\nCp.has = function (key) {\n return this.map.has(key);\n};\n\nCp.get = function (key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n};\n\nfunction getEntry(cache, key) {\n var entry = cache.map.get(key);\n if (entry &&\n entry !== cache.newest) {\n var older = entry.older;\n var newer = entry.newer;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = cache.newest;\n entry.older.newer = entry;\n\n entry.newer = null;\n cache.newest = entry;\n\n if (entry === cache.oldest) {\n cache.oldest = newer;\n }\n }\n\n return entry;\n}\n\nCp.set = function (key, value) {\n var entry = getEntry(this, key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n};\n\nCp.clean = function () {\n if (typeof this.max === \"number\") {\n while (this.oldest &&\n this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n};\n\nCp.delete = function (key) {\n var entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n\n if (typeof this.dispose === \"function\") {\n this.dispose(key, entry.value);\n }\n\n return true;\n }\n\n return false;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Although `Symbol` is widely supported these days, we can safely fall\n// back to using a non-enumerable string property without violating any\n// assumptions elsewhere in the implementation.\nvar useSymbol =\n typeof Symbol === \"function\" &&\n typeof Symbol.for === \"function\";\n\n// Used to mark `tuple.prototype` so that all objects that inherit from\n// any `tuple.prototype` object (there could be more than one) will test\n// positive according to `tuple.isTuple`.\nvar brand = useSymbol\n ? Symbol.for(\"immutable-tuple\")\n : \"@@__IMMUTABLE_TUPLE__@@\";\n\n// Used to save a reference to the globally shared `UniversalWeakMap` that\n// stores all known `tuple` objects.\nvar globalKey = useSymbol\n ? Symbol.for(\"immutable-tuple-root\")\n : \"@@__IMMUTABLE_TUPLE_ROOT__@@\";\n\n// Convenient helper for defining hidden immutable properties.\nfunction def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}\n\nvar freeze = Object.freeze || function (obj) {\n return obj;\n};\n\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null) {\n return false;\n }\n case \"function\":\n return true;\n default:\n return false;\n }\n}\n\n// The `mustConvertThisToArray` value is true when the corresponding\n// `Array` method does not attempt to modify `this`, which means we can\n// pass a `tuple` object as `this` without first converting it to an\n// `Array`.\nfunction forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}\n\n// A map data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nvar UniversalWeakMap = function UniversalWeakMap() {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n this._weakMap = null;\n this._strongMap = null;\n this.data = null;\n};\n\n// Since `get` and `set` are the only methods used, that's all I've\n// implemented here.\n\nUniversalWeakMap.prototype.get = function get (key) {\n var map = this._getMap(key, false);\n if (map) {\n return map.get(key);\n }\n};\n\nUniversalWeakMap.prototype.set = function set (key, value) {\n this._getMap(key, true).set(key, value);\n // An actual `Map` or `WeakMap` would return `this` here, but\n // returning the `value` is more convenient for the `tuple`\n // implementation.\n return value;\n};\n\nUniversalWeakMap.prototype._getMap = function _getMap (key, canCreate) {\n if (! canCreate) {\n return isObjRef(key) ? this._weakMap : this._strongMap;\n }\n if (isObjRef(key)) {\n return this._weakMap || (this._weakMap = new WeakMap);\n }\n return this._strongMap || (this._strongMap = new Map);\n};\n\n// See [`universal-weak-map.js`](universal-weak-map.html).\n// See [`util.js`](util.html).\n// If this package is installed multiple times, there could be mutiple\n// implementations of the `tuple` function with distinct `tuple.prototype`\n// objects, but the shared pool of `tuple` objects must be the same across\n// all implementations. While it would be ideal to use the `global`\n// object, there's no reliable way to get the global object across all JS\n// environments without using the `Function` constructor, so instead we\n// use the global `Array` constructor as a shared namespace.\nvar root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);\n\nfunction lookup() {\n return lookupArray(arguments);\n}\n\nfunction lookupArray(array) {\n var node = root;\n\n // Because we are building a tree of *weak* maps, the tree will not\n // prevent objects in tuples from being garbage collected, since the\n // tree itself will be pruned over time when the corresponding `tuple`\n // objects become unreachable. In addition to internalization, this\n // property is a key advantage of the `immutable-tuple` package.\n var len = array.length;\n for (var i = 0; i < len; ++i) {\n var item = array[i];\n node = node.get(item) || node.set(item, new UniversalWeakMap);\n }\n\n // Return node.data rather than node itself to prevent tampering with\n // the UniversalWeakMap tree.\n return node.data || (node.data = Object.create(null));\n}\n\n// See [`lookup.js`](lookup.html).\n// See [`util.js`](util.html).\n// When called with any number of arguments, this function returns an\n// object that inherits from `tuple.prototype` and is guaranteed to be\n// `===` any other `tuple` object that has exactly the same items. In\n// computer science jargon, `tuple` instances are \"internalized\" or just\n// \"interned,\" which allows for constant-time equality checking, and makes\n// it possible for tuple objects to be used as `Map` or `WeakMap` keys, or\n// stored in a `Set`.\nfunction tuple() {\n var arguments$1 = arguments;\n\n var node = lookup.apply(null, arguments);\n\n if (node.tuple) {\n return node.tuple;\n }\n\n var t = Object.create(tuple.prototype);\n\n // Define immutable items with numeric indexes, and permanently fix the\n // `.length` property.\n var argc = arguments.length;\n for (var i = 0; i < argc; ++i) {\n t[i] = arguments$1[i];\n }\n\n def(t, \"length\", argc, false);\n\n // Remember this new `tuple` object so that we can return the same object\n // earlier next time.\n return freeze(node.tuple = t);\n}\n\n// Since the `immutable-tuple` package could be installed multiple times\n// in an application, there is no guarantee that the `tuple` constructor\n// or `tuple.prototype` will be unique, so `value instanceof tuple` is\n// unreliable. Instead, to test if a value is a tuple, you should use\n// `tuple.isTuple(value)`.\ndef(tuple.prototype, brand, true, false);\nfunction isTuple(that) {\n return !! (that && that[brand] === true);\n}\n\ntuple.isTuple = isTuple;\n\nfunction toArray(tuple) {\n var array = [];\n var i = tuple.length;\n while (i--) { array[i] = tuple[i]; }\n return array;\n}\n\n// Copy all generic non-destructive Array methods to `tuple.prototype`.\n// This works because (for example) `Array.prototype.slice` can be invoked\n// against any `Array`-like object.\nforEachArrayMethod(function (name, desc, mustConvertThisToArray) {\n var method = desc && desc.value;\n if (typeof method === \"function\") {\n desc.value = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = method.apply(\n mustConvertThisToArray ? toArray(this) : this,\n args\n );\n // Of course, `tuple.prototype.slice` should return a `tuple` object,\n // not a new `Array`.\n return Array.isArray(result) ? tuple.apply(void 0, result) : result;\n };\n Object.defineProperty(tuple.prototype, name, desc);\n }\n});\n\n// Like `Array.prototype.concat`, except for the extra effort required to\n// convert any tuple arguments to arrays, so that\n// ```\n// tuple(1).concat(tuple(2), 3) === tuple(1, 2, 3)\n// ```\nvar ref = Array.prototype;\nvar concat = ref.concat;\ntuple.prototype.concat = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return tuple.apply(void 0, concat.apply(toArray(this), args.map(\n function (item) { return isTuple(item) ? toArray(item) : item; }\n )));\n};\n\nexports.default = tuple;\nexports.tuple = tuple;\nexports.lookup = lookup;\nexports.lookupArray = lookupArray;\n","\"use strict\";\n\nvar fakeNullFiber = new (function Fiber(){});\nvar localKey = \"_optimism_local\";\n\nfunction getCurrentFiber() {\n return fakeNullFiber;\n}\n\nif (typeof module === \"object\") {\n try {\n var Fiber = module[\"eriuqer\".split(\"\").reverse().join(\"\")](\"fibers\");\n // If we were able to require fibers, redefine the getCurrentFiber\n // function so that it has a chance to return Fiber.current.\n getCurrentFiber = function () {\n return Fiber.current || fakeNullFiber;\n };\n } catch (e) {}\n}\n\n// Returns an object unique to Fiber.current, if fibers are enabled.\n// This object is used for Fiber-local storage in ./entry.js.\nexports.get = function () {\n var fiber = getCurrentFiber();\n return fiber[localKey] || (fiber[localKey] = Object.create(null));\n};\n","\"use strict\";\n\nvar getLocal = require(\"./local.js\").get;\nvar UNKNOWN_VALUE = Object.create(null);\nvar emptySetPool = [];\nvar entryPool = [];\n\n// Don't let the emptySetPool or entryPool grow larger than this size,\n// since unconstrained pool growth could lead to memory leaks.\nexports.POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition, optionalMessage) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nfunction Entry(fn, key, args) {\n this.parents = new Set;\n this.childValues = new Map;\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n this.dirtyChildren = null;\n\n reset(this, fn, key, args);\n\n ++Entry.count;\n}\n\nEntry.count = 0;\n\nfunction reset(entry, fn, key, args) {\n entry.fn = fn;\n entry.key = key;\n entry.args = args;\n entry.value = UNKNOWN_VALUE;\n entry.dirty = true;\n entry.subscribe = null;\n entry.unsubscribe = null;\n entry.recomputing = false;\n // Optional callback that will be invoked when entry.parents becomes\n // empty. The Entry object is given as the first parameter. If the\n // callback returns true, then this entry can be removed from the graph\n // and safely recycled into the entryPool.\n entry.reportOrphan = null;\n}\n\nEntry.acquire = function (fn, key, args) {\n var entry = entryPool.pop();\n if (entry) {\n reset(entry, fn, key, args);\n return entry;\n }\n return new Entry(fn, key, args);\n};\n\nfunction release(entry) {\n assert(entry.parents.size === 0);\n assert(entry.childValues.size === 0);\n assert(entry.dirtyChildren === null);\n if (entryPool.length < exports.POOL_TARGET_SIZE) {\n entryPool.push(entry);\n }\n}\n\nexports.Entry = Entry;\n\nvar Ep = Entry.prototype;\n\n// The public API of Entry objects consists of the Entry constructor,\n// along with the recompute, setDirty, and dispose methods.\n\nEp.recompute = function recompute() {\n if (! rememberParent(this) &&\n maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispos(), which recycles it\n // into the entryPool, so we don't need to (and should not) proceed\n // with the recomputation.\n return;\n }\n\n return recomputeIfDirty(this);\n};\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry) {\n var report = entry.reportOrphan;\n return typeof report === \"function\" &&\n entry.parents.size === 0 &&\n report(entry) === true;\n}\n\nEp.setDirty = function setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n unsubscribe(this);\n};\n\nEp.dispose = function dispose() {\n var entry = this;\n forgetChildren(entry).forEach(maybeReportOrphan);\n unsubscribe(entry);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n entry.parents.forEach(function (parent) {\n parent.setDirty();\n forgetChild(parent, entry);\n });\n\n // Since this entry has no parents and no children anymore, and the\n // caller of Entry#dispose has indicated that entry.value no longer\n // matters, we can safely recycle this Entry object for later use.\n release(entry);\n};\n\nfunction setClean(entry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(entry) {\n entry.parents.forEach(function (parent) {\n reportDirtyChild(parent, entry);\n });\n}\n\nfunction reportClean(entry) {\n entry.parents.forEach(function (parent) {\n reportCleanChild(parent, entry);\n });\n}\n\nfunction mightBeDirty(entry) {\n return entry.dirty ||\n (entry.dirtyChildren &&\n entry.dirtyChildren.size);\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (entry.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n entry.dirtyChildren.add(child);\n reportDirty(entry);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(entry, child) {\n var cv = entry.childValues;\n\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(cv.has(child));\n assert(! mightBeDirty(child));\n\n var childValue = cv.get(child);\n if (childValue === UNKNOWN_VALUE) {\n cv.set(child, child.value);\n } else if (childValue !== child.value) {\n entry.setDirty();\n }\n\n removeDirtyChild(entry, child);\n\n if (mightBeDirty(entry)) {\n return;\n }\n\n reportClean(entry);\n}\n\nfunction removeDirtyChild(entry, child) {\n var dc = entry.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < exports.POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n entry.dirtyChildren = null;\n }\n }\n}\n\nfunction rememberParent(entry) {\n var local = getLocal();\n var parent = local.currentParentEntry;\n if (parent) {\n entry.parents.add(parent);\n\n if (! parent.childValues.has(entry)) {\n parent.childValues.set(entry, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(entry)) {\n reportDirtyChild(parent, entry);\n } else {\n reportCleanChild(parent, entry);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren.forEach(function (child) {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n var originalChildren = forgetChildren(entry);\n\n var local = getLocal();\n var parent = local.currentParentEntry;\n local.currentParentEntry = entry;\n\n var threw = true;\n try {\n entry.value = entry.fn.apply(null, entry.args);\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n assert(local.currentParentEntry === entry);\n local.currentParentEntry = parent;\n\n if (threw || ! subscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nvar reusableEmptyArray = [];\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(entry) {\n var children = reusableEmptyArray;\n\n if (entry.childValues.size > 0) {\n children = [];\n entry.childValues.forEach(function (value, child) {\n forgetChild(entry, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefor must have been reset to null.\n assert(entry.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(entry, child) {\n child.parents.delete(entry);\n entry.childValues.delete(child);\n removeDirtyChild(entry, child);\n}\n\nfunction subscribe(entry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n unsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction unsubscribe(entry) {\n var unsub = entry.unsubscribe;\n if (typeof unsub === \"function\") {\n entry.unsubscribe = null;\n unsub();\n }\n}\n","\"use strict\";\n\nvar Cache = require(\"./cache.js\").Cache;\nvar tuple = require(\"immutable-tuple\").tuple;\nvar Entry = require(\"./entry.js\").Entry;\nvar getLocal = require(\"./local.js\").get;\n\n// Exported so that custom makeCacheKey functions can easily reuse the\n// default implementation (with different arguments).\nexports.defaultMakeCacheKey = tuple;\n\nfunction normalizeOptions(options) {\n options = options || Object.create(null);\n\n if (typeof options.makeCacheKey !== \"function\") {\n options.makeCacheKey = tuple;\n }\n\n if (typeof options.max !== \"number\") {\n options.max = Math.pow(2, 16);\n }\n\n return options;\n}\n\nfunction wrap(fn, options) {\n options = normalizeOptions(options);\n\n // If this wrapped function is disposable, then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n var disposable = !! options.disposable;\n\n var cache = new Cache({\n max: options.max,\n dispose: function (key, entry) {\n entry.dispose();\n }\n });\n\n function reportOrphan(entry) {\n if (disposable) {\n // Triggers the entry.dispose() call above.\n cache.delete(entry.key);\n return true;\n }\n }\n\n function optimistic() {\n if (disposable && ! getLocal().currentParentEntry) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return;\n }\n\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return fn.apply(null, arguments);\n }\n\n var args = [], len = arguments.length;\n while (len--) args[len] = arguments[len];\n\n var entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n cache.set(key, entry = Entry.acquire(fn, key, args));\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = reportOrphan;\n }\n }\n\n var value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if this entry\n // has no parents, which means we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (entry.parents.size === 0) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n if (! disposable) {\n return value;\n }\n }\n\n optimistic.dirty = function () {\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return;\n }\n\n if (! cache.has(key)) {\n return;\n }\n\n cache.get(key).setDirty();\n };\n\n return optimistic;\n}\n\nexports.wrap = wrap;\n","// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n invariant(\n obj.__typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","export class CacheKeyNode {\n private children: Map> | null = null;\n private key: KeyType | null = null;\n\n lookup(...args: any[]): KeyType {\n return this.lookupArray(args);\n }\n\n lookupArray(array: any[]): KeyType {\n let node: CacheKeyNode = this;\n array.forEach(value => {\n node = node.getOrCreate(value);\n });\n return node.key || (node.key = Object.create(null));\n }\n\n getOrCreate(value: any): CacheKeyNode {\n const map = this.children || (this.children = new Map());\n let node = map.get(value);\n if (!node) {\n map.set(value, (node = new CacheKeyNode()));\n }\n return node;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<(dataId: string) => StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n assign,\n getDefaultValues,\n getQueryDefinition,\n isEqual,\n DirectiveInfo,\n FragmentMap,\n IdValue,\n StoreValue,\n argumentsObjectFromField,\n createFragmentMap,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getStoreKeyName,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n resultKeyNameFromField,\n shouldInclude,\n toIdValue,\n mergeDeepArray,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap } from 'optimism';\nimport { CacheKeyNode } from './cacheKeys';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\nexport class StoreReader {\n constructor(\n private cacheKeyRoot = new CacheKeyNode,\n ) {\n const reader = this;\n const {\n executeStoreQuery,\n executeSelectionSet,\n } = reader;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n query,\n contextValue.store,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n selectionSet,\n execContext.contextValue.store,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray(\n field,\n readStoreResult.result,\n execContext,\n ),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n result = result.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray(field, item, execContext));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n return { result, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const idValue = toIdValue({ id: 'self', typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ self: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { CacheKeyNode } from './cacheKeys';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new CacheKeyNode();\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeReader = new StoreReader(this.cacheKeyRoot);\n this.storeWriter = new StoreWriter();\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n","import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = Error & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new Error(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch is nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n","import Model from \"../orm/model\";\n\nexport enum ConnectionMode {\n AUTO,\n PLAIN,\n NODES,\n EDGES\n}\n\nexport enum ArgumentMode {\n TYPE,\n LIST\n}\n\nexport default interface Adapter {\n getRootQueryName(): string;\n getRootMutationName(): string;\n\n getNameForPersist(model: Model): string;\n getNameForPush(model: Model): string;\n getNameForDestroy(model: Model): string;\n getNameForFetch(model: Model, plural: boolean): string;\n\n getConnectionMode(): ConnectionMode;\n\n getArgumentMode(): ArgumentMode;\n\n getFilterTypeName(model: Model): string;\n getInputTypeName(model: Model, action?: string): string;\n\n prepareSchemaTypeName(name: string): string;\n}\n","import { Data, Field } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport Context from \"../common/context\";\nimport {\n clone,\n downcaseFirstLetter,\n isPlainObject,\n pluralize,\n singularize\n} from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\n\n/**\n * This class provides methods to transform incoming data from GraphQL in to a format Vuex-ORM understands and\n * vice versa.\n */\nexport default class Transformer {\n /**\n * Transforms outgoing data. Use for variables param.\n *\n * @param {Model} model Base model of the mutation/query\n * @param {Data} data Data to transform\n * @param {boolean} read Tells if this is a write or a read action. read is fetch, write is push and persist.\n * @param {Array} whitelist of fields\n * @param {Map>} outgoingRecords List of record IDs that are already added to the\n * outgoing data in order to detect recursion.\n * @param {boolean} recursiveCall Tells if it's a recursive call.\n * @returns {Data}\n */\n public static transformOutgoingData(\n model: Model,\n data: Data,\n read: boolean,\n whitelist?: Array,\n outgoingRecords?: Map>,\n recursiveCall?: boolean\n ): Data {\n const context = Context.getInstance();\n const relations: Map = model.getRelations();\n const returnValue: Data = {} as Data;\n if (outgoingRecords === undefined) outgoingRecords = new Map>();\n if (recursiveCall === undefined) recursiveCall = false;\n\n Object.keys(data).forEach(key => {\n const value = data[key];\n\n const isRelation = model.getRelations().has(key);\n let isRecursion = false;\n\n if (value instanceof Array) {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value[0]);\n } else {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value);\n }\n\n // shouldIncludeOutgoingField and the read param is tricky. In the initial call of this method\n // we want to include any relation, so we have to make sure it's false. In the recursive calls\n // it should be true when we transform the outgoing data for fetch (and false for the others)\n if (\n !isRecursion &&\n this.shouldIncludeOutgoingField(\n (recursiveCall as boolean) && read,\n key,\n value,\n model,\n whitelist\n )\n ) {\n let relatedModel = Model.getRelatedModel(relations.get(key)!);\n\n if (value instanceof Array) {\n // Either this is a hasMany field or a .attr() field which contains an array.\n const arrayModel = context.getModel(singularize(key), true);\n\n if (arrayModel) {\n this.addRecordForRecursionDetection(outgoingRecords!, value[0]);\n returnValue[key] = value.map(v => {\n return this.transformOutgoingData(\n arrayModel || model,\n v,\n read,\n undefined,\n outgoingRecords,\n true\n );\n });\n } else {\n // Simple field, not a relation\n returnValue[key] = value;\n }\n } else if (typeof value === \"object\" && value.$id !== undefined) {\n if (!relatedModel) {\n relatedModel = context.getModel((value as ORMModel).$self().entity);\n }\n\n this.addRecordForRecursionDetection(outgoingRecords!, value);\n\n // Value is a record, transform that too\n returnValue[key] = this.transformOutgoingData(\n relatedModel,\n value,\n read,\n undefined,\n outgoingRecords,\n true\n );\n } else {\n // In any other case just let the value be what ever it is\n returnValue[key] = value;\n }\n }\n });\n\n return returnValue;\n }\n\n /**\n * Transforms a set of incoming data to the format vuex-orm requires.\n *\n * @param {Data | Array} data\n * @param model\n * @param mutation required to transform something like `disableUserAddress` to the actual model name.\n * @param {boolean} recursiveCall\n * @returns {Data}\n */\n public static transformIncomingData(\n data: Data | Array,\n model: Model,\n mutation: boolean = false,\n recursiveCall: boolean = false\n ): Data {\n let result: Data | Array = {} as Data;\n const context = Context.getInstance();\n\n if (!recursiveCall) {\n context.logger.group(\"Transforming incoming data\");\n context.logger.log(\"Raw data:\", data);\n }\n\n if (Array.isArray(data)) {\n result = data.map((d: any) => this.transformIncomingData(d, model, mutation, true));\n } else {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined && data[key] !== null && key in data) {\n if (isPlainObject(data[key])) {\n const localModel: Model = context.getModel(key, true) || model;\n\n if (data[key].nodes && context.connectionMode === ConnectionMode.NODES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].nodes,\n localModel,\n mutation,\n true\n );\n } else if (data[key].edges && context.connectionMode === ConnectionMode.EDGES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].edges,\n localModel,\n mutation,\n true\n );\n } else if (data[\"node\"] && context.connectionMode === ConnectionMode.EDGES) {\n result = this.transformIncomingData(data[\"node\"], localModel, mutation, true);\n } else {\n let newKey = key;\n\n if (mutation && !recursiveCall) {\n newKey = data[key].nodes ? localModel.pluralName : localModel.singularName;\n newKey = downcaseFirstLetter(newKey);\n }\n\n result[newKey] = this.transformIncomingData(data[key], localModel, mutation, true);\n }\n } else if (Model.isFieldNumber(model.fields.get(key))) {\n result[key] = parseFloat(data[key]);\n } else if (key.endsWith(\"Type\") && model.isTypeFieldOfPolymorphicRelation(key)) {\n result[key] = pluralize(downcaseFirstLetter(data[key]));\n } else {\n result[key] = data[key];\n }\n }\n });\n }\n\n if (!recursiveCall) {\n context.logger.log(\"Transformed data:\", result);\n context.logger.groupEnd();\n } else {\n result[\"$isPersisted\"] = true;\n }\n\n // Make sure this is really a plain JS object. We had some issues in testing here.\n return clone(result);\n }\n\n /**\n * Tells if a field should be included in the outgoing data.\n * @param {boolean} forFilter Tells whether a filter is constructed or not.\n * @param {string} fieldName Name of the field to check.\n * @param {any} value Value of the field.\n * @param {Model} model Model class which contains the field.\n * @param {Array|undefined} whitelist Contains a list of fields which should always be included.\n * @returns {boolean}\n */\n public static shouldIncludeOutgoingField(\n forFilter: boolean,\n fieldName: string,\n value: any,\n model: Model,\n whitelist?: Array\n ): boolean {\n // Always add fields on the whitelist.\n if (whitelist && whitelist.includes(fieldName)) return true;\n\n // Ignore internal fields\n if (fieldName.startsWith(\"$\")) return false;\n\n // Ignore empty fields\n if (value === null || value === undefined) return false;\n\n // Include all eager save connections\n if (model.getRelations().has(fieldName)) {\n // We never add relations to filters.\n if (forFilter) return false;\n\n const relation: Relation = model.getRelations().get(fieldName)!;\n const related: Model | null = Model.getRelatedModel(relation);\n if (related && model.shouldEagerSaveRelation(fieldName, relation, related)) return true;\n\n // All other relations are skipped\n return false;\n }\n\n // Everything else is ok\n return true;\n }\n\n /**\n * Registers a record for recursion detection.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to register.\n */\n private static addRecordForRecursionDetection(\n records: Map>,\n record: ORMModel\n ): void {\n const context: Context = Context.getInstance();\n\n if (!record) {\n context.logger.warn(\"Trying to add invalid record\", record, \"to recursion detection\");\n return;\n }\n\n if (!record.$self) {\n context.logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return;\n }\n\n const model: Model = context.getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n ids.push(record.$id!);\n records.set(model.singularName, ids);\n }\n\n /**\n * Detects recursions.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to check.\n * @return {boolean} true when the record is already included in the records.\n */\n private static isRecursion(records: Map>, record: ORMModel): boolean {\n if (!record) return false;\n\n if (!record.$self) {\n Context.getInstance().logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return false;\n }\n\n const model: Model = Context.getInstance().getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n return ids.includes(record.$id!);\n }\n}\n","var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\n\nmodule.exports = gql;\n","import { ApolloClient, FetchPolicy } from \"apollo-client\";\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\nimport { HttpLink } from \"apollo-link-http\";\nimport { ApolloLink } from \"apollo-link\";\nimport Context from \"../common/context\";\nimport { Arguments, Data } from \"../support/interfaces\";\nimport Transformer from \"./transformer\";\nimport Model from \"../orm/model\";\nimport gql from \"graphql-tag\";\n\n/**\n * This class takes care of the communication with the graphql endpoint by leveraging the awesome apollo-client lib.\n */\nexport default class Apollo {\n /**\n * The http link instance to use.\n * @type {HttpLink}\n */\n private readonly httpLink: ApolloLink;\n\n /**\n * The ApolloClient instance\n * @type {ApolloClient}\n */\n private readonly apolloClient: ApolloClient;\n\n /**\n * @constructor\n */\n public constructor() {\n const context = Context.getInstance();\n\n // This allows the test suite to pass a custom link\n if (!context.options.apolloClient && context.options.link) {\n this.httpLink = context.options.link;\n } else {\n /* istanbul ignore next */\n this.httpLink = new HttpLink({\n uri: context.options.url ? context.options.url : \"/graphql\",\n credentials: context.options.credentials ? context.options.credentials : \"same-origin\",\n useGETForQueries: Boolean(context.options.useGETForQueries)\n });\n }\n\n if (context.options.apolloClient) {\n this.apolloClient = (context => {\n return context.options.apolloClient;\n })(context);\n } else {\n this.apolloClient = new ApolloClient({\n link: this.httpLink,\n cache: new InMemoryCache(),\n connectToDevTools: context.debugMode\n });\n }\n }\n\n /**\n * Sends a request to the GraphQL API via apollo\n * @param model\n * @param {any} query The query to send (result from gql())\n * @param {Arguments} variables Optional. The variables to send with the query\n * @param {boolean} mutation Optional. If this is a mutation (true) or a query (false, default)\n * @param {boolean} bypassCache If true the query will be send to the server without using the cache. For queries only\n * @returns {Promise} The new records\n */\n public async request(\n model: Model,\n query: any,\n variables?: Arguments,\n mutation: boolean = false,\n bypassCache: boolean = false\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n Context.getInstance().logger.logQuery(query, variables, fetchPolicy);\n\n const context = { headers: Apollo.getHeaders() };\n\n let response;\n if (mutation) {\n response = await this.apolloClient.mutate({ mutation: query, variables, context });\n } else {\n response = await this.apolloClient.query({ query, variables, fetchPolicy, context });\n }\n\n // Transform incoming data into something useful\n return Transformer.transformIncomingData(response.data as Data, model, mutation);\n }\n\n public async simpleQuery(\n query: string,\n variables: Arguments,\n bypassCache: boolean = false,\n context?: Data\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n return this.apolloClient.query({\n query: gql(query),\n variables,\n fetchPolicy,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n public async simpleMutation(query: string, variables: Arguments, context?: Data): Promise {\n return this.apolloClient.mutate({\n mutation: gql(query),\n variables,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n private static getHeaders() {\n const context = Context.getInstance();\n\n let headers: any = context.options.headers ? context.options.headers : {};\n\n if (typeof headers === \"function\") {\n headers = headers(context);\n }\n\n return headers;\n }\n}\n","import {\n GraphQLField,\n GraphQLSchema,\n GraphQLType,\n GraphQLTypeDefinition\n} from \"../support/interfaces\";\nimport { upcaseFirstLetter } from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\nimport Context from \"../common/context\";\n\nexport default class Schema {\n private schema: GraphQLSchema;\n private types: Map;\n private mutations: Map;\n private queries: Map;\n\n public constructor(schema: GraphQLSchema) {\n const context = Context.getInstance();\n\n this.schema = schema;\n this.types = new Map();\n this.mutations = new Map();\n this.queries = new Map();\n\n this.schema.types.forEach((t: GraphQLType) => this.types.set(t.name, t));\n\n this.getType(context.adapter.getRootQueryName())!.fields!.forEach(f =>\n this.queries.set(f.name, f)\n );\n this.getType(context.adapter.getRootMutationName())!.fields!.forEach(f =>\n this.mutations.set(f.name, f)\n );\n }\n\n public determineQueryMode(): ConnectionMode {\n let connection: GraphQLType | null = null;\n\n this.queries.forEach(query => {\n const typeName = Schema.getTypeNameOfField(query);\n if (typeName.endsWith(\"TypeConnection\")) {\n connection = this.getType(typeName);\n return false; // break\n }\n return true;\n });\n\n /* istanbul ignore next */\n if (!connection) {\n throw new Error(\n \"Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!\"\n );\n }\n\n if (connection!.fields!.find(f => f.name === \"nodes\")) {\n return ConnectionMode.NODES;\n } else if (connection!.fields!.find(f => f.name === \"edges\")) {\n return ConnectionMode.EDGES;\n } else {\n return ConnectionMode.PLAIN;\n }\n }\n\n public getType(name: string, allowNull: boolean = false): GraphQLType | null {\n name = Context.getInstance().adapter.prepareSchemaTypeName(name);\n const type = this.types.get(name);\n\n if (!allowNull && !type) {\n throw new Error(`Couldn't find Type of name ${name} in the GraphQL Schema.`);\n }\n\n return type || null;\n }\n\n public getMutation(name: string, allowNull: boolean = false): GraphQLField | null {\n const mutation = this.mutations.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !mutation) {\n throw new Error(`Couldn't find Mutation of name ${name} in the GraphQL Schema.`);\n }\n\n return mutation || null;\n }\n\n public getQuery(name: string, allowNull: boolean = false): GraphQLField | null {\n const query = this.queries.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !query) {\n throw new Error(`Couldn't find Query of name ${name} in the GraphQL Schema.`);\n }\n\n return query || null;\n }\n\n static returnsConnection(field: GraphQLField): boolean {\n return Schema.getTypeNameOfField(field).endsWith(\"TypeConnection\");\n }\n\n static getRealType(type: GraphQLTypeDefinition): GraphQLTypeDefinition {\n if (type.kind === \"NON_NULL\") {\n return this.getRealType(type.ofType);\n } else {\n return type;\n }\n }\n\n static getTypeNameOfField(field: GraphQLField): string {\n let type = this.getRealType(field.type);\n\n if (type.kind === \"LIST\") {\n while (!type.name) type = type.ofType;\n return `[${type.name}]`;\n } else {\n while (!type.name) type = type.ofType;\n\n /* istanbul ignore next */\n if (!type.name) throw new Error(`Can't find type name for field ${field.name}`);\n\n return type.name;\n }\n }\n}\n","import Adapter, { ConnectionMode, ArgumentMode } from \"../adapter\";\nimport Model from \"../../orm/model\";\nimport { upcaseFirstLetter } from \"../../support/utils\";\n\nexport default class DefaultAdapter implements Adapter {\n getRootMutationName(): string {\n return \"Mutation\";\n }\n\n getRootQueryName(): string {\n return \"Query\";\n }\n\n getConnectionMode(): ConnectionMode {\n return ConnectionMode.NODES;\n }\n\n getArgumentMode(): ArgumentMode {\n return ArgumentMode.TYPE;\n }\n\n getFilterTypeName(model: Model): string {\n return `${upcaseFirstLetter(model.singularName)}Filter`;\n }\n\n getInputTypeName(model: Model, action?: string): string {\n return `${upcaseFirstLetter(model.singularName)}Input`;\n }\n\n getNameForDestroy(model: Model): string {\n return `delete${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForFetch(model: Model, plural: boolean): string {\n return plural ? model.pluralName : model.singularName;\n }\n\n getNameForPersist(model: Model): string {\n return `create${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForPush(model: Model): string {\n return `update${upcaseFirstLetter(model.singularName)}`;\n }\n\n prepareSchemaTypeName(name: string): string {\n return upcaseFirstLetter(name);\n }\n}\n","export default `\nquery Introspection {\n __schema {\n types {\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n inputFields {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n`;\n","import Logger from \"./logger\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel } from \"@vuex-orm/core\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { downcaseFirstLetter, isEqual, pick, singularize } from \"../support/utils\";\nimport Apollo from \"../graphql/apollo\";\nimport Database from \"@vuex-orm/core/lib/database/Database\";\nimport { Data, Field, GraphQLType, Options } from \"../support/interfaces\";\nimport Schema from \"../graphql/schema\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport Adapter, { ConnectionMode } from \"../adapters/adapter\";\nimport DefaultAdapter from \"../adapters/builtin/default-adapter\";\nimport introspectionQuery from \"../graphql/introspection-query\";\n\n/**\n * Internal context of the plugin. This class contains all information, the models, database, logger and so on.\n *\n * It's a singleton class, so just call Context.getInstance() anywhere you need the context.\n */\nexport default class Context {\n /**\n * Contains the instance for the singleton pattern.\n * @type {Context}\n */\n public static instance: Context;\n\n /**\n * Components collection of Vuex-ORM\n * @type {Components}\n */\n public readonly components: Components;\n\n /**\n * The options which have been passed to VuexOrm.install\n * @type {Options}\n */\n public readonly options: Options;\n\n /**\n * GraphQL Adapter.\n * @type {Adapter}\n */\n public readonly adapter: Adapter;\n\n /**\n * The Vuex-ORM database\n * @type {Database}\n */\n public readonly database: Database;\n\n /**\n * Collection of all Vuex-ORM models wrapped in a Model instance.\n * @type {Map}\n */\n public readonly models: Map = new Map();\n\n /**\n * When true, the logging is enabled.\n * @type {boolean}\n */\n public readonly debugMode: boolean = false;\n\n /**\n * Our nice Vuex-ORM-GraphQL logger\n * @type {Logger}\n */\n public readonly logger: Logger;\n\n /**\n * Instance of Apollo which cares about the communication with the graphql endpoint.\n * @type {Apollo}\n */\n public apollo!: Apollo;\n\n /**\n * The graphql schema. Is null until the first request.\n * @type {Schema}\n */\n public schema: Schema | undefined;\n\n /**\n * Tells if the schema is already loaded or the loading is currently processed.\n * @type {boolean}\n */\n private schemaWillBeLoaded: Promise | undefined;\n\n /**\n * Defines how to query connections. 'auto' | 'nodes' | 'edges' | 'plain'\n */\n public connectionMode: ConnectionMode = ConnectionMode.AUTO;\n\n /**\n * Container for the global mocks.\n * @type {Object}\n */\n private globalMocks: { [key: string]: Array } = {};\n\n /**\n * Private constructor, called by the setup method\n *\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n private constructor(components: Components, options: Options) {\n this.components = components;\n this.options = options;\n\n this.database = options.database;\n this.debugMode = Boolean(options.debug);\n this.logger = new Logger(this.debugMode);\n this.adapter = options.adapter || new DefaultAdapter();\n\n /* istanbul ignore next */\n if (!options.database) {\n throw new Error(\"database param is required to initialize vuex-orm-graphql!\");\n }\n }\n\n /**\n * Get the singleton instance of the context.\n * @returns {Context}\n */\n public static getInstance(): Context {\n return this.instance;\n }\n\n /**\n * This is called only once and creates a new instance of the Context.\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {Context}\n */\n public static setup(components: Components, options: Options): Context {\n this.instance = new Context(components, options);\n\n this.instance.apollo = new Apollo();\n this.instance.collectModels();\n\n this.instance.logger.group(\"Context setup\");\n this.instance.logger.log(\"components\", this.instance.components);\n this.instance.logger.log(\"options\", this.instance.options);\n this.instance.logger.log(\"database\", this.instance.database);\n this.instance.logger.log(\"models\", this.instance.models);\n this.instance.logger.groupEnd();\n\n return this.instance;\n }\n\n public async loadSchema(): Promise {\n if (!this.schemaWillBeLoaded) {\n this.schemaWillBeLoaded = new Promise(async (resolve, reject) => {\n this.logger.log(\"Fetching GraphQL Schema initially ...\");\n\n this.connectionMode = this.adapter.getConnectionMode();\n\n // We send a custom header along with the request. This is required for our test suite to mock the schema request.\n const context = {\n headers: { \"X-GraphQL-Introspection-Query\": \"true\" }\n };\n\n const result = await this.apollo.simpleQuery(\n introspectionQuery,\n {},\n true,\n (context as unknown) as Data\n );\n\n this.schema = new Schema(result.data.__schema);\n\n this.logger.log(\"GraphQL Schema successful fetched\", result);\n\n this.logger.log(\"Starting to process the schema ...\");\n this.processSchema();\n this.logger.log(\"Schema procession done!\");\n\n resolve(this.schema);\n });\n }\n\n return this.schemaWillBeLoaded;\n }\n\n public processSchema() {\n this.models.forEach((model: Model) => {\n let type: GraphQLType;\n\n try {\n type = this.schema!.getType(model.singularName)!;\n } catch (error) {\n this.logger.warn(`Ignoring entity ${model.singularName} because it's not in the schema.`);\n return;\n }\n\n model.fields.forEach((field: Field, fieldName: string) => {\n if (!type.fields!.find(f => f.name === fieldName)) {\n this.logger.warn(\n `Ignoring field ${model.singularName}.${fieldName} because it's not in the schema.`\n );\n\n // TODO: Move skipFields to the model\n model.baseModel.skipFields = model.baseModel.skipFields ? model.baseModel.skipFields : [];\n if (!model.baseModel.skipFields.includes(fieldName)) {\n model.baseModel.skipFields.push(fieldName);\n }\n }\n });\n });\n\n if (this.connectionMode === ConnectionMode.AUTO) {\n this.connectionMode = this.schema!.determineQueryMode();\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by automatic detection`);\n } else {\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by config`);\n }\n }\n\n /**\n * Returns a model from the model collection by it's name\n *\n * @param {Model|string} model A Model instance, a singular or plural name of the model\n * @param {boolean} allowNull When true this method returns null instead of throwing an exception when no model was\n * found. Default is false\n * @returns {Model}\n */\n public getModel(model: Model | string, allowNull: boolean = false): Model {\n if (typeof model === \"string\") {\n const name: string = singularize(downcaseFirstLetter(model));\n model = this.models.get(name) as Model;\n if (!allowNull && !model) throw new Error(`No such model ${name}!`);\n }\n\n return model;\n }\n\n /**\n * Will add a mock for simple mutations or queries. These are model unrelated and have to be\n * handled globally.\n *\n * @param {Mock} mock - Mock config.\n */\n public addGlobalMock(mock: Mock): boolean {\n if (this.findGlobalMock(mock.action, mock.options)) return false;\n if (!this.globalMocks[mock.action]) this.globalMocks[mock.action] = [];\n\n this.globalMocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a global mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions like { name: 'example' }.\n * @returns {Mock | null} null when no mock was found.\n */\n public findGlobalMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.globalMocks[action]) {\n return (\n this.globalMocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by simpleMutation and simpleQuery actions in order to get the global mock\n * returnValue.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public globalMockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.findGlobalMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Wraps all Vuex-ORM entities in a Model object and saves them into this.models\n */\n private collectModels() {\n this.database.entities.forEach((entity: any) => {\n const model: Model = new Model(entity.model as typeof ORMModel);\n this.models.set(model.singularName, model);\n Model.augment(model);\n });\n }\n}\n","import { Relation } from \"@vuex-orm/core\";\nimport Model from \"../orm/model\";\nimport { Arguments, Field, GraphQLField, GraphQLType } from \"../support/interfaces\";\nimport { clone, isPlainObject, takeWhile, upcaseFirstLetter } from \"../support/utils\";\nimport gql from \"graphql-tag\";\nimport Context from \"../common/context\";\nimport Schema from \"./schema\";\nimport { ConnectionMode, ArgumentMode } from \"../adapters/adapter\";\n\n/**\n * Contains all logic to build GraphQL queries/mutations.\n */\nexport default class QueryBuilder {\n /**\n * Builds a field for the GraphQL query and a specific model\n *\n * @param {Model|string} model The model to use\n * @param {boolean} multiple Determines whether plural/nodes syntax or singular syntax is used.\n * @param {Arguments} args The args that will be passed to the query field ( user(role: $role) )\n * @param {Array} path The relations in this list are ignored (while traversing relations).\n * Mainly for recursion\n * @param {string} name Optional name of the field. If not provided, this will be the model name\n * @param filter\n * @param {boolean} allowIdFields Optional. Determines if id fields will be ignored for the argument generation.\n * See buildArguments\n * @returns {string}\n *\n * @todo Do we need the allowIdFields param?\n */\n public static buildField(\n model: Model | string,\n multiple: boolean = true,\n args?: Arguments,\n path: Array = [],\n name?: string,\n filter: boolean = false,\n allowIdFields: boolean = false\n ): string {\n const context = Context.getInstance();\n model = context.getModel(model);\n\n name = name ? name : model.pluralName;\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n let params: string = this.buildArguments(model, args, false, filter, allowIdFields, field);\n path = path.length === 0 ? [model.singularName] : path;\n\n const fields = `\n ${model.getQueryFields().join(\" \")}\n ${this.buildRelationsQuery(model, path)}\n `;\n\n if (multiple) {\n const header: string = `${name}${params}`;\n\n if (context.connectionMode === ConnectionMode.NODES) {\n return `\n ${header} {\n nodes {\n ${fields}\n }\n }\n `;\n } else if (context.connectionMode === ConnectionMode.EDGES) {\n return `\n ${header} {\n edges {\n node {\n ${fields}\n }\n }\n }\n `;\n } else {\n return `\n ${header} {\n ${fields}\n }\n `;\n }\n } else {\n return `\n ${name ? name : model.singularName}${params} {\n ${fields}\n }\n `;\n }\n }\n\n /**\n * Generates a query.\n * Currently only one root field for the query is possible.\n * @param {string} type 'mutation' or 'query'\n * @param {Model | string} model The model this query or mutation affects. This mainly determines the query fields.\n * @param {string} name Optional name of the query/mutation. Will overwrite the name from the model.\n * @param {Arguments} args Arguments for the query\n * @param {boolean} multiple Determines if the root query field is a connection or not (will be passed to buildField)\n * @param {boolean} filter When true the query arguments are passed via a filter object.\n * @returns {any} Whatever gql() returns\n */\n public static buildQuery(\n type: string,\n model: Model | string,\n name?: string,\n args?: Arguments,\n multiple?: boolean,\n filter?: boolean\n ) {\n const context = Context.getInstance();\n\n // model\n model = context.getModel(model);\n\n // arguments\n args = this.prepareArguments(args);\n\n // multiple\n multiple = multiple === undefined ? !args[\"id\"] : multiple;\n\n // name\n if (!name) name = multiple ? model.pluralName : model.singularName;\n\n // field\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n // build query\n const query: string =\n `${type} ${upcaseFirstLetter(name)}${this.buildArguments(\n model,\n args,\n true,\n filter,\n true,\n field\n )} {\\n` +\n ` ${this.buildField(model, multiple, args, [], name, filter, true)}\\n` +\n `}`;\n\n return gql(query);\n }\n\n /**\n * Generates the arguments string for a graphql query based on a given map.\n *\n * There are three types of arguments:\n *\n * 1) Signatures with primitive types (signature = true)\n * => 'mutation createUser($name: String!)'\n *\n * 2) Signatures with object types (signature = true, args = { user: { __type: 'User' }})\n * => 'mutation createUser($user: UserInput!)'\n *\n * 3) Fields with variables (signature = false)\n * => 'user(id: $id)'\n *\n * 4) Filter fields with variables (signature = false, filter = true)\n * => 'users(filter: { active: $active })'\n *\n * @param model\n * @param {Arguments | undefined} args\n * @param {boolean} signature When true, then this method generates a query signature instead of key/value pairs\n * @param filter\n * @param {boolean} allowIdFields If true, ID fields will be included in the arguments list\n * @param {GraphQLField} field Optional. The GraphQL mutation or query field\n * @returns {String}\n */\n public static buildArguments(\n model: Model,\n args?: Arguments,\n signature: boolean = false,\n filter: boolean = false,\n allowIdFields: boolean = true,\n field: GraphQLField | null = null\n ): string {\n const context = Context.getInstance();\n if (args === undefined) return \"\";\n\n let returnValue: string = \"\";\n let first: boolean = true;\n\n if (args) {\n Object.keys(args).forEach((key: string) => {\n let value: any = args[key];\n\n const isForeignKey = model.skipField(key);\n const skipFieldDueId = (key === \"id\" || isForeignKey) && !allowIdFields;\n\n let schemaField: GraphQLField | undefined = this.findSchemaFieldForArgument(\n key,\n field,\n model,\n filter\n );\n\n const isConnectionField =\n schemaField && Schema.getTypeNameOfField(schemaField).endsWith(\"TypeConnection\");\n\n // Ignore null fields, ids and connections\n if (value && !skipFieldDueId && !isConnectionField) {\n let typeOrValue: any = \"\";\n\n if (signature) {\n if (isPlainObject(value) && value.__type) {\n // Case 2 (User!)\n typeOrValue = context.adapter.getInputTypeName(context.getModel(value.__type)) + \"!\";\n } else if (value instanceof Array && field) {\n const arg = QueryBuilder.findSchemaFieldForArgument(key, field, model, filter);\n\n /* istanbul ignore next */\n if (!arg) {\n throw new Error(\n `The argument ${key} is of type array but it's not possible to determine the type, because it's not in the field ${\n field.name\n }`\n );\n }\n\n typeOrValue = Schema.getTypeNameOfField(arg) + \"!\";\n } else if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n // Case 1, 3 and 4\n typeOrValue = Schema.getTypeNameOfField(schemaField) + \"!\";\n } else if (key === \"id\" || isForeignKey) {\n // Case 1 (ID!)\n typeOrValue = \"ID!\";\n } else {\n // Case 1 (String!)\n typeOrValue = this.determineAttributeType(model, key, value, field || undefined);\n typeOrValue = typeOrValue + \"!\";\n }\n } else {\n // Case 3 or 4\n typeOrValue = `$${key}`;\n }\n\n returnValue = `${returnValue}${first ? \"\" : \", \"}${(signature ? \"$\" : \"\") +\n key}: ${typeOrValue}`;\n\n first = false;\n }\n });\n\n if (!first) {\n if (!signature && filter) returnValue = `filter: { ${returnValue} }`;\n returnValue = `(${returnValue})`;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Determines the GraphQL primitive type of a field in the variables hash by the field type or (when\n * the field type is generic attribute) by the variable type.\n * @param {Model} model\n * @param {string} key\n * @param {string} value\n * @param {GraphQLField} query Pass when we have to detect the type of an argument\n * @returns {string}\n */\n public static determineAttributeType(\n model: Model,\n key: string,\n value: any,\n query?: GraphQLField\n ): string {\n const context: Context = Context.getInstance();\n const field: undefined | Field = model.fields.get(key);\n let schemaField: undefined | GraphQLField;\n\n if (query) {\n schemaField = query.args.find(f => f.name === key);\n\n if (!schemaField) {\n const filterField = query.args.find(f => f.name === \"filter\");\n\n if (filterField) {\n schemaField = this.findSchemaFieldForArgument(key, null, model, true);\n }\n }\n } else {\n schemaField = context.schema!.getType(model.singularName)!.fields!.find(f => f.name === key);\n }\n\n if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n return Schema.getTypeNameOfField(schemaField);\n } else {\n if (field instanceof context.components.String) {\n return \"String\";\n } else if (field && field instanceof context.components.Number) {\n return \"Int\";\n } else if (field && field instanceof context.components.Boolean) {\n return \"Boolean\";\n } else {\n if (typeof value === \"number\") return \"Int\";\n if (typeof value === \"string\") return \"String\";\n if (typeof value === \"boolean\") return \"Boolean\";\n\n throw new Error(\n `Can't find suitable graphql type for field '${model.singularName}.${key}'.`\n );\n }\n }\n }\n\n private static findSchemaFieldForArgument(\n name: String,\n field: GraphQLField | null,\n model: Model,\n isFilter: boolean\n ): GraphQLField | undefined {\n const context = Context.getInstance();\n const schema = context.schema!;\n let schemaField: GraphQLField | undefined;\n\n if (field) {\n schemaField = field.args.find(f => f.name === name);\n if (schemaField) return schemaField;\n }\n\n // We try to find the FilterType or at least the Type this query belongs to.\n const type: GraphQLType | null = schema.getType(\n isFilter ? context.adapter.getFilterTypeName(model) : model.singularName,\n true\n );\n\n // Next we try to find the field from the type\n schemaField = type\n ? (isFilter ? type.inputFields! : type.fields!).find(f => f.name === name)\n : undefined;\n\n // Warn before we return null\n if (!schemaField) {\n Context.getInstance().logger.warn(\n `Couldn't find the argument with name ${name} for the mutation/query ${\n field ? field.name : \"(?)\"\n }`\n );\n }\n\n return schemaField;\n }\n\n /**\n * Generates the fields for all related models.\n *\n * @param {Model} model\n * @param {Array} path\n * @returns {string}\n */\n static buildRelationsQuery(model: null | Model, path: Array = []): string {\n if (model === null) return \"\";\n\n const context = Context.getInstance();\n const relationQueries: Array = [];\n\n model.getRelations().forEach((field: Relation, name: string) => {\n let relatedModel: Model = Model.getRelatedModel(field)!;\n\n // We will ignore the field, when it's already in the path. Means: When it's already queried. However there are\n // cases where the model will have a relationship to itself. For example a nested category strucure where the\n // category model has a parent: belongsTo(Category). So we also check if the model references itself. If this is\n // the case, we allow the nesting up to 5 times.\n const referencesItSelf = takeWhile(\n path.slice(0).reverse(),\n (p: string) => p === relatedModel.singularName\n ).length;\n const ignore = referencesItSelf\n ? referencesItSelf > 5\n : path.includes(relatedModel.singularName);\n\n // console.log(`-----> Will ${ignore ? '' : 'not'} ignore ${model.singularName}.${name}, path: ${path.join('.')}`);\n\n if (model.shouldEagerLoadRelation(name, field, relatedModel) && !ignore) {\n const newPath = path.slice(0);\n newPath.push(relatedModel.singularName);\n\n relationQueries.push(\n this.buildField(\n relatedModel,\n Model.isConnection(field as Field),\n undefined,\n newPath,\n name,\n false\n )\n );\n }\n });\n\n return relationQueries.join(\"\\n\");\n }\n\n private static prepareArguments(args?: Arguments): Arguments {\n args = (args ? clone(args) : {}) as Arguments;\n\n Object.keys(args).forEach((key: string) => {\n const value = args![key];\n\n if (value && isPlainObject(value)) {\n if (Context.getInstance().adapter.getArgumentMode() === ArgumentMode.LIST) {\n Object.keys(value).forEach((k: string) => {\n args![k] = value[k];\n });\n delete args![key];\n } else {\n args![key] = { __type: upcaseFirstLetter(key) };\n }\n }\n });\n\n return args;\n }\n}\n","import { Data, DispatchFunction } from \"../support/interfaces\";\nimport Context from \"../common/context\";\n\n/**\n * Provides some helper methods to interact with the Vuex-ORM store\n */\nexport class Store {\n /**\n * Inserts incoming data into the store. Existing data will be updated.\n *\n * @param {Data} data New data to insert/update\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @return {Promise} Inserted data as hash\n */\n public static async insertData(data: Data, dispatch: DispatchFunction): Promise {\n let insertedData: Data = {} as Data;\n\n await Promise.all(\n Object.keys(data).map(async key => {\n const value = data[key];\n Context.getInstance().logger.log(\"Inserting records\", value);\n const newData = await dispatch(\"insertOrUpdate\", ({ data: value } as unknown) as Data);\n\n Object.keys(newData).forEach(dataKey => {\n if (!insertedData[dataKey]) insertedData[dataKey] = [];\n insertedData[dataKey] = insertedData[dataKey].concat(newData[dataKey]);\n });\n })\n );\n\n return insertedData;\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport { Arguments, Data, DispatchFunction } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport RootState from \"@vuex-orm/core/lib/modules/contracts/RootState\";\nimport Transformer from \"../graphql/transformer\";\nimport Schema from \"../graphql/schema\";\nimport { singularize } from \"../support/utils\";\n\n/**\n * Base class for all Vuex actions. Contains some utility and convenience methods.\n */\nexport default class Action {\n /**\n * Sends a mutation.\n *\n * @param {string} name Name of the mutation like 'createUser'\n * @param {Data | undefined} variables Variables to send with the mutation\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @param {Model} model The model this mutation affects.\n * @param {boolean} multiple Tells if we're requesting a single record or multiple.\n * @returns {Promise}\n */\n protected static async mutation(\n name: string,\n variables: Data | undefined,\n dispatch: DispatchFunction,\n model: Model\n ): Promise {\n if (variables) {\n const context: Context = Context.getInstance();\n const schema: Schema = await context.loadSchema();\n\n const multiple: boolean = Schema.returnsConnection(schema.getMutation(name)!);\n const query = QueryBuilder.buildQuery(\"mutation\", model, name, variables, multiple);\n\n // Send GraphQL Mutation\n let newData = await context.apollo.request(model, query, variables, true);\n\n // When this was not a destroy action, we get new data, which we should insert in the store\n if (name !== context.adapter.getNameForDestroy(model)) {\n newData = newData[Object.keys(newData)[0]];\n\n // IDs as String cause terrible issues, so we convert them to integers.\n newData.id = parseInt(newData.id, 10);\n\n const insertedData: Data = await Store.insertData(\n { [model.pluralName]: newData } as Data,\n dispatch\n );\n\n // Try to find the record to return\n const records = insertedData[model.pluralName];\n const newRecord = records[records.length - 1];\n if (newRecord) {\n return newRecord;\n } else {\n Context.getInstance().logger.log(\n \"Couldn't find the record of type '\",\n model.pluralName,\n \"' within\",\n insertedData,\n \". Falling back to find()\"\n );\n return model.baseModel.query().last();\n }\n }\n\n return true;\n }\n }\n\n /**\n * Convenience method to get the model from the state.\n * @param {RootState} state Vuex state\n * @returns {Model}\n */\n static getModelFromState(state: RootState): Model {\n return Context.getInstance().getModel(state.$name);\n }\n\n /**\n * Makes sure args is a hash.\n *\n * @param {Arguments|undefined} args\n * @param {any} id When not undefined, it's added to the args\n * @returns {Arguments}\n */\n static prepareArgs(args?: Arguments, id?: any): Arguments {\n args = args || {};\n if (id) args[\"id\"] = id;\n\n return args;\n }\n\n /**\n * Adds the record itself to the args and sends it through transformOutgoingData. Key is named by the singular name\n * of the model.\n *\n * @param {Arguments} args\n * @param {Model} model\n * @param {Data} data\n * @returns {Arguments}\n */\n static addRecordToArgs(args: Arguments, model: Model, data: Data): Arguments {\n args[model.singularName] = Transformer.transformOutgoingData(model, data, false);\n return args;\n }\n\n /**\n * Transforms each field of the args which contains a model.\n * @param {Arguments} args\n * @returns {Arguments}\n */\n protected static transformArgs(args: Arguments): Arguments {\n const context = Context.getInstance();\n\n Object.keys(args).forEach((key: string) => {\n const value: Data = args[key];\n\n if (value instanceof context.components.Model) {\n const model = context.getModel(singularize(value.$self().entity));\n const transformedValue = Transformer.transformOutgoingData(model, value, false);\n context.logger.log(\n \"A\",\n key,\n \"model was found within the variables and will be transformed from\",\n value,\n \"to\",\n transformedValue\n );\n args[key] = transformedValue;\n }\n });\n\n return args;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Destroy action for sending a delete mutation. Will be used for record.$destroy().\n */\nexport default class Destroy extends Action {\n /**\n * @param {State} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to delete\n * @returns {Promise} true\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForDestroy(model);\n\n const mockReturnValue = model.$mockHook(\"destroy\", { id });\n\n if (mockReturnValue) {\n await Store.insertData(mockReturnValue, dispatch!);\n return true;\n }\n\n args = this.prepareArgs(args, id);\n\n await Action.mutation(mutationName, args as Data, dispatch!, model);\n return true;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The destroy action requires the 'id' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\n\n/**\n * Fetch action for sending a query. Will be used for Model.fetch().\n */\nexport default class Fetch extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {ActionParams} params Optional params to send with the query\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n params?: ActionParams\n ): Promise {\n const context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"fetch\", {\n filter: params ? params.filter || {} : {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n await context.loadSchema();\n\n // Filter\n let filter = {};\n\n if (params && params.filter) {\n filter = Transformer.transformOutgoingData(\n model,\n params.filter as Data,\n true,\n Object.keys(params.filter)\n );\n }\n\n const bypassCache = params && params.bypassCache;\n\n // When the filter contains an id, we query in singular mode\n const multiple: boolean = !filter[\"id\"];\n const name: string = context.adapter.getNameForFetch(model, multiple);\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, multiple);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(model, query, filter, false, bypassCache as boolean);\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n }\n}\n","import { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport Schema from \"../graphql/schema\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Mutate action for sending a custom mutation. Will be used for Model.mutate() and record.$mutate().\n */\nexport default class Mutate extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {Arguments} args Arguments for the mutation. Must contain a 'mutation' field.\n * @returns {Promise} The new record if any\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { args, name }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"mutate\", {\n name,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n args = this.prepareArgs(args);\n\n // There could be anything in the args, but we have to be sure that all records are gone through\n // transformOutgoingData()\n this.transformArgs(args);\n\n // Send the mutation\n return Action.mutation(name, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The mutate action requires the mutation name ('mutation') to be set\");\n }\n }\n}\n","import Context from \"../common/context\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Model from \"../orm/model\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Persist action for sending a create mutation. Will be used for record.$persist().\n */\nexport default class Persist extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to persist\n * @returns {Promise} The saved record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPersist(model);\n const oldRecord = model.getRecordWithId(id)!;\n\n const mockReturnValue = model.$mockHook(\"persist\", {\n id,\n args: args || {}\n });\n\n if (mockReturnValue) {\n const newRecord = await Store.insertData(mockReturnValue, dispatch!);\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n return newRecord;\n }\n\n // Arguments\n args = this.prepareArgs(args);\n this.addRecordToArgs(args, model, oldRecord);\n\n // Send mutation\n const newRecord = await Action.mutation(mutationName, args as Data, dispatch!, model);\n\n // Delete the old record if necessary\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n\n return newRecord;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'id' to be set\");\n }\n }\n\n /**\n * It's very likely that the server generated different ID for this record.\n * In this case Action.mutation has inserted a new record instead of updating the existing one.\n *\n * @param {Model} model\n * @param {Data} record\n * @returns {Promise}\n */\n private static async deleteObsoleteRecord(model: Model, newRecord: Data, oldRecord: Data) {\n if (newRecord && oldRecord && newRecord.id !== oldRecord.id) {\n Context.getInstance().logger.log(\"Dropping deprecated record\", oldRecord);\n return oldRecord.$delete();\n }\n\n return null;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Push action for sending a update mutation. Will be used for record.$push().\n */\nexport default class Push extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {Arguments} data New data to save\n * @param {Arguments} args Additional arguments\n * @returns {Promise} The updated record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { data, args }: ActionParams\n ): Promise {\n if (data) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPush(model);\n\n const mockReturnValue = model.$mockHook(\"push\", {\n data,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n // Arguments\n args = this.prepareArgs(args, data.id);\n this.addRecordToArgs(args, model, data);\n\n // Send the mutation\n return Action.mutation(mutationName, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'data' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Schema from \"../graphql/schema\";\n\n/**\n * Query action for sending a custom query. Will be used for Model.customQuery() and record.$customQuery.\n */\nexport default class Query extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {object} filter Filter object (arguments)\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { name, filter, bypassCache }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"query\", {\n name,\n filter: filter || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n\n // Filter\n filter = filter ? Transformer.transformOutgoingData(model, filter as Data, true) : {};\n\n // Multiple?\n const multiple: boolean = Schema.returnsConnection(schema.getQuery(name)!);\n\n // Build query\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, false);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(\n model,\n query,\n filter,\n false,\n bypassCache as boolean\n );\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The customQuery action requires the query name ('name') to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery, removeSymbols } from \"../support/utils\";\n\n/**\n * SimpleQuery action for sending a model unrelated simple query.\n */\nexport default class SimpleQuery extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, bypassCache, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleQuery\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n\n const result = await context.apollo.simpleQuery(\n graphQlDocumentToString(parsedQuery),\n variables,\n bypassCache\n );\n\n // remove the symbols\n return removeSymbols(clone(result.data));\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleQuery action requires the 'query' to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery } from \"../support/utils\";\n\n/**\n * SimpleMutation action for sending a model unrelated simple mutation.\n */\nexport default class SimpleMutation extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleMutation\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n const result = await context.apollo.simpleMutation(\n graphQlDocumentToString(parsedQuery),\n variables\n );\n\n // remove the symbols\n return clone(result.data);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleMutation action requires the 'query' to be set\");\n }\n }\n}\n","import { PatchedModel, Options, ActionParams } from \"./support/interfaces\";\nimport Context from \"./common/context\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { Destroy, Fetch, Mutate, Persist, Push } from \"./actions\";\nimport Query from \"./actions/query\";\nimport SimpleQuery from \"./actions/simple-query\";\nimport SimpleMutation from \"./actions/simple-mutation\";\nimport { isPlainObject } from \"./support/utils\";\n\n/**\n * Main class of the plugin. Setups the internal context, Vuex actions and model methods\n */\nexport default class VuexORMGraphQL {\n /**\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n public constructor(components: Components, options: Options) {\n Context.setup(components, options);\n VuexORMGraphQL.setupActions();\n VuexORMGraphQL.setupModelMethods();\n }\n\n /**\n * Allow everything to read the context.\n */\n public getContext(): Context {\n return Context.getInstance();\n }\n\n /**\n * This method will setup following Vuex actions: fetch, persist, push, destroy, mutate\n */\n private static setupActions() {\n const context = Context.getInstance();\n\n context.components.RootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);\n context.components.RootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);\n\n context.components.Actions.fetch = Fetch.call.bind(Fetch);\n context.components.Actions.persist = Persist.call.bind(Persist);\n context.components.Actions.push = Push.call.bind(Push);\n context.components.Actions.destroy = Destroy.call.bind(Destroy);\n context.components.Actions.mutate = Mutate.call.bind(Mutate);\n context.components.Actions.query = Query.call.bind(Query);\n }\n\n /**\n * This method will setup following model methods: Model.fetch, Model.mutate, Model.customQuery, record.$mutate,\n * record.$persist, record.$push, record.$destroy and record.$deleteAndDestroy, record.$customQuery\n */\n private static setupModelMethods() {\n const context = Context.getInstance();\n\n // Register static model convenience methods\n (context.components.Model as typeof PatchedModel).fetch = async function(\n filter: any,\n bypassCache = false\n ) {\n let filterObj = filter;\n if (!isPlainObject(filterObj)) {\n filterObj = { id: filter };\n }\n return this.dispatch(\"fetch\", { filter: filterObj, bypassCache });\n };\n\n (context.components.Model as typeof PatchedModel).mutate = async function(\n params: ActionParams\n ) {\n return this.dispatch(\"mutate\", params);\n };\n\n (context.components.Model as typeof PatchedModel).customQuery = async function({\n name,\n filter,\n multiple,\n bypassCache\n }: ActionParams) {\n return this.dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n // Register model convenience methods\n const model: PatchedModel = context.components.Model.prototype as PatchedModel;\n\n model.$mutate = async function({ name, args, multiple }: ActionParams) {\n args = args || {};\n if (!args[\"id\"]) args[\"id\"] = this.$id;\n return this.$dispatch(\"mutate\", { name, args, multiple });\n };\n\n model.$customQuery = async function({ name, filter, multiple, bypassCache }: ActionParams) {\n filter = filter || {};\n if (!filter[\"id\"]) filter[\"id\"] = this.$id;\n return this.$dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n model.$persist = async function(args: any) {\n return this.$dispatch(\"persist\", { id: this.$id, args });\n };\n\n model.$push = async function(args: any) {\n return this.$dispatch(\"push\", { data: this, args });\n };\n\n model.$destroy = async function() {\n return this.$dispatch(\"destroy\", { id: this.$id });\n };\n\n model.$deleteAndDestroy = async function() {\n await this.$delete();\n return this.$destroy();\n };\n }\n}\n","import VuexORMGraphQL from './vuex-orm-graphql';\nimport { Components, Plugin } from '@vuex-orm/core/lib/plugins/use';\nimport { Options } from './support/interfaces';\n\n/**\n * Plugin class. This just provides a static install method for Vuex-ORM and stores the instance of the model\n * within this.instance.\n */\nexport default class VuexORMGraphQLPlugin implements Plugin {\n /**\n * Contains the instance of VuexORMGraphQL\n */\n public static instance: VuexORMGraphQL;\n\n /**\n * This is called, when VuexORM.install(VuexOrmGraphQL, options) is called.\n *\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {VuexORMGraphQL}\n */\n public static install (components: Components, options: Options): VuexORMGraphQL {\n VuexORMGraphQLPlugin.instance = new VuexORMGraphQL(components, options);\n return VuexORMGraphQLPlugin.instance;\n }\n}\n","import { Model as ORMModel } from \"@vuex-orm/core\";\nimport Context from \"./common/context\";\nimport Model from \"./orm/model\";\nimport VuexORMGraphQLPlugin from \"./index\";\n\nlet context: Context | null = null;\n\nexport function setupTestUtils(plugin: typeof VuexORMGraphQLPlugin): void {\n /* istanbul ignore next */\n if (!plugin.instance) {\n throw new Error(\"Please call this function after setting up the store!\");\n }\n\n context = plugin.instance.getContext();\n}\n\nexport interface MockOptions {\n [key: string]: any;\n}\n\ntype ReturnObject = { [key: string]: any };\n\nexport type ReturnValue =\n | (() => ReturnObject | Array)\n | ReturnObject\n | Array;\n\nexport class Mock {\n public readonly action: string;\n public readonly options?: MockOptions;\n public modelClass?: typeof ORMModel;\n public returnValue?: ReturnValue;\n\n constructor(action: string, options?: MockOptions) {\n this.action = action;\n this.options = options;\n }\n\n public for(modelClass: typeof ORMModel): Mock {\n this.modelClass = modelClass;\n return this;\n }\n\n public andReturn(returnValue: ReturnValue): Mock {\n this.returnValue = returnValue;\n this.installMock();\n return this;\n }\n\n private installMock(): void {\n if (this.action === \"simpleQuery\" || this.action === \"simpleMutation\") {\n context!.addGlobalMock(this);\n } else {\n const model: Model = context!.getModel(this.modelClass!.entity);\n model.$addMock(this);\n }\n }\n}\n\nexport async function clearORMStore() {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n await context.database.store.dispatch(\"entities/deleteAll\");\n}\n\nexport function mock(action: string, options?: MockOptions): Mock {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n return new Mock(action, options);\n}\n"],"names":["Object","defineProperty","exports","value","condition","message","Error","undefined","obj","_invariant2","_invariant","__esModule","default","Source","body","name","locationOffset","instance","Constructor","TypeError","_classCallCheck","this","line","column","source","position","lineRegexp","match","exec","index","length","highlightSourceAtLocation","location","lineOffset","columnOffset","getColumnOffset","contextLine","contextColumn","prevLineNum","toString","lineNum","nextLineNum","padLen","lines","split","whitespace","lpad","filter","Boolean","join","len","Array","str","error","printedLocations","nodes","forEach","node","loc","push","_location","getLocation","start","locations","concat","GraphQLError","positions","path","originalError","extensions","_nodes","isArray","_source","_positions","reduce","list","_locations","providedSource","map","pos","defineProperties","enumerable","writable","stack","configurable","captureStackTrace","prototype","create","constructor","_printError","printError","description","_GraphQLError","_extends","assign","target","i","arguments","key","hasOwnProperty","call","get","_syntaxError","syntaxError","_locatedError","locatedError","_formatError","formatError","leadingWhitespace","isBlank","rawString","commonIndent","indent","_i","slice","shift","pop","options","startOfFileToken","Tok","SOF","lastToken","token","lineStart","advance","advanceLexer","lookahead","kind","_blockStringValue2","_blockStringValue","EOF","next","readToken","COMMENT","BANG","DOLLAR","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","NAME","INT","FLOAT","STRING","BLOCK_STRING","charCodeAt","String","end","prev","printCharCode","code","isNaN","JSON","stringify","fromCharCode","toUpperCase","lexer","bodyLength","startPosition","positionAfterWhitespace","col","_error","readComment","readName","firstCode","isFloat","readDigits","readNumber","chunkStart","rawValue","readBlockString","charCode","a","b","c","d","char2hex","readString","unexpectedCharacterMessage","toJSON","inspect","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","parseName","expect","_lexer","TokenKind","_kinds","parseDefinition","peek","parseExecutableDefinition","parseTypeSystemDefinition","peekDescription","unexpected","parseOperationDefinition","expectKeyword","experimentalFragmentVariables","parseFragmentName","variableDefinitions","parseVariableDefinitions","typeCondition","parseNamedType","directives","parseDirectives","selectionSet","parseSelectionSet","parseFragmentDefinition","OPERATION_DEFINITION","operation","parseOperationType","operationToken","many","parseVariableDefinition","VARIABLE_DEFINITION","variable","parseVariable","type","parseTypeReference","defaultValue","skip","parseValueLiteral","VARIABLE","SELECTION_SET","selections","parseSelection","parseFragment","nameOrAlias","alias","parseArguments","parseField","isConst","item","parseConstArgument","parseArgument","ARGUMENT","parseConstValue","parseValueValue","LIST","values","openKind","parseFn","closeKind","any","parseList","fields","parseObjectField","parseObject","parseStringLiteral","BOOLEAN","NULL","block","OBJECT_FIELD","parseDirective","DIRECTIVE","LIST_TYPE","NON_NULL_TYPE","NAMED_TYPE","keywordToken","operationTypes","parseOperationTypeDefinition","SCHEMA_DEFINITION","parseSchemaDefinition","parseDescription","SCALAR_TYPE_DEFINITION","parseScalarTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","OBJECT_TYPE_DEFINITION","parseObjectTypeDefinition","INTERFACE_TYPE_DEFINITION","parseInterfaceTypeDefinition","types","parseMemberTypesDefinition","UNION_TYPE_DEFINITION","parseUnionTypeDefinition","parseEnumValuesDefinition","ENUM_TYPE_DEFINITION","parseEnumTypeDefinition","parseInputFieldsDefinition","INPUT_OBJECT_TYPE_DEFINITION","parseInputObjectTypeDefinition","SCALAR_TYPE_EXTENSION","parseScalarTypeExtension","OBJECT_TYPE_EXTENSION","parseObjectTypeExtension","INTERFACE_TYPE_EXTENSION","parseInterfaceTypeExtension","UNION_TYPE_EXTENSION","parseUnionTypeExtension","ENUM_TYPE_EXTENSION","parseEnumTypeExtension","INPUT_OBJECT_TYPE_EXTENSION","parseInputObjectTypeExtension","parseTypeExtension","args","parseArgumentDefs","parseDirectiveLocation","parseDirectiveLocations","DIRECTIVE_DEFINITION","parseDirectiveDefinition","OPERATION_TYPE_DEFINITION","parseFieldDefinition","parseInputValueDef","INPUT_VALUE_DEFINITION","parseEnumValueDefinition","ENUM_VALUE_DEFINITION","_directiveLocation","DirectiveLocation","startToken","noLocation","Loc","endToken","getTokenDesc","atToken","sourceObj","definitions","DOCUMENT","parseDocument","createLexer","root","visitor","visitorKeys","QueryDocumentKeys","inArray","keys","edits","parent","ancestors","newRoot","isLeaving","isEdited","clone","k","editOffset","ii","editKey","editValue","splice","result","isNode","visitFn","getVisitFn","BREAK","visitors","skipping","enter","fn","apply","leave","typeInfo","Name","Document","OperationDefinition","VariableDefinition","Variable","SelectionSet","Field","Argument","FragmentSpread","InlineFragment","FragmentDefinition","IntValue","FloatValue","StringValue","BooleanValue","NullValue","EnumValue","ListValue","ObjectValue","ObjectField","Directive","NamedType","ListType","NonNullType","SchemaDefinition","OperationTypeDefinition","ScalarTypeDefinition","ObjectTypeDefinition","FieldDefinition","InputValueDefinition","InterfaceTypeDefinition","UnionTypeDefinition","EnumTypeDefinition","EnumValueDefinition","InputObjectTypeDefinition","ScalarTypeExtension","ObjectTypeExtension","InterfaceTypeExtension","UnionTypeExtension","EnumTypeExtension","InputObjectTypeExtension","DirectiveDefinition","maybeNode","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","ast","_visitor","visit","printDocASTReducer","op","varDefs","wrap","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","isDescription","indexOf","replace","printBlockString","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","maybeArray","separator","x","array","maybeString","LARGE_ARRAY_SIZE","HASH_UNDEFINED","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","MAX_SAFE_INTEGER","argsTag","arrayTag","asyncTag","boolTag","dateTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","arrayBufferTag","dataViewTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","freeSelf","self","Function","freeExports","nodeType","freeModule","module","moduleExports","freeProcess","process","nodeUtil","binding","e","nodeIsTypedArray","isTypedArray","arraySome","predicate","mapToArray","size","setToArray","set","uid","func","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","IE_PROTO","nativeObjectToString","reIsNative","RegExp","Buffer","Symbol","Uint8Array","propertyIsEnumerable","symToStringTag","toStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","arg","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","SetCache","__data__","add","Stack","data","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","n","iteratee","baseTimes","isIndex","assocIndexOf","eq","baseGetTag","isOwn","tag","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","object","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","byteLength","byteOffset","buffer","convert","isPartial","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isObject","isFunction","test","baseKeys","Ctor","proto","arrLength","seen","arrValue","othIndex","has","keysFunc","symbolsFunc","offset","arrayPush","baseGetAllKeys","getSymbols","getMapData","getValue","hash","string","pairs","resIndex","arrayFilter","symbol","ArrayBuffer","resolve","ctorString","isLength","baseUnary","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","cloneableTags","addMapEntry","pair","addSetEntry","arrayReduce","accumulator","initAccum","isHostObject","overArg","getPrototype","getPrototypeOf","objectCreate","isArrayLike","isArrayLikeObject","assignValue","baseClone","isDeep","isFull","input","initCloneArray","copyArray","isFunc","copy","cloneBuffer","isPrototype","initCloneObject","copyObject","copySymbols","baseAssign","cloneFunc","cloneArrayBuffer","dataView","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneSet","initCloneByTag","props","arrayEach","subValue","arrayBuffer","newValue","cache","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","charAt","substr","toLowerCase","sanitizeWord","rules","replaceWord","replaceMap","keepMap","checkWord","bool","count","inclusive","pluralized","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","require","pluralizeLib","singularize","upcaseFirstLetter","downcaseFirstLetter","prettify","query","print","parseQuery","parse","graphQlDocumentToString","isPlainObject","pick","prop","isEqual","lodashIsEqual","lodashClone","takeWhile","removeSymbols","enabled","log","console","groupCollapsed","PREFIX","messages","groupEnd","warn","variables","fetchPolicy","prettified","group","trim","baseModel","singularName","entity","pluralName","field","context","Context","getInstance","components","Number","Increment","Attr","BelongsTo","HasOne","MorphTo","MorphOne","model","originalFieldGenerator","bind","originalFields","boolean","relation","BelongsToMany","HasMany","HasManyThrough","MorphedByMany","MorphMany","MorphToMany","getModel","related","HasManyBy","Model","isFieldAttribute","_this","skipField","startsWith","skipFields","shouldSkipField","getRelations","foreignKey","relations","found","models","id","withAllRecursive","where","first","fieldName","relatedModel","eagerLoadList","eagerLoad","eagerSync","find","eagerSaveList","eagerSave","mock","$findMock","action","mocks","m","returnValue","r","$isPersisted","opts","cmp","f","cycles","aobj","bobj","isFinite","out","seenIndex","sort","isStringValue","isBooleanValue","isIntValue","isFloatValue","isVariable","isObjectValue","isListValue","isEnumValue","isNullValue","valueToObjectRepresentation","argObj","nestedArgObj_1","variableValue","listValue","nestedArgArrayObj","flattenSelections","selection","selectionNode","selected","getDirectiveNames","doc","definition","directive","hasDirectives","names","some","sources","getMutationDefinition","checkDocument","mutationDef","operations","getOperationDefinition","getOperationDefinitionOrDie","document","def","getOperationName","getFragmentDefinitions","getQueryDefinition","queryDef","createFragmentMap","fragments","symTable","fragment","getDefaultValues","defaultValues","_a","defaultValueObj","cloneDeep","cloneDeepHelper","val","copy_1","child","copy_2","isNotEmpty","getDirectiveMatcher","dir","removeDirectivesFromSelectionSet","agressiveRemove","remove","directiveMatcher","shouldKeep","removeDirectivesFromDocument","docClone","NetworkStatus","connectionRemoveConfig","willRemove","removeConnectionDirectiveFromDocument","getEnv","env","NODE_ENV","isEnv","isProduction","tryFunctionOrLogError","graphQLResultHasError","errors","Date","getTime","isNetworkRequestInFlight","networkStatus","_createClass","descriptor","protoProps","staticProps","hasSymbols","hasSymbol","getSymbol","observable","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","Observable","isObservable","hostReportError","setTimeout","enqueue","then","cleanupSubscription","subscription","cleanup","_cleanup","unsubscribe","closeSubscription","_observer","_queue","_state","notifySubscription","observer","onNotify","queue","flushSubscription","Subscription","subscriber","subscriptionObserver","SubscriptionObserver","_subscription","_subscriber","complete","reject","subscribe","done","_this2","_this3","_this4","C","hasSeed","hasValue","acc","_this5","_len","_key","startNext","v","from","_this6","subscriptions","outer","inner","completeIfDone","closed","s","method","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","err","return","_len2","items","_key2","require$$0","zenObservable","validateOperation","OPERATION_FIELDS","link","_super","__extends","isTerminating","request","fromError","errorValue","transformOperation","transformedOperation","operationName","createOperation","starting","getKey","passthrough","forward","of","toLink","handler","ApolloLink","empty","links","y","left","right","leftLink","rightLink","second","firstLink","LinkError","nextLink","execute","symbolObservablePonyfill","ponyfill","window","$$observable","LinkObservable","isApolloError","FetchType","generateErrorMessage","graphQLErrors","graphQLError","errorMessage","networkError","extraInfo","__proto__","ApolloError","hasError","storeValue","policy","scheduler","_b","shouldSubscribe","onSubscribe","isCurrentlyPolling","isTornDown","queryId","queryManager","generateQueryId","observers","subscriptionHandles","ObservableQuery","that","obs","removeQuery","lastError","lastResult","loading","queryStoreValue","queryStore","errorPolicy","partial","queryLoading","ready","stale","lastResultSnapshot","__assign","newResult","snapshot","isNetworkFetchPolicy","combinedOptions","fetchQuery","refetch","fetchMoreOptions","updateQuery","qid","normal","fetchMoreResult","previousResult","startGraphQLSubscription","subscriptionData","previous","onError","oldOptions","pollInterval","startPolling","stopPolling","tryFetch","setVariables","fetchResults","newVariables","mapFn","dataStore","markUpdateQueryResult","broadcastQueries","stopPollingQuery","startPollingQuery","setUpQuery","tearDownQuery","addObservableQuery","startQuery","queryListenerForObserver","sub","removeObservableQuery","stopQuery","DedupLink","getContext","forceFetch","toKey","operationKey","inFlightRequestObservables","delete","subscribers","subscription_1","singleObserver_1","sharedObserver","ssrMode","QueryScheduler","fetchType","catch","listener","registeredQueries","addQueryListener","addQueryOnInterval","interval","intervalQueries","checkInFlight","queryOptions","pollingOptions","poll","clearInterval","pollingTimers","setInterval","fetchQueriesOnInterval","MutationStore","store","mutationId","mutationString","mutation","QueryStore","previousQuery","isSetVariables","previousVariables","storePreviousVariables","isPoll","isRefetch","metadata","fetchMoreForQueryId","fetchMore","markQueryResultClient","observableQueryIds","res","queryDeduplication","_c","onBroadcast","_d","deduplicator","Deduplicator","QueryManager","optimisticResponse","updateQueriesByName","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","getCache","transformDocument","setQuery","generateUpdateQueriesInfo","ret","queryName","queryIdsByName","updater","mutationStore","initMutation","markMutationInit","updateQueries","update","storeResult","buildOperationForLink","markMutationResult","markMutationError","markMutationComplete","refetchQueryPromises","refetchQueries_1","refetchQuery","promise","refetchQueryByName","all","needToFetch","shouldFetch","requestId","generateRequestId","cancel","updateQueryWatch","lastRequestId","invalidated","invalidate","initQuery","networkResult","fetchRequest","markQueryError","removeFetchQueryPromise","previouslyHadError","newData","observableQuery","getLastResult","getLastError","shouldNotifyIfLoading","networkStatusChanged","errorStatusChanged","notifyOnNetworkStatusChange","apolloError_1","info","isMissing","document_1","readResult","diff","optimistic","resultFromStore","isDifferentFromLastResult","queryDefinition","transformedOptions","returnPartialData","idCounter","addFetchQueryPromise","watchQuery","listeners","watch","callback","fetchQueryPromises","resetIds","queries","reset","clearStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getObservableQueryPromises","isCacheEnabled","transformedDoc","markSubscriptionResult","stopQueryInStore","read","queryIdOrObservable","foundObserveableQuery","resetLastResults","errorsFromStore","markQueryResult","refetchedQueries","getQuery","newInfo","extraContext","transformForLink","getCacheKey","config","dataIdFromObject","initialCache","DataStore","ignoreErrors","writeWithErrors","write","dataId","optimistic_1","recordOptimisticTransaction","orig","cacheWrites_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","performTransaction","update_1","removeOptimistic","hasSuggestedDevtools","ssrForceFetchDelay","connectToDevTools","defaultOptions","supportedCache","supportedDirectives","disableNetworkFetches","mutate","resetStore","defaultConnectToDevTools","__APOLLO_CLIENT__","top","__APOLLO_DEVTOOLS_GLOBAL_HOOK__","navigator","userAgent","debug","version","ApolloClient","initQueryManager","initProxy","readQuery","readFragment","writeQuery","writeFragment","writeData","cb","devToolsHookCb","payload","state","getStore","mutations","dataWithOptimisticResults","extract","resetStoreCallbacks","serializedState","restore","proxy","genericMessage","setPrototypeOf","InvariantError","framesToPop","invariant","storeKeyNameFromField","directivesObj","getStoreKeyName","KNOWN_DIRECTIVES","filterKeys","queryArgs_1","filteredArgs_1","completeFieldName","stringifiedArgs","argumentsObjectFromField","argObj_1","resultKeyNameFromField","isField","isInlineFragment","isIdValue","idObject","generated","toIdValue","idConfig","typename","isJsonValue","jsonObject","getDirectiveInfoFromField","directiveObj_1","shouldInclude","directiveArguments","directiveName","ifArgument","ifValue","evaledValue","getFragmentQueryDocument","fragmentName","actualFragmentName","getMainDefinition","queryDoc","fragmentDefinition","TYPENAME_FIELD","addTypenameToDocument","lastIndexOf","isTest","mergeDeepArray","pastCopies","shallowCopyForMerge","mergeHelper","isExtensible","sourceKey","sourceValue","targetValue","queryFromPojo","selectionSetFromObj","fragmentFromPojo","justTypenameQuery","ApolloCache","rootId","typenameResult","__typename","dataToWrite","Cache","newest","oldest","max","dispose","Cp","getEntry","older","newer","clean","useSymbol","for","brand","globalKey","freeze","isObjRef","UniversalWeakMap","_weakMap","_strongMap","_getMap","canCreate","lookup","lookupArray","tuple","arguments$1","t","argc","isTuple","toArray","mustConvertThisToArray","desc","getOwnPropertyDescriptor","forEachArrayMethod","fakeNullFiber","getCurrentFiber","Fiber","reverse","current","fiber","getLocal","UNKNOWN_VALUE","emptySetPool","entryPool","assert","optionalMessage","Entry","parents","childValues","dirtyChildren","dirty","recomputing","reportOrphan","acquire","Ep","maybeReportOrphan","report","reportDirty","reportDirtyChild","reportClean","reportCleanChild","mightBeDirty","cv","childValue","setDirty","removeDirtyChild","dc","POOL_TARGET_SIZE","reallyRecompute","originalChildren","forgetChildren","local","currentParentEntry","threw","setClean","recompute","rememberParent","recomputeIfDirty","forgetChild","release","reusableEmptyArray","children","unsub","require$$1","require$$2","require$$3","normalizeOptions","makeCacheKey","Math","pow","disposable","testMap","set_1","testSet","add_1","frozen","seal","preventExtensions","haveWarned","shouldWarn","answer","HeuristicFragmentMatcher","idValue","CacheKeyNode","getOrCreate","hasOwn","depend","DepTrackingCache","defaultNormalizedCacheFactory","seed","cacheKeyRoot","reader","executeStoreQuery","executeSelectionSet","rootValue","contextValue","variableValues","fragmentMatcher","execContext","StoreReader","diffQueryAgainstStore","fragmentMatcherFunction","cacheRedirects","execResult","hasMissingFields","missing","tolerable","mainDefinition","fragmentMap","finalResult","objectsToMerge","handleMissing","fieldResult","executeField","fragmentExecResult","readStoreResult","readStoreResolver","resultKey","combineExecResults","executeSubSelectedArray","assertSelectionSetForIdValue","execResults","childResult","defaultFragmentMatcher","storeKeyName","fieldValue","resolver","storeObj","json","ObjectCache","tslib_1.__extends","enhanceErrorWithDocument","enhancedError","WriteError","StoreWriter","writeResultToStore","operationDefinition","writeSelectionSetToStore","processedData","resultFieldKey","writeFieldToStore","isDefered","isClient","matches","fakeContext","storeObject","storeFieldName","generatedId","processArrayValue","valueDataId","isGeneratedId","semanticId","isDataProcessed","escapedId","hadTypename","hasTypename","typenameChanged","mergeWithGenerated","itemDataId","generatedKey","realKey","real","madeChanges","realValue","newRealValue","defaultConfig","defaultDataIdFromObject","addTypename","resultCaching","_id","optimisticId","transaction","OptimisticCacheLayer","toObject","customResolvers","cacheResolvers","optimisticData","storeReader","storeWriter","maybeBroadcastWatch","InMemoryCache","readQueryFromStore","broadcastWatches","watches","idToRemove","toReapply","removedCount","layer","layer_1","silenceBroadcast","typenameDocumentCache","defaultHttpOptions","includeQuery","includeExtensions","defaultHeaders","accept","content-type","fallbackHttpConfig","http","headers","throwServerError","response","statusCode","status","parseAndCheckHttpResponse","text","bodyText","parseError","checkFetcher","fetcher","fetch","library","createSignalIfSupported","AbortController","controller","signal","selectHttpOptionsAndBody","fallbackConfig","configs","credentials","serializeFetchParameter","p","label","serialized","selectURI","fallbackURI","contextURI","uri","createHttpLink","linkOptions","useGETForQueries","requestOptions","linkConfig","fetchOptions","chosenURI","contextConfig","_controller","newURI","setContext","abort","rewriteURIForGET","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","ConnectionMode","ArgumentMode","whitelist","outgoingRecords","recursiveCall","isRelation","isRecursion","shouldIncludeOutgoingField","getRelatedModel","arrayModel_1","addRecordForRecursionDetection","transformOutgoingData","$id","$self","logger","transformIncomingData","localModel","connectionMode","NODES","edges","EDGES","newKey","isFieldNumber","parseFloat","endsWith","isTypeFieldOfPolymorphicRelation","forFilter","includes","shouldEagerSaveRelation","records","record","ids","parser","normalize","docCache","fragmentSourceMap","cacheKeyFromLoc","substring","resetCaches","printFragmentWarnings","processFragments","astFragmentMap","disableFragmentWarnings","stripLoc","removeLocAtThisLevel","docType","valueType","cacheKey","parsed","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","gql","literals","apolloClient","httpLink","HttpLink","url","debugMode","bypassCache","logQuery","Apollo","getHeaders","Transformer","schema","getType","adapter","getRootQueryName","getRootMutationName","connection","typeName","Schema","getTypeNameOfField","PLAIN","allowNull","prepareSchemaTypeName","getRealType","ofType","TYPE","AUTO","database","Logger","DefaultAdapter","apollo","collectModels","schemaWillBeLoaded","getConnectionMode","X-GraphQL-Introspection-Query","simpleQuery","introspectionQuery","__schema","processSchema","determineQueryMode","name_1","findGlobalMock","globalMocks","entities","augment","multiple","allowIdFields","getMutation","params","buildArguments","getQueryFields","buildRelationsQuery","header","prepareArguments","buildField","signature","isForeignKey","skipFieldDueId","schemaField","findSchemaFieldForArgument","isConnectionField","typeOrValue","__type","getInputTypeName","QueryBuilder","determineAttributeType","isFilter","getFilterTypeName","inputFields","relationQueries","referencesItSelf","ignore","shouldEagerLoadRelation","newPath","isConnection","getArgumentMode","dispatch","dataKey","insertedData","loadSchema","returnsConnection","buildQuery","getNameForDestroy","parseInt","Store","insertData","newRecord","last","$name","transformedValue","getModelFromState","$mockHook","mockReturnValue","prepareArgs","Action","mutationName","getNameForFetch","transformArgs","getNameForPersist","getRecordWithId","deleteObsoleteRecord","newRecord_1","oldRecord","addRecordToArgs","$delete","getNameForPush","globalMockHook","parsedQuery","simpleMutation","setup","setupActions","setupModelMethods","RootActions","SimpleQuery","SimpleMutation","Actions","Fetch","persist","Persist","Push","destroy","Destroy","Mutate","Query","filterObj","customQuery","$mutate","$dispatch","$customQuery","$persist","$push","$destroy","$deleteAndDestroy","VuexORMGraphQL","VuexORMGraphQLPlugin","setupTestUtils","plugin","modelClass","installMock","addGlobalMock","$addMock","clearORMStore","Mock"],"mappings":"w4EAEAA,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,UAUA,SAAmBE,EAAWC,GAE5B,IAAKD,EACH,MAAM,IAAIE,MAAMD,+EChBpBL,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,cAAiBK,EAIjB,IAEgCC,EAF5BC,GAE4BD,EAFSE,cAEYF,EAAIG,WAAaH,GAAQI,QAASJ,GAmB1EN,SAAiB,SAASW,EAAOC,EAAMC,EAAMC,IAjB1D,SAAyBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qC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,MACR,qBAAsB,OACtB,kBAAmB,OACnB,gBAAiB,SACjB,kCAAmC,SACnC,eAAgB,QAChB,0CAA2C,OAC3C,kGAAmG,QACnG,gCAAiC,SACjC,2BAA4B,SAC5B,iBAAkB,UAClB,wHAAyH,QACzH,qGAAsG,QACtG,QAAS,QACT,2CAA4C,YAC5C,oBAAqB,UACrB,uBAAwB,UACxB,oBAAqB,SACrB,gDAAiD,WACjD,sBAAuB,UACvB,sBAAuB,WACvB,oBAAqB,UACrB,SAAU,OACV,WAAY,QACZ,OAAQ,QACTlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU2B,cAAcpB,EAAK,GAAIA,EAAK,QAO5C,MAAO,KACP,SAAU,OACV,gEAAiE,SACjE,kCAAmC,QACnC,QAAS,MACT,uFAAwF,SACxF,oBAAqB,SACrB,aAAc,WACd,sBAAuB,OACvB,iFAAkF,OAClF,qEAAsE,UACtE,iCAAkC,OAClC,oBAAqB,SACrB,kGAAmG,SACnG,yGAA0G,SAC1G,8FAA+F,SAC/F,0BAA2B,QAC3B,+BAAgC,SAChC,sBAAuB,SACvB,oBAAqB,WACrB,eAAgB,OAChB,YAAa,OACb,QAAS,QACVlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU6B,gBAAgBtB,EAAK,GAAIA,EAAK,OAQ/C,YACA,SACA,SACA,MACA,UACA,OACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,MACA,UACA,UACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,QACA,OACA,OACA,WACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,QACA,SACA,UACA,gBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MAEA,gBACA,S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GAAI1yB,KAAK4nD,IAAKn1C,iBAG7C6/C,MAAQ,SAAe7/C,+FACpBzS,KAAKmyD,UAAU,QAAUxvC,KAAM3iB,KAAMyS,iBAGxC8/C,SAAW,uGACRvyD,KAAKmyD,UAAU,WAAaz/B,GAAI1yB,KAAK4nD,cAGxC4K,kBAAoB,8HAClBxyD,KAAK4wD,qCACJ5wD,KAAKuyD,uFC1FhB,SAAuBhiC,EAAwBvqB,YACxBpG,SAAW,IAAI6yD,eAAeliC,EAAYvqB,GACxD0sD,EAAqB9yD,eClB5BwwB,QAA0B,cAEduiC,eAAeC,OAExBA,EAAOhzD,eACJ,IAAIX,MAAM,iEAGR2zD,EAAOhzD,SAAS8lC,aAc5B,+BAMclS,EAAgBxtB,QACrBwtB,OAASA,OACTxtB,QAAUA,yBAGjB,SAAW6sD,eACJA,WAAaA,EACX7yD,4BAGT,SAAiB2zB,eACVA,YAAcA,OACdm/B,cACE9yD,8BAGT,WACsB,gBAAhBA,KAAKwzB,QAA4C,mBAAhBxzB,KAAKwzB,eAC/Bu/B,cAAc/yD,MAEFowB,QAASuB,SAAS3xB,KAAK6yD,WAAY5iC,QAClD+iC,SAAShzD,qBAKCizD,8HAEf7iC,cACG,IAAInxB,MAAM,iDAGZmxB,QAAQ27B,SAASxkB,MAAMynB,SAAS,gEAGxB17B,KAAKE,EAAgBxtB,OAE9BoqB,cACG,IAAInxB,MAAM,+CAGX,IAAIi0D,KAAK1/B,EAAQxtB"} \ No newline at end of file +{"version":3,"file":"vuex-orm-graphql.es5.js","sources":["../node_modules/graphql/jsutils/invariant.js","../node_modules/graphql/language/source.js","../node_modules/graphql/language/location.js","../node_modules/graphql/error/printError.js","../node_modules/graphql/error/GraphQLError.js","../node_modules/graphql/error/syntaxError.js","../node_modules/graphql/error/locatedError.js","../node_modules/graphql/error/formatError.js","../node_modules/graphql/error/index.js","../node_modules/graphql/language/blockStringValue.js","../node_modules/graphql/language/lexer.js","../node_modules/graphql/language/kinds.js","../node_modules/graphql/language/directiveLocation.js","../node_modules/graphql/language/parser.js","../node_modules/graphql/language/visitor.js","../node_modules/graphql/language/printer.js","../node_modules/lodash.isequal/index.js","../node_modules/lodash.clone/index.js","../node_modules/pluralize/pluralize.js","../src/support/utils.ts","../src/common/logger.ts","../src/orm/model.ts","../node_modules/fast-json-stable-stringify/index.js","../node_modules/apollo-client/node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/cloneDeep.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/transform.ts","../node_modules/src/core/networkStatus.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/errorHandling.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/zen-observable/lib/Observable.js","../node_modules/zen-observable/index.js","../node_modules/zen-observable-ts/src/zenObservable.ts","../node_modules/apollo-link/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-link/src/linkUtils.ts","../node_modules/apollo-link/src/link.ts","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/src/util/Observable.ts","../node_modules/src/errors/ApolloError.ts","../node_modules/src/core/types.ts","../node_modules/src/core/ObservableQuery.ts","../node_modules/apollo-link-dedup/src/dedupLink.ts","../node_modules/src/scheduler/scheduler.ts","../node_modules/src/data/mutations.ts","../node_modules/src/data/queries.ts","../node_modules/src/core/QueryManager.ts","../node_modules/src/data/store.ts","../node_modules/apollo-client/version.js","../node_modules/src/ApolloClient.ts","../node_modules/ts-invariant/lib/invariant.esm.js","../node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-utilities/src/fragments.ts","../node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-utilities/src/transform.ts","../node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/apollo-utilities/src/util/mergeDeep.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/utils.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/cache.ts","../node_modules/optimism/lib/cache.js","../node_modules/immutable-tuple/dist/tuple.js","../node_modules/optimism/lib/local.js","../node_modules/optimism/lib/entry.js","../node_modules/optimism/lib/index.js","../node_modules/apollo-cache-inmemory/src/fixPolyfills.ts","../node_modules/apollo-cache-inmemory/src/fragmentMatcher.ts","../node_modules/apollo-cache-inmemory/src/cacheKeys.ts","../node_modules/apollo-cache-inmemory/src/depTrackingCache.ts","../node_modules/apollo-cache-inmemory/src/readFromStore.ts","../node_modules/apollo-cache-inmemory/src/objectCache.ts","../node_modules/apollo-cache-inmemory/src/writeToStore.ts","../node_modules/apollo-cache-inmemory/src/inMemoryCache.ts","../node_modules/apollo-link-http-common/src/index.ts","../node_modules/apollo-link-http/src/httpLink.ts","../src/adapters/adapter.ts","../src/graphql/transformer.ts","../node_modules/graphql-tag/src/index.js","../src/graphql/apollo.ts","../src/graphql/schema.ts","../src/adapters/builtin/default-adapter.ts","../src/graphql/introspection-query.ts","../src/common/context.ts","../src/graphql/query-builder.ts","../src/orm/store.ts","../src/actions/action.ts","../src/actions/destroy.ts","../src/actions/fetch.ts","../src/actions/mutate.ts","../src/actions/persist.ts","../src/actions/push.ts","../src/actions/query.ts","../src/actions/simple-query.ts","../src/actions/simple-mutation.ts","../src/vuex-orm-graphql.ts","../src/plugin.ts","../src/test-utils.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = invariant;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Source = undefined;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * A representation of source input to GraphQL.\n * `name` and `locationOffset` are optional. They are useful for clients who\n * store GraphQL documents in source files; for example, if the GraphQL input\n * starts at line 40 in a file named Foo.graphql, it might be useful for name to\n * be \"Foo.graphql\" and location to be `{ line: 40, column: 0 }`.\n * line and column in locationOffset are 1-indexed\n */\nvar Source = exports.Source = function Source(body, name, locationOffset) {\n _classCallCheck(this, Source);\n\n this.body = body;\n this.name = name || 'GraphQL request';\n this.locationOffset = locationOffset || { line: 1, column: 1 };\n !(this.locationOffset.line > 0) ? (0, _invariant2.default)(0, 'line in locationOffset is 1-indexed and must be positive') : void 0;\n !(this.locationOffset.column > 0) ? (0, _invariant2.default)(0, 'column in locationOffset is 1-indexed and must be positive') : void 0;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLocation = getLocation;\n\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}\n\n/**\n * Represents a location in a Source.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.printError = printError;\n\nvar _location = require('../language/location');\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nfunction printError(error) {\n var printedLocations = [];\n if (error.nodes) {\n error.nodes.forEach(function (node) {\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, (0, _location.getLocation)(node.loc.source, node.loc.start)));\n }\n });\n } else if (error.source && error.locations) {\n var source = error.source;\n error.locations.forEach(function (location) {\n printedLocations.push(highlightSourceAtLocation(source, location));\n });\n }\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction highlightSourceAtLocation(source, location) {\n var line = location.line;\n var lineOffset = source.locationOffset.line - 1;\n var columnOffset = getColumnOffset(source, location);\n var contextLine = line + lineOffset;\n var contextColumn = location.column + columnOffset;\n var prevLineNum = (contextLine - 1).toString();\n var lineNum = contextLine.toString();\n var nextLineNum = (contextLine + 1).toString();\n var padLen = nextLineNum.length;\n var lines = source.body.split(/\\r\\n|[\\n\\r]/g);\n lines[0] = whitespace(source.locationOffset.column - 1) + lines[0];\n var outputLines = [source.name + ' (' + contextLine + ':' + contextColumn + ')', line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];\n return outputLines.filter(Boolean).join('\\n');\n}\n\nfunction getColumnOffset(source, location) {\n return location.line === 1 ? source.locationOffset.column - 1 : 0;\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GraphQLError = GraphQLError;\n\nvar _printError = require('./printError');\n\nvar _location = require('../language/location');\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined;\n\n // Compute locations in the source for the given nodes/positions.\n var _source = source;\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n return list;\n }, []);\n }\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations = void 0;\n if (positions && source) {\n var providedSource = source;\n _locations = positions.map(function (pos) {\n return (0, _location.getLocation)(providedSource, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push((0, _location.getLocation)(node.loc.source, node.loc.start));\n }\n return list;\n }, []);\n }\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n value: extensions || originalError && originalError.extensions\n }\n });\n\n // Include (non-enumerable) stack trace.\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\n\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: { value: GraphQLError },\n name: { value: 'GraphQLError' },\n toString: {\n value: function toString() {\n return (0, _printError.printError)(this);\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syntaxError = syntaxError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction syntaxError(source, position, description) {\n return new _GraphQLError.GraphQLError('Syntax Error: ' + description, undefined, source, [position]);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.locatedError = locatedError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Given an arbitrary Error, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\nfunction locatedError(originalError, nodes, path) {\n // Note: this uses a brand-check to support GraphQL errors originating from\n // other contexts.\n if (originalError && Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError);\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nexports.formatError = formatError;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nfunction formatError(error) {\n !error ? (0, _invariant2.default)(0, 'Received null or undefined error.') : void 0;\n return _extends({}, error.extensions, {\n message: error.message || 'An unknown error occurred.',\n locations: error.locations,\n path: error.path\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _GraphQLError = require('./GraphQLError');\n\nObject.defineProperty(exports, 'GraphQLError', {\n enumerable: true,\n get: function get() {\n return _GraphQLError.GraphQLError;\n }\n});\n\nvar _syntaxError = require('./syntaxError');\n\nObject.defineProperty(exports, 'syntaxError', {\n enumerable: true,\n get: function get() {\n return _syntaxError.syntaxError;\n }\n});\n\nvar _locatedError = require('./locatedError');\n\nObject.defineProperty(exports, 'locatedError', {\n enumerable: true,\n get: function get() {\n return _locatedError.locatedError;\n }\n});\n\nvar _printError = require('./printError');\n\nObject.defineProperty(exports, 'printError', {\n enumerable: true,\n get: function get() {\n return _printError.printError;\n }\n});\n\nvar _formatError = require('./formatError');\n\nObject.defineProperty(exports, 'formatError', {\n enumerable: true,\n get: function get() {\n return _formatError.formatError;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = blockStringValue;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n */\nfunction blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g);\n\n // Remove common indentation from all lines but first.\n var commonIndent = null;\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n var indent = leadingWhitespace(line);\n if (indent < line.length && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n if (commonIndent === 0) {\n break;\n }\n }\n }\n\n if (commonIndent) {\n for (var _i = 1; _i < lines.length; _i++) {\n lines[_i] = lines[_i].slice(commonIndent);\n }\n }\n\n // Remove leading and trailing blank lines.\n while (lines.length > 0 && isBlank(lines[0])) {\n lines.shift();\n }\n while (lines.length > 0 && isBlank(lines[lines.length - 1])) {\n lines.pop();\n }\n\n // Return a string of the lines joined with U+000A.\n return lines.join('\\n');\n}\n\nfunction leadingWhitespace(str) {\n var i = 0;\n while (i < str.length && (str[i] === ' ' || str[i] === '\\t')) {\n i++;\n }\n return i;\n}\n\nfunction isBlank(str) {\n return leadingWhitespace(str) === str.length;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TokenKind = undefined;\nexports.createLexer = createLexer;\nexports.getTokenDesc = getTokenDesc;\n\nvar _error = require('../error');\n\nvar _blockStringValue = require('./blockStringValue');\n\nvar _blockStringValue2 = _interopRequireDefault(_blockStringValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a Source object, this returns a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}\n\nfunction advanceLexer() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n}\n\nfunction lookahead() {\n var token = this.token;\n if (token.kind !== EOF) {\n do {\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = token.next || (token.next = readToken(this, token));\n } while (token.kind === COMMENT);\n }\n return token;\n}\n\n/**\n * The return type of createLexer.\n */\n\n\n// Each kind of token.\nvar SOF = '';\nvar EOF = '';\nvar BANG = '!';\nvar DOLLAR = '$';\nvar PAREN_L = '(';\nvar PAREN_R = ')';\nvar SPREAD = '...';\nvar COLON = ':';\nvar EQUALS = '=';\nvar AT = '@';\nvar BRACKET_L = '[';\nvar BRACKET_R = ']';\nvar BRACE_L = '{';\nvar PIPE = '|';\nvar BRACE_R = '}';\nvar NAME = 'Name';\nvar INT = 'Int';\nvar FLOAT = 'Float';\nvar STRING = 'String';\nvar BLOCK_STRING = 'BlockString';\nvar COMMENT = 'Comment';\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind = exports.TokenKind = {\n SOF: SOF,\n EOF: EOF,\n BANG: BANG,\n DOLLAR: DOLLAR,\n PAREN_L: PAREN_L,\n PAREN_R: PAREN_R,\n SPREAD: SPREAD,\n COLON: COLON,\n EQUALS: EQUALS,\n AT: AT,\n BRACKET_L: BRACKET_L,\n BRACKET_R: BRACKET_R,\n BRACE_L: BRACE_L,\n PIPE: PIPE,\n BRACE_R: BRACE_R,\n NAME: NAME,\n INT: INT,\n FLOAT: FLOAT,\n STRING: STRING,\n BLOCK_STRING: BLOCK_STRING,\n COMMENT: COMMENT\n};\n\n/**\n * A helper function to describe a token as a string for debugging\n */\nfunction getTokenDesc(token) {\n var value = token.value;\n return value ? token.kind + ' \"' + value + '\"' : token.kind;\n}\n\nvar charCodeAt = String.prototype.charCodeAt;\nvar slice = String.prototype.slice;\n\n/**\n * Helper function for constructing the Token object.\n */\nfunction Tok(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nTok.prototype.toJSON = Tok.prototype.inspect = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n};\n\nfunction printCharCode(code) {\n return (\n // NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n '\"\\\\u' + ('00' + code.toString(16).toUpperCase()).slice(-4) + '\"'\n );\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace and comments until it finds the next lexable\n * token, then lexes punctuators immediately or calls the appropriate helper\n * function for more complicated tokens.\n */\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var position = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + position - lexer.lineStart;\n\n if (position >= bodyLength) {\n return new Tok(EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, position);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(BANG, position, position + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, position, line, col, prev);\n // $\n case 36:\n return new Tok(DOLLAR, position, position + 1, line, col, prev);\n // (\n case 40:\n return new Tok(PAREN_L, position, position + 1, line, col, prev);\n // )\n case 41:\n return new Tok(PAREN_R, position, position + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, position + 1) === 46 && charCodeAt.call(body, position + 2) === 46) {\n return new Tok(SPREAD, position, position + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(COLON, position, position + 1, line, col, prev);\n // =\n case 61:\n return new Tok(EQUALS, position, position + 1, line, col, prev);\n // @\n case 64:\n return new Tok(AT, position, position + 1, line, col, prev);\n // [\n case 91:\n return new Tok(BRACKET_L, position, position + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(BRACKET_R, position, position + 1, line, col, prev);\n // {\n case 123:\n return new Tok(BRACE_L, position, position + 1, line, col, prev);\n // |\n case 124:\n return new Tok(PIPE, position, position + 1, line, col, prev);\n // }\n case 125:\n return new Tok(BRACE_R, position, position + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, position, line, col, prev);\n // - 0-9\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 return readNumber(source, position, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n return readBlockString(source, position, line, col, prev);\n }\n return readString(source, position, line, col, prev);\n }\n\n throw (0, _error.syntaxError)(source, position, unexpectedCharacterMessage(code));\n}\n\n/**\n * Report a message that an unexpected character was encountered.\n */\nfunction unexpectedCharacterMessage(code) {\n if (code === 39) {\n // '\n return \"Unexpected single quote character ('), did you mean to use \" + 'a double quote (\")?';\n }\n\n return 'Cannot parse the unexpected character ' + printCharCode(code) + '.';\n}\n\n/**\n * Reads from body starting at startPosition until it finds a non-whitespace\n * or commented character, then returns the position of that character for\n * lexing.\n */\nfunction positionAfterWhitespace(body, startPosition, lexer) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // tab | space | comma | BOM\n if (code === 9 || code === 32 || code === 44 || code === 0xfeff) {\n ++position;\n } else if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (charCodeAt.call(body, position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n } else {\n break;\n }\n }\n return position;\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code = void 0;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && (\n // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n}\n\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = charCodeAt.call(body, ++position);\n }\n\n if (code === 48) {\n // 0\n code = charCodeAt.call(body, ++position);\n if (code >= 48 && code <= 57) {\n throw (0, _error.syntaxError)(source, position, 'Invalid number, unexpected digit after 0: ' + printCharCode(code) + '.');\n }\n } else {\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n if (code === 43 || code === 45) {\n // + -\n code = charCodeAt.call(body, ++position);\n }\n position = readDigits(source, position, code);\n }\n\n return new Tok(isFloat ? FLOAT : INT, start, position, line, col, prev, slice.call(body, start, position));\n}\n\n/**\n * Returns the new position in the source after reading digits.\n */\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = charCodeAt.call(body, ++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n return position;\n }\n throw (0, _error.syntaxError)(source, position, 'Invalid number, expected digit but got: ' + printCharCode(code) + '.');\n}\n\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null &&\n // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += slice.call(body, chunkStart, position);\n return new Tok(STRING, start, position + 1, line, col, prev, value);\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n ++position;\n if (code === 92) {\n // \\\n value += slice.call(body, chunkStart, position - 1);\n code = charCodeAt.call(body, position);\n switch (code) {\n case 34:\n value += '\"';\n break;\n case 47:\n value += '/';\n break;\n case 92:\n value += '\\\\';\n break;\n case 98:\n value += '\\b';\n break;\n case 102:\n value += '\\f';\n break;\n case 110:\n value += '\\n';\n break;\n case 114:\n value += '\\r';\n break;\n case 116:\n value += '\\t';\n break;\n case 117:\n // u\n var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));\n if (charCode < 0) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: ' + ('\\\\u' + body.slice(position + 1, position + 5) + '.'));\n }\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n default:\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: \\\\' + String.fromCharCode(code) + '.');\n }\n ++position;\n chunkStart = position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\nfunction readBlockString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n rawValue += slice.call(body, chunkStart, position);\n return new Tok(BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockStringValue2.default)(rawValue));\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n // Escape Triple-Quote (\\\"\"\")\n if (code === 92 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34 && charCodeAt.call(body, position + 3) === 34) {\n rawValue += slice.call(body, chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Converts four hexidecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\nfunction readName(source, position, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var end = position + 1;\n var code = 0;\n while (end !== bodyLength && (code = charCodeAt.call(body, end)) !== null && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++end;\n }\n return new Tok(NAME, position, end, line, col, prev, slice.call(body, position, end));\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n// Name\n\nvar NAME = exports.NAME = 'Name';\n\n// Document\n\nvar DOCUMENT = exports.DOCUMENT = 'Document';\nvar OPERATION_DEFINITION = exports.OPERATION_DEFINITION = 'OperationDefinition';\nvar VARIABLE_DEFINITION = exports.VARIABLE_DEFINITION = 'VariableDefinition';\nvar VARIABLE = exports.VARIABLE = 'Variable';\nvar SELECTION_SET = exports.SELECTION_SET = 'SelectionSet';\nvar FIELD = exports.FIELD = 'Field';\nvar ARGUMENT = exports.ARGUMENT = 'Argument';\n\n// Fragments\n\nvar FRAGMENT_SPREAD = exports.FRAGMENT_SPREAD = 'FragmentSpread';\nvar INLINE_FRAGMENT = exports.INLINE_FRAGMENT = 'InlineFragment';\nvar FRAGMENT_DEFINITION = exports.FRAGMENT_DEFINITION = 'FragmentDefinition';\n\n// Values\n\nvar INT = exports.INT = 'IntValue';\nvar FLOAT = exports.FLOAT = 'FloatValue';\nvar STRING = exports.STRING = 'StringValue';\nvar BOOLEAN = exports.BOOLEAN = 'BooleanValue';\nvar NULL = exports.NULL = 'NullValue';\nvar ENUM = exports.ENUM = 'EnumValue';\nvar LIST = exports.LIST = 'ListValue';\nvar OBJECT = exports.OBJECT = 'ObjectValue';\nvar OBJECT_FIELD = exports.OBJECT_FIELD = 'ObjectField';\n\n// Directives\n\nvar DIRECTIVE = exports.DIRECTIVE = 'Directive';\n\n// Types\n\nvar NAMED_TYPE = exports.NAMED_TYPE = 'NamedType';\nvar LIST_TYPE = exports.LIST_TYPE = 'ListType';\nvar NON_NULL_TYPE = exports.NON_NULL_TYPE = 'NonNullType';\n\n// Type System Definitions\n\nvar SCHEMA_DEFINITION = exports.SCHEMA_DEFINITION = 'SchemaDefinition';\nvar OPERATION_TYPE_DEFINITION = exports.OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n\n// Type Definitions\n\nvar SCALAR_TYPE_DEFINITION = exports.SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\nvar OBJECT_TYPE_DEFINITION = exports.OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\nvar FIELD_DEFINITION = exports.FIELD_DEFINITION = 'FieldDefinition';\nvar INPUT_VALUE_DEFINITION = exports.INPUT_VALUE_DEFINITION = 'InputValueDefinition';\nvar INTERFACE_TYPE_DEFINITION = exports.INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\nvar UNION_TYPE_DEFINITION = exports.UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\nvar ENUM_TYPE_DEFINITION = exports.ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\nvar ENUM_VALUE_DEFINITION = exports.ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\nvar INPUT_OBJECT_TYPE_DEFINITION = exports.INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n\n// Type Extensions\n\nvar SCALAR_TYPE_EXTENSION = exports.SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\nvar OBJECT_TYPE_EXTENSION = exports.OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\nvar INTERFACE_TYPE_EXTENSION = exports.INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\nvar UNION_TYPE_EXTENSION = exports.UNION_TYPE_EXTENSION = 'UnionTypeExtension';\nvar ENUM_TYPE_EXTENSION = exports.ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\nvar INPUT_OBJECT_TYPE_EXTENSION = exports.INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n\n// Directive Definitions\n\nvar DIRECTIVE_DEFINITION = exports.DIRECTIVE_DEFINITION = 'DirectiveDefinition';","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation = exports.DirectiveLocation = {\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n};\n\n/**\n * The enum type representing the directive location values.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parse = parse;\nexports.parseValue = parseValue;\nexports.parseType = parseType;\nexports.parseConstValue = parseConstValue;\nexports.parseTypeReference = parseTypeReference;\nexports.parseNamedType = parseNamedType;\n\nvar _source = require('./source');\n\nvar _error = require('../error');\n\nvar _lexer = require('./lexer');\n\nvar _kinds = require('./kinds');\n\nvar _directiveLocation = require('./directiveLocation');\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\n\n\n/**\n * Configuration options to control parser behavior\n */\nfunction parse(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n if (!(sourceObj instanceof _source.Source)) {\n throw new TypeError('Must provide Source. Received: ' + String(sourceObj));\n }\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n return parseDocument(lexer);\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction parseValue(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var value = parseValueLiteral(lexer, false);\n expect(lexer, _lexer.TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\nfunction parseType(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.EOF);\n return type;\n}\n\n/**\n * Converts a name lex token into a name parse node.\n */\nfunction parseName(lexer) {\n var token = expect(lexer, _lexer.TokenKind.NAME);\n return {\n kind: _kinds.NAME,\n value: token.value,\n loc: loc(lexer, token)\n };\n}\n\n// Implements the parsing rules in the Document section.\n\n/**\n * Document : Definition+\n */\nfunction parseDocument(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SOF);\n var definitions = [];\n do {\n definitions.push(parseDefinition(lexer));\n } while (!skip(lexer, _lexer.TokenKind.EOF));\n\n return {\n kind: _kinds.DOCUMENT,\n definitions: definitions,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n */\nfunction parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n/**\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\nfunction parseExecutableDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseOperationDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n// Implements the parsing rules in the Operations section.\n\n/**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\nfunction parseOperationDefinition(lexer) {\n var start = lexer.token;\n if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n var operation = parseOperationType(lexer);\n var name = void 0;\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n name = parseName(lexer);\n }\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: parseVariableDefinitions(lexer),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationType : one of query mutation subscription\n */\nfunction parseOperationType(lexer) {\n var operationToken = expect(lexer, _lexer.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return 'query';\n case 'mutation':\n return 'mutation';\n case 'subscription':\n return 'subscription';\n }\n\n throw unexpected(lexer, operationToken);\n}\n\n/**\n * VariableDefinitions : ( VariableDefinition+ )\n */\nfunction parseVariableDefinitions(lexer) {\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, parseVariableDefinition, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * VariableDefinition : Variable : Type DefaultValue?\n */\nfunction parseVariableDefinition(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, _lexer.TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, _lexer.TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Variable : $ Name\n */\nfunction parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * SelectionSet : { Selection+ }\n */\nfunction parseSelectionSet(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.SELECTION_SET,\n selections: many(lexer, _lexer.TokenKind.BRACE_L, parseSelection, _lexer.TokenKind.BRACE_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\nfunction parseSelection(lexer) {\n return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}\n\n/**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\nfunction parseField(lexer) {\n var start = lexer.token;\n\n var nameOrAlias = parseName(lexer);\n var alias = void 0;\n var name = void 0;\n if (skip(lexer, _lexer.TokenKind.COLON)) {\n alias = nameOrAlias;\n name = parseName(lexer);\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: _kinds.FIELD,\n alias: alias,\n name: name,\n arguments: parseArguments(lexer, false),\n directives: parseDirectives(lexer, false),\n selectionSet: peek(lexer, _lexer.TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\nfunction parseArguments(lexer, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, item, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * Argument[Const] : Name : Value[?Const]\n */\nfunction parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}\n\nfunction parseConstArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseConstValue(lexer)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Fragments section.\n\n/**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\nfunction parseFragment(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SPREAD);\n if (peek(lexer, _lexer.TokenKind.NAME) && lexer.token.value !== 'on') {\n return {\n kind: _kinds.FRAGMENT_SPREAD,\n name: parseFragmentName(lexer),\n directives: parseDirectives(lexer, false),\n loc: loc(lexer, start)\n };\n }\n var typeCondition = void 0;\n if (lexer.token.value === 'on') {\n lexer.advance();\n typeCondition = parseNamedType(lexer);\n }\n return {\n kind: _kinds.INLINE_FRAGMENT,\n typeCondition: typeCondition,\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\nfunction parseFragmentDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'fragment');\n // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n if (lexer.options.experimentalFragmentVariables) {\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n variableDefinitions: parseVariableDefinitions(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentName : Name but not `on`\n */\nfunction parseFragmentName(lexer) {\n if (lexer.token.value === 'on') {\n throw unexpected(lexer);\n }\n return parseName(lexer);\n}\n\n// Implements the parsing rules in the Values section.\n\n/**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\nfunction parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}\n\nfunction parseStringLiteral(lexer) {\n var token = lexer.token;\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n block: token.kind === _lexer.TokenKind.BLOCK_STRING,\n loc: loc(lexer, token)\n };\n}\n\nfunction parseConstValue(lexer) {\n return parseValueLiteral(lexer, true);\n}\n\nfunction parseValueValue(lexer) {\n return parseValueLiteral(lexer, false);\n}\n\n/**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\nfunction parseList(lexer, isConst) {\n var start = lexer.token;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: _kinds.LIST,\n values: any(lexer, _lexer.TokenKind.BRACKET_L, item, _lexer.TokenKind.BRACKET_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\nfunction parseObject(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.BRACE_L);\n var fields = [];\n while (!skip(lexer, _lexer.TokenKind.BRACE_R)) {\n fields.push(parseObjectField(lexer, isConst));\n }\n return {\n kind: _kinds.OBJECT,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectField[Const] : Name : Value[?Const]\n */\nfunction parseObjectField(lexer, isConst) {\n var start = lexer.token;\n return {\n kind: _kinds.OBJECT_FIELD,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, isConst)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Directives section.\n\n/**\n * Directives[Const] : Directive[?Const]+\n */\nfunction parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}\n\n/**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\nfunction parseDirective(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.AT);\n return {\n kind: _kinds.DIRECTIVE,\n name: parseName(lexer),\n arguments: parseArguments(lexer, isConst),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Types section.\n\n/**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\nfunction parseTypeReference(lexer) {\n var start = lexer.token;\n var type = void 0;\n if (skip(lexer, _lexer.TokenKind.BRACKET_L)) {\n type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.BRACKET_R);\n type = {\n kind: _kinds.LIST_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n } else {\n type = parseNamedType(lexer);\n }\n if (skip(lexer, _lexer.TokenKind.BANG)) {\n return {\n kind: _kinds.NON_NULL_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n }\n return type;\n}\n\n/**\n * NamedType : Name\n */\nfunction parseNamedType(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.NAMED_TYPE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Type Definition section.\n\n/**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - TypeExtension\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\nfunction parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeDefinition(lexer);\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n case 'union':\n return parseUnionTypeDefinition(lexer);\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n case 'extend':\n return parseTypeExtension(lexer);\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\nfunction peekDescription(lexer) {\n return peek(lexer, _lexer.TokenKind.STRING) || peek(lexer, _lexer.TokenKind.BLOCK_STRING);\n}\n\n/**\n * Description : StringValue\n */\nfunction parseDescription(lexer) {\n if (peekDescription(lexer)) {\n return parseStringLiteral(lexer);\n }\n}\n\n/**\n * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ }\n */\nfunction parseSchemaDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = many(lexer, _lexer.TokenKind.BRACE_L, parseOperationTypeDefinition, _lexer.TokenKind.BRACE_R);\n return {\n kind: _kinds.SCHEMA_DEFINITION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationTypeDefinition : OperationType : NamedType\n */\nfunction parseOperationTypeDefinition(lexer) {\n var start = lexer.token;\n var operation = parseOperationType(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseNamedType(lexer);\n return {\n kind: _kinds.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\nfunction parseScalarTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\nfunction parseObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ImplementsInterfaces : implements NamedType+\n */\nfunction parseImplementsInterfaces(lexer) {\n var types = [];\n if (lexer.token.value === 'implements') {\n lexer.advance();\n do {\n types.push(parseNamedType(lexer));\n } while (peek(lexer, _lexer.TokenKind.NAME));\n }\n return types;\n}\n\n/**\n * FieldsDefinition : { FieldDefinition+ }\n */\nfunction parseFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseFieldDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\nfunction parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\nfunction parseArgumentDefs(lexer) {\n if (!peek(lexer, _lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer, _lexer.TokenKind.PAREN_L, parseInputValueDef, _lexer.TokenKind.PAREN_R);\n}\n\n/**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\nfunction parseInputValueDef(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var defaultValue = void 0;\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n defaultValue = parseConstValue(lexer);\n }\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\nfunction parseInterfaceTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? MemberTypesDefinition?\n */\nfunction parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * MemberTypesDefinition : = MemberTypes\n *\n * MemberTypes :\n * - `|`? NamedType\n * - MemberTypes | NamedType\n */\nfunction parseMemberTypesDefinition(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}\n\n/**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\nfunction parseEnumTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n return {\n kind: _kinds.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\nfunction parseEnumValuesDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseEnumValueDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\nfunction parseEnumValueDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\nfunction parseInputObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\nfunction parseInputFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseInputValueDef, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\nfunction parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\n/**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\nfunction parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\nfunction parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeExtension :\n * - extend interface Name Directives[Const]? FieldsDefinition\n * - extend interface Name Directives[Const]\n */\nfunction parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? MemberTypesDefinition\n * - extend union Name Directives[Const]\n */\nfunction parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\nfunction parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\nfunction parseInputObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? on DirectiveLocations\n */\nfunction parseDirectiveDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'directive');\n expect(lexer, _lexer.TokenKind.AT);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expectKeyword(lexer, 'on');\n var locations = parseDirectiveLocations(lexer);\n return {\n kind: _kinds.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n locations: locations,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\nfunction parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}\n\n/*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\nfunction parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n if (_directiveLocation.DirectiveLocation.hasOwnProperty(name.value)) {\n return name;\n }\n throw unexpected(lexer, start);\n}\n\n// Core parsing utility functions\n\n/**\n * Returns a location object, used to identify the place in\n * the source that created a given parsed object.\n */\nfunction loc(lexer, startToken) {\n if (!lexer.options.noLocation) {\n return new Loc(startToken, lexer.lastToken, lexer.source);\n }\n}\n\nfunction Loc(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nLoc.prototype.toJSON = Loc.prototype.inspect = function toJSON() {\n return { start: this.start, end: this.end };\n};\n\n/**\n * Determines if the next token is of a given kind\n */\nfunction peek(lexer, kind) {\n return lexer.token.kind === kind;\n}\n\n/**\n * If the next token is of the given kind, return true after advancing\n * the lexer. Otherwise, do not change the parser state and return false.\n */\nfunction skip(lexer, kind) {\n var match = lexer.token.kind === kind;\n if (match) {\n lexer.advance();\n }\n return match;\n}\n\n/**\n * If the next token is of the given kind, return that token after advancing\n * the lexer. Otherwise, do not change the parser state and throw an error.\n */\nfunction expect(lexer, kind) {\n var token = lexer.token;\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * If the next token is a keyword with the given value, return that token after\n * advancing the lexer. Otherwise, do not change the parser state and return\n * false.\n */\nfunction expectKeyword(lexer, value) {\n var token = lexer.token;\n if (token.kind === _lexer.TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected \"' + value + '\", found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Helper function for creating an error when an unexpected lexed token\n * is encountered.\n */\nfunction unexpected(lexer, atToken) {\n var token = atToken || lexer.token;\n return (0, _error.syntaxError)(lexer.source, token.start, 'Unexpected ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Returns a possibly empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction any(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}\n\n/**\n * Returns a non-empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction many(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [parseFn(lexer)];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.visit = visit;\nexports.visitInParallel = visitInParallel;\nexports.visitWithTypeInfo = visitWithTypeInfo;\nexports.getVisitFn = getVisitFn;\n\n\n/**\n * A visitor is comprised of visit functions, which are called on each node\n * during the visitor's traversal.\n */\n\n\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar QueryDocumentKeys = exports.QueryDocumentKeys = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name',\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations']\n};\n\n/**\n * A KeyMap describes each the traversable properties of each kind of node.\n */\nvar BREAK = exports.BREAK = {};\n\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\nfunction visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n node = clone;\n }\n var editOffset = 0;\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n if (inArray) {\n editKey -= editOffset;\n }\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n if (node === null || node === undefined) {\n continue;\n }\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + JSON.stringify(node));\n }\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n if (parent) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\nfunction visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\nfunction visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}\n\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\nfunction getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n var specificKindVisitor = specificVisitor[kind];\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.print = print;\n\nvar _visitor = require('./visitor');\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\nfunction print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n\n // Document\n\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet;\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n\n\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue;\n return variable + ': ' + type + wrap(' = ', defaultValue);\n },\n\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n\n // Fragments\n\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'fragment ' + name + wrap('(', join(variableDefinitions, ', '), ')') + ' ' + ('on ' + typeCondition + ' ' + wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n\n // Value\n\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return JSON.stringify(value);\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n\n // Directive\n\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n\n // Type\n\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n\n // Type System Definitions\n\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n\n ScalarTypeDefinition: function ScalarTypeDefinition(_ref22) {\n var description = _ref22.description,\n name = _ref22.name,\n directives = _ref22.directives;\n return join([description, join(['scalar', name, join(directives, ' ')], ' ')], '\\n');\n },\n\n ObjectTypeDefinition: function ObjectTypeDefinition(_ref23) {\n var description = _ref23.description,\n name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join([description, join(['type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n FieldDefinition: function FieldDefinition(_ref24) {\n var description = _ref24.description,\n name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return join([description, name + wrap('(', join(args, ', '), ')') + ': ' + type + wrap(' ', join(directives, ' '))], '\\n');\n },\n\n InputValueDefinition: function InputValueDefinition(_ref25) {\n var description = _ref25.description,\n name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([description, join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ')], '\\n');\n },\n\n InterfaceTypeDefinition: function InterfaceTypeDefinition(_ref26) {\n var description = _ref26.description,\n name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join([description, join(['interface', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n UnionTypeDefinition: function UnionTypeDefinition(_ref27) {\n var description = _ref27.description,\n name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join([description, join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ')], '\\n');\n },\n\n EnumTypeDefinition: function EnumTypeDefinition(_ref28) {\n var description = _ref28.description,\n name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join([description, join(['enum', name, join(directives, ' '), block(values)], ' ')], '\\n');\n },\n\n EnumValueDefinition: function EnumValueDefinition(_ref29) {\n var description = _ref29.description,\n name = _ref29.name,\n directives = _ref29.directives;\n return join([description, join([name, join(directives, ' ')], ' ')], '\\n');\n },\n\n InputObjectTypeDefinition: function InputObjectTypeDefinition(_ref30) {\n var description = _ref30.description,\n name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join([description, join(['input', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n ScalarTypeExtension: function ScalarTypeExtension(_ref31) {\n var name = _ref31.name,\n directives = _ref31.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n\n ObjectTypeExtension: function ObjectTypeExtension(_ref32) {\n var name = _ref32.name,\n interfaces = _ref32.interfaces,\n directives = _ref32.directives,\n fields = _ref32.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ');\n },\n\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives,\n fields = _ref33.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n\n UnionTypeExtension: function UnionTypeExtension(_ref34) {\n var name = _ref34.name,\n directives = _ref34.directives,\n types = _ref34.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n\n EnumTypeExtension: function EnumTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n values = _ref35.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n fields = _ref36.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n },\n\n DirectiveDefinition: function DirectiveDefinition(_ref37) {\n var description = _ref37.description,\n name = _ref37.name,\n args = _ref37.arguments,\n locations = _ref37.locations;\n return join([description, 'directive @' + name + wrap('(', join(args, ', '), ')') + ' on ' + join(locations, ' | ')], '\\n');\n }\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\nfunction block(array) {\n return array && array.length !== 0 ? indent('{\\n' + join(array, '\\n')) + '\\n}' : '';\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && maybeString.replace(/\\n/g, '\\n ');\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\nfunction printBlockString(value, isDescription) {\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n}","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, false, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = clone;\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Upper cased words. E.g. \"HELLO\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word\n * @param {number} count\n * @param {boolean} inclusive\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['whiskey', 'whiskies']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/(m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/(m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],\n [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'alcohol',\n 'ammo',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'manga',\n 'news',\n 'pike',\n 'plankton',\n 'pliers',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transporation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","import { parse } from \"graphql/language/parser\";\nimport { print } from \"graphql/language/printer\";\nimport { DocumentNode } from \"graphql/language/ast\";\n\n// @ts-ignore\nimport lodashIsEqual from \"lodash.isequal\";\n\n// @ts-ignore\nimport lodashClone from \"lodash.clone\";\n\n// @ts-ignore\nimport pluralizeLib from \"pluralize\";\nexport const pluralize = pluralizeLib.plural;\nexport const singularize = pluralizeLib.singular;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function upcaseFirstLetter(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n\n/**\n * Down cases the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function downcaseFirstLetter(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n\n/**\n * Takes a string with a graphql query and formats it. Useful for debug output and the tests.\n * @param {string} query\n * @returns {string}\n */\nexport function prettify(query: string | DocumentNode): string {\n return print(parseQuery(query));\n}\n\n/**\n * Returns a parsed query as GraphQL AST DocumentNode.\n *\n * @param {string | DocumentNode} query - Query as string or GraphQL AST DocumentNode.\n *\n * @returns {DocumentNode} Query as GraphQL AST DocumentNode.\n */\nexport function parseQuery(query: string | DocumentNode): DocumentNode {\n return typeof query === \"string\" ? parse(query) : query;\n}\n\n/**\n * @param {DocumentNode} query - The GraphQL AST DocumentNode.\n *\n * @returns {string} the GraphQL query within a DocumentNode as a plain string.\n */\nexport function graphQlDocumentToString(query: DocumentNode): string {\n return query.loc!.source.body;\n}\n\n/**\n * Tells if a object is just a simple object.\n *\n * @param {any} obj - Value to check.\n */\nexport function isPlainObject(obj: any): boolean {\n // Basic check for Type object that's not null\n return obj !== null && !(obj instanceof Array) && typeof obj === \"object\";\n}\n\n/**\n * Creates an object composed of the picked `object` properties.\n * @param {object} object - Object.\n * @param {array} props - Properties to pick.\n */\nexport function pick(object: any, props: Array) {\n if (!object) {\n return {};\n }\n\n let index = -1;\n const length = props.length;\n const result = {};\n\n while (++index < length) {\n const prop = props[index];\n result[prop] = object[prop];\n }\n\n return result;\n}\n\nexport function isEqual(a: object, b: object): boolean {\n // Couldn' find a simpler working implementation yet.\n return lodashIsEqual(a, b);\n}\n\nexport function clone(input: any): any {\n // Couldn' find a simpler working implementation yet.\n return lodashClone(input);\n}\n\nexport function takeWhile(\n array: Array,\n predicate: (x: any, idx: number, array: Array) => any\n) {\n let index = -1;\n\n while (++index < array.length && predicate(array[index], index, array)) {\n // just increase index\n }\n\n return array.slice(0, index);\n}\n\nexport function matches(source: any) {\n source = clone(source);\n\n return (object: any) => isEqual(object, source);\n}\n\nexport function removeSymbols(input: any) {\n return JSON.parse(JSON.stringify(input));\n}\n","import { DocumentNode } from \"graphql/language/ast\";\nimport { Arguments } from \"../support/interfaces\";\nimport { FetchPolicy } from \"apollo-client\";\nimport { isPlainObject, prettify } from \"../support/utils\";\n\n/**\n * Vuex-ORM-Apollo Debug Logger.\n * Wraps console and only logs if enabled.\n *\n * Also contains some methods to format graphql queries for the output\n */\nexport default class Logger {\n /**\n * Tells if any logging should happen\n * @type {boolean}\n */\n private readonly enabled: boolean;\n\n /**\n * Fancy Vuex-ORM-Apollo prefix for all log messages.\n * @type {string[]}\n */\n private readonly PREFIX = [\n \"%c Vuex-ORM: GraphQL Plugin %c\",\n \"background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;\",\n \"background: transparent;\"\n ];\n\n /**\n * @constructor\n * @param {boolean} enabled Tells if any logging should happen\n */\n public constructor(enabled: boolean) {\n this.enabled = enabled;\n this.log(\"Logging is enabled.\");\n }\n\n /**\n * Wraps console.group. In TEST env console.log is used instead because console.group doesn't work on CLI.\n * If available console.groupCollapsed will be used instead.\n * @param {Array} messages\n */\n public group(...messages: Array): void {\n if (this.enabled) {\n if (console.groupCollapsed) {\n console.groupCollapsed(...this.PREFIX, ...messages);\n } else {\n console.log(...this.PREFIX, ...messages);\n }\n }\n }\n\n /**\n * Wrapper for console.groupEnd. In TEST env nothing happens because console.groupEnd doesn't work on CLI.\n */\n public groupEnd(): void {\n if (this.enabled && console.groupEnd) console.groupEnd();\n }\n\n /**\n * Wrapper for console.log.\n * @param {Array} messages\n */\n public log(...messages: Array): void {\n if (this.enabled) {\n console.log(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Wrapper for console.warn.\n * @param {Array} messages\n */\n public warn(...messages: Array): void {\n if (this.enabled) {\n console.warn(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Logs a graphql query in a readable format and with all information like fetch policy and variables.\n * @param {string | DocumentNode} query\n * @param {Arguments} variables\n * @param {FetchPolicy} fetchPolicy\n */\n public logQuery(query: string | DocumentNode, variables?: Arguments, fetchPolicy?: FetchPolicy) {\n if (this.enabled) {\n try {\n let prettified = \"\";\n if (isPlainObject(query) && (query as DocumentNode).loc) {\n prettified = prettify((query as DocumentNode).loc!.source.body);\n } else {\n prettified = prettify(query as string);\n }\n\n this.group(\n \"Sending query:\",\n prettified\n .split(\"\\n\")[1]\n .replace(\"{\", \"\")\n .trim()\n );\n console.log(prettified);\n\n if (variables) console.log(\"VARIABLES:\", variables);\n if (fetchPolicy) console.log(\"FETCH POLICY:\", fetchPolicy);\n\n this.groupEnd();\n } catch (e) {\n console.error(\"[Vuex-ORM-Apollo] There is a syntax error in the query!\", e, query);\n }\n }\n }\n}\n","import { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport { Field, PatchedModel } from \"../support/interfaces\";\nimport Context from \"../common/context\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport { pluralize, singularize, pick, isEqual } from \"../support/utils\";\n\n/**\n * Wrapper around a Vuex-ORM model with some useful methods.\n *\n * Also provides a mock system, to define mocking responses for actions.\n */\nexport default class Model {\n /**\n * The singular name of a model like `blogPost`\n * @type {string}\n */\n public readonly singularName: string;\n\n /**\n * The plural name of a model like `blogPosts`\n * @type {string}\n */\n public readonly pluralName: string;\n\n /**\n * The original Vuex-ORM model\n */\n public readonly baseModel: typeof PatchedModel;\n\n /**\n * The fields of the model\n * @type {Map}\n */\n public readonly fields: Map = new Map();\n\n /**\n * Container for the mocks.\n * @type {Object}\n */\n private mocks: { [key: string]: Array } = {};\n\n /**\n * @constructor\n * @param {Model} baseModel The original Vuex-ORM model\n */\n public constructor(baseModel: typeof ORMModel) {\n this.baseModel = baseModel as typeof PatchedModel;\n\n // Generate name variants\n this.singularName = singularize(this.baseModel.entity);\n this.pluralName = pluralize(this.baseModel.entity);\n\n // Cache the fields of the model in this.fields\n const fields = this.baseModel.fields();\n Object.keys(fields).forEach((name: string) => {\n this.fields.set(name, fields[name] as Field);\n });\n }\n\n /**\n * Tells if a field is a numeric field.\n *\n * @param {Field | undefined} field\n * @returns {boolean}\n */\n public static isFieldNumber(field: Field | undefined): boolean {\n if (!field) return false;\n\n const context = Context.getInstance();\n return (\n field instanceof context.components.Number || field instanceof context.components.Increment\n );\n }\n\n /**\n * Tells if a field is a attribute (and thus not a relation)\n * @param {Field} field\n * @returns {boolean}\n */\n public static isFieldAttribute(field: Field): boolean {\n const context = Context.getInstance();\n\n return (\n field instanceof context.components.Increment ||\n field instanceof context.components.Attr ||\n field instanceof context.components.String ||\n field instanceof context.components.Number ||\n field instanceof context.components.Boolean\n );\n }\n\n /**\n * Tells if a field which represents a relation is a connection (multiple).\n * @param {Field} field\n * @returns {boolean}\n */\n public static isConnection(field: Field): boolean {\n const context = Context.getInstance();\n\n return !(\n field instanceof context.components.BelongsTo ||\n field instanceof context.components.HasOne ||\n field instanceof context.components.MorphTo ||\n field instanceof context.components.MorphOne\n );\n }\n\n /**\n * Adds $isPersisted and other meta fields to the model by overwriting the fields() method.\n * @todo is this a good way to add fields?\n * @param {Model} model\n */\n public static augment(model: Model) {\n const originalFieldGenerator = model.baseModel.fields.bind(model.baseModel);\n\n model.baseModel.fields = () => {\n const originalFields = originalFieldGenerator();\n\n originalFields[\"$isPersisted\"] = model.baseModel.boolean(false);\n\n return originalFields;\n };\n }\n\n /**\n * Returns the related model for a relation.\n * @param {Field|undefined} relation Relation field.\n * @returns {Model|null}\n */\n public static getRelatedModel(relation?: Relation) {\n if (relation === undefined) return null;\n\n const context: Context = Context.getInstance();\n\n if (\n relation instanceof context.components.BelongsToMany ||\n relation instanceof context.components.HasMany ||\n relation instanceof context.components.HasManyThrough ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphToMany ||\n relation instanceof context.components.HasOne\n ) {\n return context.getModel(relation.related.entity, true);\n } else if (\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasManyBy\n ) {\n return context.getModel(relation.parent.entity, true);\n } else if (relation instanceof context.components.MorphTo) {\n return context.getModel(relation.type, true);\n } else {\n console.warn(\"Failed relation\", typeof relation, relation);\n throw new Error(`Can't find related model for relation of type ${typeof relation}!`);\n }\n }\n\n /**\n * Returns all fields which should be included in a graphql query: All attributes which are not included in the\n * skipFields array or start with $.\n * @returns {Array} field names which should be queried\n */\n public getQueryFields(): Array {\n const fields: Array = [];\n\n this.fields.forEach((field: Field, name: string) => {\n if (Model.isFieldAttribute(field) && !this.skipField(name)) {\n fields.push(name);\n }\n });\n\n return fields;\n }\n\n /**\n * Tells if a field should be ignored. This is true for fields that start with a `$` or is it is within the skipField\n * property or is the foreignKey of a belongsTo/hasOne relation.\n *\n * @param {string} field\n * @returns {boolean}\n */\n public skipField(field: string) {\n if (field.startsWith(\"$\")) return true;\n if (this.baseModel.skipFields && this.baseModel.skipFields.indexOf(field) >= 0) return true;\n\n const context = Context.getInstance();\n\n let shouldSkipField: boolean = false;\n\n this.getRelations().forEach((relation: Relation) => {\n if (\n (relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasOne) &&\n relation.foreignKey === field\n ) {\n shouldSkipField = true;\n return false;\n }\n return true;\n });\n\n return shouldSkipField;\n }\n\n /**\n * @returns {Map} all relations of the model.\n */\n public getRelations(): Map {\n const relations = new Map();\n\n this.fields.forEach((field: Field, name: string) => {\n if (!Model.isFieldAttribute(field)) {\n relations.set(name, field as Relation);\n }\n });\n\n return relations;\n }\n\n /**\n * This accepts a field like `subjectType` and checks if this is just randomly named `...Type` or it is part\n * of a polymorphic relation.\n * @param {string} name\n * @returns {boolean}\n */\n public isTypeFieldOfPolymorphicRelation(name: string): boolean {\n const context = Context.getInstance();\n let found: boolean = false;\n\n context.models.forEach(model => {\n if (found) return false;\n\n model.getRelations().forEach(relation => {\n if (\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphTo ||\n relation instanceof context.components.MorphToMany\n ) {\n const related = (relation as Field).related;\n\n if (relation.type === name && related && related.entity === this.baseModel.entity) {\n found = true;\n return false; // break\n }\n }\n\n return true;\n });\n\n return true;\n });\n\n return found;\n }\n\n /**\n * Returns a record of this model with the given ID.\n * @param {number} id\n * @returns {any}\n */\n public getRecordWithId(id: number) {\n return this.baseModel\n .query()\n .withAllRecursive()\n .where(\"id\", id)\n .first();\n }\n\n /**\n * Determines if we should eager load (means: add as a field in the graphql query) a related entity. belongsTo,\n * hasOne and morphOne related entities are always eager loaded. Others can be added to the `eagerLoad` array\n * or `eagerSync` of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerLoadRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // HasOne, BelongsTo and MorphOne are always eager loaded\n if (\n relation instanceof context.components.HasOne ||\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.MorphOne\n ) {\n return true;\n }\n\n // Create a list of all relations that have to be eager loaded\n const eagerLoadList: Array = this.baseModel.eagerLoad || [];\n Array.prototype.push.apply(eagerLoadList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerLoadList.\n return (\n eagerLoadList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Determines if we should eager save (means: add as a field in the graphql mutation) a related entity. belongsTo\n * related entities are always eager saved. Others can be added to the `eagerSave` or `eagerSync` array of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerSaveRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // BelongsTo is always eager saved\n if (relation instanceof context.components.BelongsTo) {\n return true;\n }\n\n // Create a list of all relations that have to be eager saved\n const eagerSaveList: Array = this.baseModel.eagerSave || [];\n Array.prototype.push.apply(eagerSaveList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerSaveList.\n return (\n eagerSaveList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Adds a mock.\n *\n * @param {Mock} mock - Mock config.\n * @returns {boolean}\n */\n public $addMock(mock: Mock): boolean {\n if (this.$findMock(mock.action, mock.options)) return false;\n if (!this.mocks[mock.action]) this.mocks[mock.action] = [];\n\n this.mocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions like { variables: { id: 42 } }.\n * @returns {Mock | null} null when no mock was found.\n */\n public $findMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.mocks[action]) {\n return (\n this.mocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by all actions in order to get the mock returnValue.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public $mockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.$findMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n if (returnValue) {\n if (returnValue instanceof Array) {\n returnValue.forEach(r => (r.$isPersisted = true));\n } else {\n returnValue.$isPersisted = true;\n }\n\n return { [this.pluralName]: returnValue };\n }\n\n return null;\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new Error(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new Error(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle\r\n// the `skip` and `include` directives within GraphQL.\r\nimport {\r\n FieldNode,\r\n OperationDefinitionNode,\r\n SelectionNode,\r\n VariableNode,\r\n BooleanValueNode,\r\n DirectiveNode,\r\n DocumentNode,\r\n} from 'graphql';\r\n\r\nimport { argumentsObjectFromField } from './storeUtils';\r\n\r\nexport type DirectiveInfo = {\r\n [fieldName: string]: { [argName: string]: any };\r\n};\r\n\r\nexport function getDirectiveInfoFromField(\r\n field: FieldNode,\r\n variables: Object,\r\n): DirectiveInfo {\r\n if (field.directives && field.directives.length) {\r\n const directiveObj: DirectiveInfo = {};\r\n field.directives.forEach((directive: DirectiveNode) => {\r\n directiveObj[directive.name.value] = argumentsObjectFromField(\r\n directive,\r\n variables,\r\n );\r\n });\r\n return directiveObj;\r\n }\r\n return null;\r\n}\r\n\r\nexport function shouldInclude(\r\n selection: SelectionNode,\r\n variables: { [name: string]: any } = {},\r\n): boolean {\r\n if (!selection.directives) {\r\n return true;\r\n }\r\n\r\n let res: boolean = true;\r\n selection.directives.forEach(directive => {\r\n // TODO should move this validation to GraphQL validation once that's implemented.\r\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\r\n // Just don't worry about directives we don't understand\r\n return;\r\n }\r\n\r\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\r\n const directiveArguments = directive.arguments || [];\r\n const directiveName = directive.name.value;\r\n if (directiveArguments.length !== 1) {\r\n throw new Error(\r\n `Incorrect number of arguments for the @${directiveName} directive.`,\r\n );\r\n }\r\n\r\n const ifArgument = directiveArguments[0];\r\n if (!ifArgument.name || ifArgument.name.value !== 'if') {\r\n throw new Error(`Invalid argument for the @${directiveName} directive.`);\r\n }\r\n\r\n const ifValue = directiveArguments[0].value;\r\n let evaledValue: boolean = false;\r\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\r\n // means it has to be a variable value if this is a valid @skip or @include directive\r\n if (ifValue.kind !== 'Variable') {\r\n throw new Error(\r\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\r\n );\r\n } else {\r\n evaledValue = variables[(ifValue as VariableNode).name.value];\r\n if (evaledValue === undefined) {\r\n throw new Error(\r\n `Invalid variable referenced in @${directiveName} directive.`,\r\n );\r\n }\r\n }\r\n } else {\r\n evaledValue = (ifValue as BooleanValueNode).value;\r\n }\r\n\r\n if (directiveName === 'skip') {\r\n evaledValue = !evaledValue;\r\n }\r\n\r\n if (!evaledValue) {\r\n res = false;\r\n }\r\n });\r\n\r\n return res;\r\n}\r\n\r\nexport function flattenSelections(selection: SelectionNode): SelectionNode[] {\r\n if (\r\n !(selection as FieldNode).selectionSet ||\r\n !((selection as FieldNode).selectionSet.selections.length > 0)\r\n )\r\n return [selection];\r\n\r\n return [selection].concat(\r\n (selection as FieldNode).selectionSet.selections\r\n .map(selectionNode =>\r\n [selectionNode].concat(flattenSelections(selectionNode)),\r\n )\r\n .reduce((selections, selected) => selections.concat(selected), []),\r\n );\r\n}\r\n\r\nexport function getDirectiveNames(doc: DocumentNode) {\r\n // operation => [names of directives];\r\n const directiveNames = doc.definitions\r\n .filter(\r\n (definition: OperationDefinitionNode) =>\r\n definition.selectionSet && definition.selectionSet.selections,\r\n )\r\n // operation => [[Selection]]\r\n .map(x => flattenSelections(x as any))\r\n // [[Selection]] => [Selection]\r\n .reduce((selections, selected) => selections.concat(selected), [])\r\n // [Selection] => [Selection with Directives]\r\n .filter(\r\n (selection: SelectionNode) =>\r\n selection.directives && selection.directives.length > 0,\r\n )\r\n // [Selection with Directives] => [[Directives]]\r\n .map((selection: SelectionNode) => selection.directives)\r\n // [[Directives]] => [Directives]\r\n .reduce((directives, directive) => directives.concat(directive), [])\r\n // [Directives] => [Name]\r\n .map((directive: DirectiveNode) => directive.name.value);\r\n return directiveNames;\r\n}\r\n\r\nexport function hasDirectives(names: string[], doc: DocumentNode) {\r\n return getDirectiveNames(doc).some(\r\n (name: string) => names.indexOf(name) > -1,\r\n );\r\n}\r\n","/**\r\n * Adds the properties of one or more source objects to a target object. Works exactly like\r\n * `Object.assign`, but as a utility to maintain support for IE 11.\r\n *\r\n * @see https://github.com/apollostack/apollo-client/pull/1009\r\n */\r\nexport function assign(a: A, b: B): A & B;\r\nexport function assign(a: A, b: B, c: C): A & B & C;\r\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\r\nexport function assign(\r\n a: A,\r\n b: B,\r\n c: C,\r\n d: D,\r\n e: E,\r\n): A & B & C & D & E;\r\nexport function assign(target: any, ...sources: Array): any;\r\nexport function assign(\r\n target: { [key: string]: any },\r\n ...sources: Array<{ [key: string]: any }>\r\n): { [key: string]: any } {\r\n sources.forEach(source => {\r\n if (typeof source === 'undefined' || source === null) {\r\n return;\r\n }\r\n Object.keys(source).forEach(key => {\r\n target[key] = source[key];\r\n });\r\n });\r\n return target;\r\n}\r\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n DefinitionNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { cloneDeep } from './util/cloneDeep';\n\nimport {\n checkDocument,\n getOperationDefinitionOrDie,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n} from './getFromAST';\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isNotEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): Boolean {\n // keep selections that are still valid\n return (\n op.selectionSet.selections.filter(\n selectionSet =>\n // anything that doesn't match the compound filter is okay\n !// not an empty array\n (\n selectionSet &&\n // look into fragments to verify they should stay\n selectionSet.kind === 'FragmentSpread' &&\n // see if the fragment in the map is valid (recursively)\n !isNotEmpty(fragments[selectionSet.name.value], fragments)\n ),\n ).length > 0\n );\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode): Boolean {\n return directives.some(\n (dir: RemoveDirectiveConfig | GetDirectiveConfig) => {\n if (dir.name && dir.name === directive.name.value) return true;\n if (dir.test && dir.test(directive)) return true;\n return false;\n },\n );\n };\n}\n\nfunction addTypenameToSelectionSet(\n selectionSet: SelectionSetNode,\n isRoot = false,\n) {\n if (selectionSet.selections) {\n if (!isRoot) {\n const alreadyHasThisField = selectionSet.selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n });\n\n if (!alreadyHasThisField) {\n selectionSet.selections.push(TYPENAME_FIELD);\n }\n }\n\n selectionSet.selections.forEach(selection => {\n // Must not add __typename if we're inside an introspection query\n if (selection.kind === 'Field') {\n if (\n selection.name.value.lastIndexOf('__', 0) !== 0 &&\n selection.selectionSet\n ) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n } else if (selection.kind === 'InlineFragment') {\n if (selection.selectionSet) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n }\n });\n }\n}\n\nexport type RemoveDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n remove?: boolean;\n};\n\nfunction removeDirectivesFromSelectionSet(\n directives: RemoveDirectiveConfig[],\n selectionSet: SelectionSetNode,\n): SelectionSetNode {\n if (!selectionSet.selections) return selectionSet;\n // if any of the directives are set to remove this selectionSet, remove it\n const agressiveRemove = directives.some(\n (dir: RemoveDirectiveConfig) => dir.remove,\n );\n\n selectionSet.selections = selectionSet.selections\n .map(selection => {\n if (\n selection.kind !== 'Field' ||\n !(selection as FieldNode) ||\n !selection.directives\n )\n return selection;\n const directiveMatcher = getDirectiveMatcher(directives);\n let remove: boolean;\n selection.directives = selection.directives.filter(directive => {\n const shouldKeep = !directiveMatcher(directive);\n\n if (!remove && !shouldKeep && agressiveRemove) remove = true;\n\n return shouldKeep;\n });\n\n return remove ? null : selection;\n })\n .filter(x => !!x);\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n removeDirectivesFromSelectionSet(directives, selection.selectionSet);\n }\n });\n\n return selectionSet;\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n removeDirectivesFromSelectionSet(\n directives,\n (definition as OperationDefinitionNode).selectionSet,\n );\n });\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode) {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n const isRoot = definition.kind === 'OperationDefinition';\n addTypenameToSelectionSet(\n (definition as OperationDefinitionNode).selectionSet,\n isRoot,\n );\n });\n return docClone;\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n checkDocument(doc);\n return removeDirectivesFromDocument([connectionRemoveConfig], doc);\n}\n\nexport type GetDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n};\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n if (!(selectionSet && selectionSet.selections)) {\n return false;\n }\n const matchedSelections = selectionSet.selections.filter(selection => {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n });\n return matchedSelections.length > 0;\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n const directiveMatcher = getDirectiveMatcher(directives);\n const matchedDirectives = selection.directives.filter(directiveMatcher);\n return (\n matchedDirectives.length > 0 ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nfunction getDirectivesFromSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n) {\n selectionSet.selections = selectionSet.selections\n .filter(selection => {\n return hasDirectivesInSelection(directives, selection, true);\n })\n .map(selection => {\n if (hasDirectivesInSelection(directives, selection, false)) {\n return selection;\n }\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n selection.selectionSet = getDirectivesFromSelectionSet(\n directives,\n selection.selectionSet,\n );\n }\n return selection;\n });\n return selectionSet;\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n includeAllFragments = false,\n): DocumentNode | null {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n docClone.definitions = docClone.definitions.map(definition => {\n if (\n (definition.kind === 'OperationDefinition' ||\n (definition.kind === 'FragmentDefinition' && !includeAllFragments)) &&\n definition.selectionSet\n ) {\n definition.selectionSet = getDirectivesFromSelectionSet(\n directives,\n definition.selectionSet,\n );\n }\n return definition;\n });\n\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/networkStatus.ts"},"export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// === Symbol Support ===\n\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species');\n\n// === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n\n if (value == null) return undefined;\n\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n if (ctor === null) {\n ctor = undefined;\n }\n }\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n if (!queue) {\n return;\n }\n subscription._queue = undefined;\n subscription._state = 'ready';\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({ type: type, value: value });\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{ type: type, value: value }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = function () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: 'unsubscribe',\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: 'closed',\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = function () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: 'next',\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: 'error',\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: 'complete',\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: 'closed',\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = exports.Observable = function () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: 'subscribe',\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: 'forEach',\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: 'map',\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'filter',\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'reduce',\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'concat',\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscription = void 0;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: 'flatMap',\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: 'from',\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n\n if (x == null) throw new TypeError(x + ' is not an object');\n\n var method = getMethod(x, SymbolObservable);\n if (method) {\n var observable = method.call(x);\n\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n\n if (isObservable(observable) && observable.constructor === C) return observable;\n\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n\n observer.next(item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: 'of',\n value: function of() {\n for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","module.exports = require('./lib/Observable.js').Observable;\n","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/util/Observable.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/errors/ApolloError.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/types.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/ObservableQuery.ts"},"import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n Observable,\n} from 'apollo-link';\n\n/*\n * Expects context to contain the forceFetch field if no dedup\n */\nexport class DedupLink extends ApolloLink {\n private inFlightRequestObservables: Map<\n string,\n Observable\n > = new Map();\n private subscribers: Map = new Map();\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable {\n // sometimes we might not want to deduplicate a request, for example when we want to force fetch it.\n if (operation.getContext().forceFetch) {\n return forward(operation);\n }\n\n const key = operation.toKey();\n\n const cleanup = operationKey => {\n this.inFlightRequestObservables.delete(operationKey);\n const prev = this.subscribers.get(operationKey);\n return prev;\n };\n\n if (!this.inFlightRequestObservables.get(key)) {\n // this is a new request, i.e. we haven't deduplicated it yet\n // call the next link\n const singleObserver = forward(operation);\n let subscription;\n\n const sharedObserver = new Observable(observer => {\n // this will still be called by each subscriber regardless of\n // deduplication status\n let prev = this.subscribers.get(key);\n if (!prev) prev = { next: [], error: [], complete: [] };\n\n this.subscribers.set(key, {\n next: prev.next.concat([observer.next.bind(observer)]),\n error: prev.error.concat([observer.error.bind(observer)]),\n complete: prev.complete.concat([observer.complete.bind(observer)]),\n });\n\n if (!subscription) {\n subscription = singleObserver.subscribe({\n next: result => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) {\n previous.next.forEach(next => next(result));\n previous.complete.forEach(complete => complete());\n }\n },\n error: error => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) previous.error.forEach(err => err(error));\n },\n });\n }\n\n return () => {\n if (subscription) subscription.unsubscribe();\n this.inFlightRequestObservables.delete(key);\n };\n });\n\n this.inFlightRequestObservables.set(key, sharedObserver);\n }\n\n // return shared Observable\n return this.inFlightRequestObservables.get(key);\n }\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/scheduler/scheduler.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/mutations.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/queries.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/QueryManager.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/store.ts"},"exports.version = \"2.4.6\"",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/ApolloClient.ts"},"import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\n(function (invariant) {\r\n function warn() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.warn.apply(console, args);\r\n }\r\n invariant.warn = warn;\r\n function error() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.error.apply(console, args);\r\n }\r\n invariant.error = error;\r\n})(invariant || (invariant = {}));\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant };\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n if (!selection.directives) {\n return true;\n }\n\n let res: boolean = true;\n selection.directives.forEach(directive => {\n // TODO should move this validation to GraphQL validation once that's implemented.\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\n // Just don't worry about directives we don't understand\n return;\n }\n\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\n const directiveArguments = directive.arguments || [];\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue = directiveArguments[0].value;\n let evaledValue: boolean = false;\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue.kind === 'Variable',\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n evaledValue = variables[(ifValue as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directiveName} directive.`,\n );\n } else {\n evaledValue = (ifValue as BooleanValueNode).value;\n }\n\n if (directiveName === 'skip') {\n evaledValue = !evaledValue;\n }\n\n if (!evaledValue) {\n res = false;\n }\n });\n\n return res;\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more then one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n ((selection as FieldNode).name.value === '__typename' ||\n (selection as FieldNode).name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n },\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","\"use strict\";\n\nfunction Cache(options) {\n this.map = new Map;\n this.newest = null;\n this.oldest = null;\n this.max = options && options.max;\n this.dispose = options && options.dispose;\n}\n\nexports.Cache = Cache;\n\nvar Cp = Cache.prototype;\n\nCp.has = function (key) {\n return this.map.has(key);\n};\n\nCp.get = function (key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n};\n\nfunction getEntry(cache, key) {\n var entry = cache.map.get(key);\n if (entry &&\n entry !== cache.newest) {\n var older = entry.older;\n var newer = entry.newer;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = cache.newest;\n entry.older.newer = entry;\n\n entry.newer = null;\n cache.newest = entry;\n\n if (entry === cache.oldest) {\n cache.oldest = newer;\n }\n }\n\n return entry;\n}\n\nCp.set = function (key, value) {\n var entry = getEntry(this, key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n};\n\nCp.clean = function () {\n if (typeof this.max === \"number\") {\n while (this.oldest &&\n this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n};\n\nCp.delete = function (key) {\n var entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n\n if (typeof this.dispose === \"function\") {\n this.dispose(key, entry.value);\n }\n\n return true;\n }\n\n return false;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Although `Symbol` is widely supported these days, we can safely fall\n// back to using a non-enumerable string property without violating any\n// assumptions elsewhere in the implementation.\nvar useSymbol =\n typeof Symbol === \"function\" &&\n typeof Symbol.for === \"function\";\n\n// Used to mark `tuple.prototype` so that all objects that inherit from\n// any `tuple.prototype` object (there could be more than one) will test\n// positive according to `tuple.isTuple`.\nvar brand = useSymbol\n ? Symbol.for(\"immutable-tuple\")\n : \"@@__IMMUTABLE_TUPLE__@@\";\n\n// Used to save a reference to the globally shared `UniversalWeakMap` that\n// stores all known `tuple` objects.\nvar globalKey = useSymbol\n ? Symbol.for(\"immutable-tuple-root\")\n : \"@@__IMMUTABLE_TUPLE_ROOT__@@\";\n\n// Convenient helper for defining hidden immutable properties.\nfunction def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}\n\nvar freeze = Object.freeze || function (obj) {\n return obj;\n};\n\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null) {\n return false;\n }\n case \"function\":\n return true;\n default:\n return false;\n }\n}\n\n// The `mustConvertThisToArray` value is true when the corresponding\n// `Array` method does not attempt to modify `this`, which means we can\n// pass a `tuple` object as `this` without first converting it to an\n// `Array`.\nfunction forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}\n\n// A map data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nvar UniversalWeakMap = function UniversalWeakMap() {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n this._weakMap = null;\n this._strongMap = null;\n this.data = null;\n};\n\n// Since `get` and `set` are the only methods used, that's all I've\n// implemented here.\n\nUniversalWeakMap.prototype.get = function get (key) {\n var map = this._getMap(key, false);\n if (map) {\n return map.get(key);\n }\n};\n\nUniversalWeakMap.prototype.set = function set (key, value) {\n this._getMap(key, true).set(key, value);\n // An actual `Map` or `WeakMap` would return `this` here, but\n // returning the `value` is more convenient for the `tuple`\n // implementation.\n return value;\n};\n\nUniversalWeakMap.prototype._getMap = function _getMap (key, canCreate) {\n if (! canCreate) {\n return isObjRef(key) ? this._weakMap : this._strongMap;\n }\n if (isObjRef(key)) {\n return this._weakMap || (this._weakMap = new WeakMap);\n }\n return this._strongMap || (this._strongMap = new Map);\n};\n\n// See [`universal-weak-map.js`](universal-weak-map.html).\n// See [`util.js`](util.html).\n// If this package is installed multiple times, there could be mutiple\n// implementations of the `tuple` function with distinct `tuple.prototype`\n// objects, but the shared pool of `tuple` objects must be the same across\n// all implementations. While it would be ideal to use the `global`\n// object, there's no reliable way to get the global object across all JS\n// environments without using the `Function` constructor, so instead we\n// use the global `Array` constructor as a shared namespace.\nvar root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);\n\nfunction lookup() {\n return lookupArray(arguments);\n}\n\nfunction lookupArray(array) {\n var node = root;\n\n // Because we are building a tree of *weak* maps, the tree will not\n // prevent objects in tuples from being garbage collected, since the\n // tree itself will be pruned over time when the corresponding `tuple`\n // objects become unreachable. In addition to internalization, this\n // property is a key advantage of the `immutable-tuple` package.\n var len = array.length;\n for (var i = 0; i < len; ++i) {\n var item = array[i];\n node = node.get(item) || node.set(item, new UniversalWeakMap);\n }\n\n // Return node.data rather than node itself to prevent tampering with\n // the UniversalWeakMap tree.\n return node.data || (node.data = Object.create(null));\n}\n\n// See [`lookup.js`](lookup.html).\n// See [`util.js`](util.html).\n// When called with any number of arguments, this function returns an\n// object that inherits from `tuple.prototype` and is guaranteed to be\n// `===` any other `tuple` object that has exactly the same items. In\n// computer science jargon, `tuple` instances are \"internalized\" or just\n// \"interned,\" which allows for constant-time equality checking, and makes\n// it possible for tuple objects to be used as `Map` or `WeakMap` keys, or\n// stored in a `Set`.\nfunction tuple() {\n var arguments$1 = arguments;\n\n var node = lookup.apply(null, arguments);\n\n if (node.tuple) {\n return node.tuple;\n }\n\n var t = Object.create(tuple.prototype);\n\n // Define immutable items with numeric indexes, and permanently fix the\n // `.length` property.\n var argc = arguments.length;\n for (var i = 0; i < argc; ++i) {\n t[i] = arguments$1[i];\n }\n\n def(t, \"length\", argc, false);\n\n // Remember this new `tuple` object so that we can return the same object\n // earlier next time.\n return freeze(node.tuple = t);\n}\n\n// Since the `immutable-tuple` package could be installed multiple times\n// in an application, there is no guarantee that the `tuple` constructor\n// or `tuple.prototype` will be unique, so `value instanceof tuple` is\n// unreliable. Instead, to test if a value is a tuple, you should use\n// `tuple.isTuple(value)`.\ndef(tuple.prototype, brand, true, false);\nfunction isTuple(that) {\n return !! (that && that[brand] === true);\n}\n\ntuple.isTuple = isTuple;\n\nfunction toArray(tuple) {\n var array = [];\n var i = tuple.length;\n while (i--) { array[i] = tuple[i]; }\n return array;\n}\n\n// Copy all generic non-destructive Array methods to `tuple.prototype`.\n// This works because (for example) `Array.prototype.slice` can be invoked\n// against any `Array`-like object.\nforEachArrayMethod(function (name, desc, mustConvertThisToArray) {\n var method = desc && desc.value;\n if (typeof method === \"function\") {\n desc.value = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = method.apply(\n mustConvertThisToArray ? toArray(this) : this,\n args\n );\n // Of course, `tuple.prototype.slice` should return a `tuple` object,\n // not a new `Array`.\n return Array.isArray(result) ? tuple.apply(void 0, result) : result;\n };\n Object.defineProperty(tuple.prototype, name, desc);\n }\n});\n\n// Like `Array.prototype.concat`, except for the extra effort required to\n// convert any tuple arguments to arrays, so that\n// ```\n// tuple(1).concat(tuple(2), 3) === tuple(1, 2, 3)\n// ```\nvar ref = Array.prototype;\nvar concat = ref.concat;\ntuple.prototype.concat = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return tuple.apply(void 0, concat.apply(toArray(this), args.map(\n function (item) { return isTuple(item) ? toArray(item) : item; }\n )));\n};\n\nexports.default = tuple;\nexports.tuple = tuple;\nexports.lookup = lookup;\nexports.lookupArray = lookupArray;\n","\"use strict\";\n\nvar fakeNullFiber = new (function Fiber(){});\nvar localKey = \"_optimism_local\";\n\nfunction getCurrentFiber() {\n return fakeNullFiber;\n}\n\nif (typeof module === \"object\") {\n try {\n var Fiber = module[\"eriuqer\".split(\"\").reverse().join(\"\")](\"fibers\");\n // If we were able to require fibers, redefine the getCurrentFiber\n // function so that it has a chance to return Fiber.current.\n getCurrentFiber = function () {\n return Fiber.current || fakeNullFiber;\n };\n } catch (e) {}\n}\n\n// Returns an object unique to Fiber.current, if fibers are enabled.\n// This object is used for Fiber-local storage in ./entry.js.\nexports.get = function () {\n var fiber = getCurrentFiber();\n return fiber[localKey] || (fiber[localKey] = Object.create(null));\n};\n","\"use strict\";\n\nvar getLocal = require(\"./local.js\").get;\nvar UNKNOWN_VALUE = Object.create(null);\nvar emptySetPool = [];\nvar entryPool = [];\n\n// Don't let the emptySetPool or entryPool grow larger than this size,\n// since unconstrained pool growth could lead to memory leaks.\nexports.POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition, optionalMessage) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nfunction Entry(fn, key, args) {\n this.parents = new Set;\n this.childValues = new Map;\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n this.dirtyChildren = null;\n\n reset(this, fn, key, args);\n\n ++Entry.count;\n}\n\nEntry.count = 0;\n\nfunction reset(entry, fn, key, args) {\n entry.fn = fn;\n entry.key = key;\n entry.args = args;\n entry.value = UNKNOWN_VALUE;\n entry.dirty = true;\n entry.subscribe = null;\n entry.unsubscribe = null;\n entry.recomputing = false;\n // Optional callback that will be invoked when entry.parents becomes\n // empty. The Entry object is given as the first parameter. If the\n // callback returns true, then this entry can be removed from the graph\n // and safely recycled into the entryPool.\n entry.reportOrphan = null;\n}\n\nEntry.acquire = function (fn, key, args) {\n var entry = entryPool.pop();\n if (entry) {\n reset(entry, fn, key, args);\n return entry;\n }\n return new Entry(fn, key, args);\n};\n\nfunction release(entry) {\n assert(entry.parents.size === 0);\n assert(entry.childValues.size === 0);\n assert(entry.dirtyChildren === null);\n if (entryPool.length < exports.POOL_TARGET_SIZE) {\n entryPool.push(entry);\n }\n}\n\nexports.Entry = Entry;\n\nvar Ep = Entry.prototype;\n\n// The public API of Entry objects consists of the Entry constructor,\n// along with the recompute, setDirty, and dispose methods.\n\nEp.recompute = function recompute() {\n if (! rememberParent(this) &&\n maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispos(), which recycles it\n // into the entryPool, so we don't need to (and should not) proceed\n // with the recomputation.\n return;\n }\n\n return recomputeIfDirty(this);\n};\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry) {\n var report = entry.reportOrphan;\n return typeof report === \"function\" &&\n entry.parents.size === 0 &&\n report(entry) === true;\n}\n\nEp.setDirty = function setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n unsubscribe(this);\n};\n\nEp.dispose = function dispose() {\n var entry = this;\n forgetChildren(entry).forEach(maybeReportOrphan);\n unsubscribe(entry);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n entry.parents.forEach(function (parent) {\n parent.setDirty();\n forgetChild(parent, entry);\n });\n\n // Since this entry has no parents and no children anymore, and the\n // caller of Entry#dispose has indicated that entry.value no longer\n // matters, we can safely recycle this Entry object for later use.\n release(entry);\n};\n\nfunction setClean(entry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(entry) {\n entry.parents.forEach(function (parent) {\n reportDirtyChild(parent, entry);\n });\n}\n\nfunction reportClean(entry) {\n entry.parents.forEach(function (parent) {\n reportCleanChild(parent, entry);\n });\n}\n\nfunction mightBeDirty(entry) {\n return entry.dirty ||\n (entry.dirtyChildren &&\n entry.dirtyChildren.size);\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (entry.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n entry.dirtyChildren.add(child);\n reportDirty(entry);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(entry, child) {\n var cv = entry.childValues;\n\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(cv.has(child));\n assert(! mightBeDirty(child));\n\n var childValue = cv.get(child);\n if (childValue === UNKNOWN_VALUE) {\n cv.set(child, child.value);\n } else if (childValue !== child.value) {\n entry.setDirty();\n }\n\n removeDirtyChild(entry, child);\n\n if (mightBeDirty(entry)) {\n return;\n }\n\n reportClean(entry);\n}\n\nfunction removeDirtyChild(entry, child) {\n var dc = entry.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < exports.POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n entry.dirtyChildren = null;\n }\n }\n}\n\nfunction rememberParent(entry) {\n var local = getLocal();\n var parent = local.currentParentEntry;\n if (parent) {\n entry.parents.add(parent);\n\n if (! parent.childValues.has(entry)) {\n parent.childValues.set(entry, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(entry)) {\n reportDirtyChild(parent, entry);\n } else {\n reportCleanChild(parent, entry);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren.forEach(function (child) {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n var originalChildren = forgetChildren(entry);\n\n var local = getLocal();\n var parent = local.currentParentEntry;\n local.currentParentEntry = entry;\n\n var threw = true;\n try {\n entry.value = entry.fn.apply(null, entry.args);\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n assert(local.currentParentEntry === entry);\n local.currentParentEntry = parent;\n\n if (threw || ! subscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nvar reusableEmptyArray = [];\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(entry) {\n var children = reusableEmptyArray;\n\n if (entry.childValues.size > 0) {\n children = [];\n entry.childValues.forEach(function (value, child) {\n forgetChild(entry, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefor must have been reset to null.\n assert(entry.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(entry, child) {\n child.parents.delete(entry);\n entry.childValues.delete(child);\n removeDirtyChild(entry, child);\n}\n\nfunction subscribe(entry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n unsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction unsubscribe(entry) {\n var unsub = entry.unsubscribe;\n if (typeof unsub === \"function\") {\n entry.unsubscribe = null;\n unsub();\n }\n}\n","\"use strict\";\n\nvar Cache = require(\"./cache.js\").Cache;\nvar tuple = require(\"immutable-tuple\").tuple;\nvar Entry = require(\"./entry.js\").Entry;\nvar getLocal = require(\"./local.js\").get;\n\n// Exported so that custom makeCacheKey functions can easily reuse the\n// default implementation (with different arguments).\nexports.defaultMakeCacheKey = tuple;\n\nfunction normalizeOptions(options) {\n options = options || Object.create(null);\n\n if (typeof options.makeCacheKey !== \"function\") {\n options.makeCacheKey = tuple;\n }\n\n if (typeof options.max !== \"number\") {\n options.max = Math.pow(2, 16);\n }\n\n return options;\n}\n\nfunction wrap(fn, options) {\n options = normalizeOptions(options);\n\n // If this wrapped function is disposable, then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n var disposable = !! options.disposable;\n\n var cache = new Cache({\n max: options.max,\n dispose: function (key, entry) {\n entry.dispose();\n }\n });\n\n function reportOrphan(entry) {\n if (disposable) {\n // Triggers the entry.dispose() call above.\n cache.delete(entry.key);\n return true;\n }\n }\n\n function optimistic() {\n if (disposable && ! getLocal().currentParentEntry) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return;\n }\n\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return fn.apply(null, arguments);\n }\n\n var args = [], len = arguments.length;\n while (len--) args[len] = arguments[len];\n\n var entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n cache.set(key, entry = Entry.acquire(fn, key, args));\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = reportOrphan;\n }\n }\n\n var value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if this entry\n // has no parents, which means we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (entry.parents.size === 0) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n if (! disposable) {\n return value;\n }\n }\n\n optimistic.dirty = function () {\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return;\n }\n\n if (! cache.has(key)) {\n return;\n }\n\n cache.get(key).setDirty();\n };\n\n return optimistic;\n}\n\nexports.wrap = wrap;\n","// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n invariant(\n obj.__typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","export class CacheKeyNode {\n private children: Map> | null = null;\n private key: KeyType | null = null;\n\n lookup(...args: any[]): KeyType {\n return this.lookupArray(args);\n }\n\n lookupArray(array: any[]): KeyType {\n let node: CacheKeyNode = this;\n array.forEach(value => {\n node = node.getOrCreate(value);\n });\n return node.key || (node.key = Object.create(null));\n }\n\n getOrCreate(value: any): CacheKeyNode {\n const map = this.children || (this.children = new Map());\n let node = map.get(value);\n if (!node) {\n map.set(value, (node = new CacheKeyNode()));\n }\n return node;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<(dataId: string) => StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n assign,\n getDefaultValues,\n getQueryDefinition,\n isEqual,\n DirectiveInfo,\n FragmentMap,\n IdValue,\n StoreValue,\n argumentsObjectFromField,\n createFragmentMap,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getStoreKeyName,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n resultKeyNameFromField,\n shouldInclude,\n toIdValue,\n mergeDeepArray,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap } from 'optimism';\nimport { CacheKeyNode } from './cacheKeys';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\nexport class StoreReader {\n constructor(\n private cacheKeyRoot = new CacheKeyNode,\n ) {\n const reader = this;\n const {\n executeStoreQuery,\n executeSelectionSet,\n } = reader;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n query,\n contextValue.store,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n selectionSet,\n execContext.contextValue.store,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray(\n field,\n readStoreResult.result,\n execContext,\n ),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n result = result.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray(field, item, execContext));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n return { result, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const idValue = toIdValue({ id: 'self', typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ self: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { CacheKeyNode } from './cacheKeys';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new CacheKeyNode();\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeReader = new StoreReader(this.cacheKeyRoot);\n this.storeWriter = new StoreWriter();\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n","import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = Error & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new Error(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch is nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n","import Model from \"../orm/model\";\n\nexport enum ConnectionMode {\n AUTO,\n PLAIN,\n NODES,\n EDGES\n}\n\nexport enum ArgumentMode {\n TYPE,\n LIST\n}\n\nexport default interface Adapter {\n getRootQueryName(): string;\n getRootMutationName(): string;\n\n getNameForPersist(model: Model): string;\n getNameForPush(model: Model): string;\n getNameForDestroy(model: Model): string;\n getNameForFetch(model: Model, plural: boolean): string;\n\n getConnectionMode(): ConnectionMode;\n\n getArgumentMode(): ArgumentMode;\n\n getFilterTypeName(model: Model): string;\n getInputTypeName(model: Model, action?: string): string;\n\n prepareSchemaTypeName(name: string): string;\n}\n","import { Data, Field } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport Context from \"../common/context\";\nimport {\n clone,\n downcaseFirstLetter,\n isPlainObject,\n pluralize,\n singularize\n} from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\n\n/**\n * This class provides methods to transform incoming data from GraphQL in to a format Vuex-ORM understands and\n * vice versa.\n */\nexport default class Transformer {\n /**\n * Transforms outgoing data. Use for variables param.\n *\n * @param {Model} model Base model of the mutation/query\n * @param {Data} data Data to transform\n * @param {boolean} read Tells if this is a write or a read action. read is fetch, write is push and persist.\n * @param {Array} whitelist of fields\n * @param {Map>} outgoingRecords List of record IDs that are already added to the\n * outgoing data in order to detect recursion.\n * @param {boolean} recursiveCall Tells if it's a recursive call.\n * @returns {Data}\n */\n public static transformOutgoingData(\n model: Model,\n data: Data,\n read: boolean,\n whitelist?: Array,\n outgoingRecords?: Map>,\n recursiveCall?: boolean\n ): Data {\n const context = Context.getInstance();\n const relations: Map = model.getRelations();\n const returnValue: Data = {} as Data;\n if (outgoingRecords === undefined) outgoingRecords = new Map>();\n if (recursiveCall === undefined) recursiveCall = false;\n\n Object.keys(data).forEach(key => {\n const value = data[key];\n\n const isRelation = model.getRelations().has(key);\n let isRecursion = false;\n\n if (value instanceof Array) {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value[0]);\n } else {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value);\n }\n\n // shouldIncludeOutgoingField and the read param is tricky. In the initial call of this method\n // we want to include any relation, so we have to make sure it's false. In the recursive calls\n // it should be true when we transform the outgoing data for fetch (and false for the others)\n if (\n !isRecursion &&\n this.shouldIncludeOutgoingField(\n (recursiveCall as boolean) && read,\n key,\n value,\n model,\n whitelist\n )\n ) {\n let relatedModel = Model.getRelatedModel(relations.get(key)!);\n\n if (value instanceof Array) {\n // Either this is a hasMany field or a .attr() field which contains an array.\n const arrayModel = context.getModel(singularize(key), true);\n\n if (arrayModel) {\n this.addRecordForRecursionDetection(outgoingRecords!, value[0]);\n returnValue[key] = value.map(v => {\n return this.transformOutgoingData(\n arrayModel || model,\n v,\n read,\n undefined,\n outgoingRecords,\n true\n );\n });\n } else {\n // Simple field, not a relation\n returnValue[key] = value;\n }\n } else if (typeof value === \"object\" && value.$id !== undefined) {\n if (!relatedModel) {\n relatedModel = context.getModel((value as ORMModel).$self().entity);\n }\n\n this.addRecordForRecursionDetection(outgoingRecords!, value);\n\n // Value is a record, transform that too\n returnValue[key] = this.transformOutgoingData(\n relatedModel,\n value,\n read,\n undefined,\n outgoingRecords,\n true\n );\n } else {\n // In any other case just let the value be what ever it is\n returnValue[key] = value;\n }\n }\n });\n\n return returnValue;\n }\n\n /**\n * Transforms a set of incoming data to the format vuex-orm requires.\n *\n * @param {Data | Array} data\n * @param model\n * @param mutation required to transform something like `disableUserAddress` to the actual model name.\n * @param {boolean} recursiveCall\n * @returns {Data}\n */\n public static transformIncomingData(\n data: Data | Array,\n model: Model,\n mutation: boolean = false,\n recursiveCall: boolean = false\n ): Data {\n let result: Data | Array = {} as Data;\n const context = Context.getInstance();\n\n if (!recursiveCall) {\n context.logger.group(\"Transforming incoming data\");\n context.logger.log(\"Raw data:\", data);\n }\n\n if (Array.isArray(data)) {\n result = data.map((d: any) => this.transformIncomingData(d, model, mutation, true));\n } else {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined && data[key] !== null && key in data) {\n if (isPlainObject(data[key])) {\n const localModel: Model = context.getModel(key, true) || model;\n\n if (data[key].nodes && context.connectionMode === ConnectionMode.NODES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].nodes,\n localModel,\n mutation,\n true\n );\n } else if (data[key].edges && context.connectionMode === ConnectionMode.EDGES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].edges,\n localModel,\n mutation,\n true\n );\n } else if (data[\"node\"] && context.connectionMode === ConnectionMode.EDGES) {\n result = this.transformIncomingData(data[\"node\"], localModel, mutation, true);\n } else {\n let newKey = key;\n\n if (mutation && !recursiveCall) {\n newKey = data[key].nodes ? localModel.pluralName : localModel.singularName;\n newKey = downcaseFirstLetter(newKey);\n }\n\n result[newKey] = this.transformIncomingData(data[key], localModel, mutation, true);\n }\n } else if (Model.isFieldNumber(model.fields.get(key))) {\n result[key] = parseFloat(data[key]);\n } else if (key.endsWith(\"Type\") && model.isTypeFieldOfPolymorphicRelation(key)) {\n result[key] = pluralize(downcaseFirstLetter(data[key]));\n } else {\n result[key] = data[key];\n }\n }\n });\n }\n\n if (!recursiveCall) {\n context.logger.log(\"Transformed data:\", result);\n context.logger.groupEnd();\n } else {\n result[\"$isPersisted\"] = true;\n }\n\n // Make sure this is really a plain JS object. We had some issues in testing here.\n return clone(result);\n }\n\n /**\n * Tells if a field should be included in the outgoing data.\n * @param {boolean} forFilter Tells whether a filter is constructed or not.\n * @param {string} fieldName Name of the field to check.\n * @param {any} value Value of the field.\n * @param {Model} model Model class which contains the field.\n * @param {Array|undefined} whitelist Contains a list of fields which should always be included.\n * @returns {boolean}\n */\n public static shouldIncludeOutgoingField(\n forFilter: boolean,\n fieldName: string,\n value: any,\n model: Model,\n whitelist?: Array\n ): boolean {\n // Always add fields on the whitelist.\n if (whitelist && whitelist.includes(fieldName)) return true;\n\n // Ignore internal fields\n if (fieldName.startsWith(\"$\")) return false;\n\n // Ignore empty fields\n if (value === null || value === undefined) return false;\n\n // Include all eager save connections\n if (model.getRelations().has(fieldName)) {\n // We never add relations to filters.\n if (forFilter) return false;\n\n const relation: Relation = model.getRelations().get(fieldName)!;\n const related: Model | null = Model.getRelatedModel(relation);\n if (related && model.shouldEagerSaveRelation(fieldName, relation, related)) return true;\n\n // All other relations are skipped\n return false;\n }\n\n // Everything else is ok\n return true;\n }\n\n /**\n * Registers a record for recursion detection.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to register.\n */\n private static addRecordForRecursionDetection(\n records: Map>,\n record: ORMModel\n ): void {\n const context: Context = Context.getInstance();\n\n if (!record) {\n context.logger.warn(\"Trying to add invalid record\", record, \"to recursion detection\");\n return;\n }\n\n if (!record.$self) {\n context.logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return;\n }\n\n const model: Model = context.getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n ids.push(record.$id!);\n records.set(model.singularName, ids);\n }\n\n /**\n * Detects recursions.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to check.\n * @return {boolean} true when the record is already included in the records.\n */\n private static isRecursion(records: Map>, record: ORMModel): boolean {\n if (!record) return false;\n\n if (!record.$self) {\n Context.getInstance().logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return false;\n }\n\n const model: Model = Context.getInstance().getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n return ids.includes(record.$id!);\n }\n}\n","var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\n\nmodule.exports = gql;\n","import { ApolloClient, FetchPolicy } from \"apollo-client\";\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\nimport { HttpLink } from \"apollo-link-http\";\nimport { ApolloLink } from \"apollo-link\";\nimport Context from \"../common/context\";\nimport { Arguments, Data } from \"../support/interfaces\";\nimport Transformer from \"./transformer\";\nimport Model from \"../orm/model\";\nimport gql from \"graphql-tag\";\n\n/**\n * This class takes care of the communication with the graphql endpoint by leveraging the awesome apollo-client lib.\n */\nexport default class Apollo {\n /**\n * The http link instance to use.\n * @type {HttpLink}\n */\n private readonly httpLink: ApolloLink;\n\n /**\n * The ApolloClient instance\n * @type {ApolloClient}\n */\n private readonly apolloClient: ApolloClient;\n\n /**\n * @constructor\n */\n public constructor() {\n const context = Context.getInstance();\n\n // This allows the test suite to pass a custom link\n if (!context.options.apolloClient && context.options.link) {\n this.httpLink = context.options.link;\n } else {\n /* istanbul ignore next */\n this.httpLink = new HttpLink({\n uri: context.options.url ? context.options.url : \"/graphql\",\n credentials: context.options.credentials ? context.options.credentials : \"same-origin\",\n useGETForQueries: Boolean(context.options.useGETForQueries)\n });\n }\n\n if (context.options.apolloClient) {\n this.apolloClient = (context => {\n return context.options.apolloClient;\n })(context);\n } else {\n this.apolloClient = new ApolloClient({\n link: this.httpLink,\n cache: new InMemoryCache(),\n connectToDevTools: context.debugMode\n });\n }\n }\n\n /**\n * Sends a request to the GraphQL API via apollo\n * @param model\n * @param {any} query The query to send (result from gql())\n * @param {Arguments} variables Optional. The variables to send with the query\n * @param {boolean} mutation Optional. If this is a mutation (true) or a query (false, default)\n * @param {boolean} bypassCache If true the query will be send to the server without using the cache. For queries only\n * @returns {Promise} The new records\n */\n public async request(\n model: Model,\n query: any,\n variables?: Arguments,\n mutation: boolean = false,\n bypassCache: boolean = false\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n Context.getInstance().logger.logQuery(query, variables, fetchPolicy);\n\n const context = { headers: Apollo.getHeaders() };\n\n let response;\n if (mutation) {\n response = await this.apolloClient.mutate({ mutation: query, variables, context });\n } else {\n response = await this.apolloClient.query({ query, variables, fetchPolicy, context });\n }\n\n // Transform incoming data into something useful\n return Transformer.transformIncomingData(response.data as Data, model, mutation);\n }\n\n public async simpleQuery(\n query: string,\n variables: Arguments,\n bypassCache: boolean = false,\n context?: Data\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n return this.apolloClient.query({\n query: gql(query),\n variables,\n fetchPolicy,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n public async simpleMutation(query: string, variables: Arguments, context?: Data): Promise {\n return this.apolloClient.mutate({\n mutation: gql(query),\n variables,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n private static getHeaders() {\n const context = Context.getInstance();\n\n let headers: any = context.options.headers ? context.options.headers : {};\n\n if (typeof headers === \"function\") {\n headers = headers(context);\n }\n\n return headers;\n }\n}\n","import {\n GraphQLField,\n GraphQLSchema,\n GraphQLType,\n GraphQLTypeDefinition\n} from \"../support/interfaces\";\nimport { upcaseFirstLetter } from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\nimport Context from \"../common/context\";\n\nexport default class Schema {\n private schema: GraphQLSchema;\n private types: Map;\n private mutations: Map;\n private queries: Map;\n\n public constructor(schema: GraphQLSchema) {\n const context = Context.getInstance();\n\n this.schema = schema;\n this.types = new Map();\n this.mutations = new Map();\n this.queries = new Map();\n\n this.schema.types.forEach((t: GraphQLType) => this.types.set(t.name, t));\n\n this.getType(context.adapter.getRootQueryName())!.fields!.forEach(f =>\n this.queries.set(f.name, f)\n );\n this.getType(context.adapter.getRootMutationName())!.fields!.forEach(f =>\n this.mutations.set(f.name, f)\n );\n }\n\n public determineQueryMode(): ConnectionMode {\n let connection: GraphQLType | null = null;\n\n this.queries.forEach(query => {\n const typeName = Schema.getTypeNameOfField(query);\n if (typeName.endsWith(\"TypeConnection\")) {\n connection = this.getType(typeName);\n return false; // break\n }\n return true;\n });\n\n /* istanbul ignore next */\n if (!connection) {\n throw new Error(\n \"Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!\"\n );\n }\n\n if (connection!.fields!.find(f => f.name === \"nodes\")) {\n return ConnectionMode.NODES;\n } else if (connection!.fields!.find(f => f.name === \"edges\")) {\n return ConnectionMode.EDGES;\n } else {\n return ConnectionMode.PLAIN;\n }\n }\n\n public getType(name: string, allowNull: boolean = false): GraphQLType | null {\n name = Context.getInstance().adapter.prepareSchemaTypeName(name);\n const type = this.types.get(name);\n\n if (!allowNull && !type) {\n throw new Error(`Couldn't find Type of name ${name} in the GraphQL Schema.`);\n }\n\n return type || null;\n }\n\n public getMutation(name: string, allowNull: boolean = false): GraphQLField | null {\n const mutation = this.mutations.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !mutation) {\n throw new Error(`Couldn't find Mutation of name ${name} in the GraphQL Schema.`);\n }\n\n return mutation || null;\n }\n\n public getQuery(name: string, allowNull: boolean = false): GraphQLField | null {\n const query = this.queries.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !query) {\n throw new Error(`Couldn't find Query of name ${name} in the GraphQL Schema.`);\n }\n\n return query || null;\n }\n\n static returnsConnection(field: GraphQLField): boolean {\n return Schema.getTypeNameOfField(field).endsWith(\"TypeConnection\");\n }\n\n static getRealType(type: GraphQLTypeDefinition): GraphQLTypeDefinition {\n if (type.kind === \"NON_NULL\") {\n return this.getRealType(type.ofType);\n } else {\n return type;\n }\n }\n\n static getTypeNameOfField(field: GraphQLField): string {\n let type = this.getRealType(field.type);\n\n if (type.kind === \"LIST\") {\n while (!type.name) type = type.ofType;\n return `[${type.name}]`;\n } else {\n while (!type.name) type = type.ofType;\n\n /* istanbul ignore next */\n if (!type.name) throw new Error(`Can't find type name for field ${field.name}`);\n\n return type.name;\n }\n }\n}\n","import Adapter, { ConnectionMode, ArgumentMode } from \"../adapter\";\nimport Model from \"../../orm/model\";\nimport { upcaseFirstLetter } from \"../../support/utils\";\n\nexport default class DefaultAdapter implements Adapter {\n getRootMutationName(): string {\n return \"Mutation\";\n }\n\n getRootQueryName(): string {\n return \"Query\";\n }\n\n getConnectionMode(): ConnectionMode {\n return ConnectionMode.NODES;\n }\n\n getArgumentMode(): ArgumentMode {\n return ArgumentMode.TYPE;\n }\n\n getFilterTypeName(model: Model): string {\n return `${upcaseFirstLetter(model.singularName)}Filter`;\n }\n\n getInputTypeName(model: Model, action?: string): string {\n return `${upcaseFirstLetter(model.singularName)}Input`;\n }\n\n getNameForDestroy(model: Model): string {\n return `delete${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForFetch(model: Model, plural: boolean): string {\n return plural ? model.pluralName : model.singularName;\n }\n\n getNameForPersist(model: Model): string {\n return `create${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForPush(model: Model): string {\n return `update${upcaseFirstLetter(model.singularName)}`;\n }\n\n prepareSchemaTypeName(name: string): string {\n return upcaseFirstLetter(name);\n }\n}\n","export default `\nquery Introspection {\n __schema {\n types {\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n inputFields {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n`;\n","import Logger from \"./logger\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel } from \"@vuex-orm/core\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { downcaseFirstLetter, isEqual, pick, singularize } from \"../support/utils\";\nimport Apollo from \"../graphql/apollo\";\nimport Database from \"@vuex-orm/core/lib/database/Database\";\nimport { Data, Field, GraphQLType, Options } from \"../support/interfaces\";\nimport Schema from \"../graphql/schema\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport Adapter, { ConnectionMode } from \"../adapters/adapter\";\nimport DefaultAdapter from \"../adapters/builtin/default-adapter\";\nimport introspectionQuery from \"../graphql/introspection-query\";\n\n/**\n * Internal context of the plugin. This class contains all information, the models, database, logger and so on.\n *\n * It's a singleton class, so just call Context.getInstance() anywhere you need the context.\n */\nexport default class Context {\n /**\n * Contains the instance for the singleton pattern.\n * @type {Context}\n */\n public static instance: Context;\n\n /**\n * Components collection of Vuex-ORM\n * @type {Components}\n */\n public readonly components: Components;\n\n /**\n * The options which have been passed to VuexOrm.install\n * @type {Options}\n */\n public readonly options: Options;\n\n /**\n * GraphQL Adapter.\n * @type {Adapter}\n */\n public readonly adapter: Adapter;\n\n /**\n * The Vuex-ORM database\n * @type {Database}\n */\n public readonly database: Database;\n\n /**\n * Collection of all Vuex-ORM models wrapped in a Model instance.\n * @type {Map}\n */\n public readonly models: Map = new Map();\n\n /**\n * When true, the logging is enabled.\n * @type {boolean}\n */\n public readonly debugMode: boolean = false;\n\n /**\n * Our nice Vuex-ORM-GraphQL logger\n * @type {Logger}\n */\n public readonly logger: Logger;\n\n /**\n * Instance of Apollo which cares about the communication with the graphql endpoint.\n * @type {Apollo}\n */\n public apollo!: Apollo;\n\n /**\n * The graphql schema. Is null until the first request.\n * @type {Schema}\n */\n public schema: Schema | undefined;\n\n /**\n * Tells if the schema is already loaded or the loading is currently processed.\n * @type {boolean}\n */\n private schemaWillBeLoaded: Promise | undefined;\n\n /**\n * Defines how to query connections. 'auto' | 'nodes' | 'edges' | 'plain'\n */\n public connectionMode: ConnectionMode = ConnectionMode.AUTO;\n\n /**\n * Container for the global mocks.\n * @type {Object}\n */\n private globalMocks: { [key: string]: Array } = {};\n\n /**\n * Private constructor, called by the setup method\n *\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n private constructor(components: Components, options: Options) {\n this.components = components;\n this.options = options;\n\n this.database = options.database;\n this.debugMode = Boolean(options.debug);\n this.logger = new Logger(this.debugMode);\n this.adapter = options.adapter || new DefaultAdapter();\n\n /* istanbul ignore next */\n if (!options.database) {\n throw new Error(\"database param is required to initialize vuex-orm-graphql!\");\n }\n }\n\n /**\n * Get the singleton instance of the context.\n * @returns {Context}\n */\n public static getInstance(): Context {\n return this.instance;\n }\n\n /**\n * This is called only once and creates a new instance of the Context.\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {Context}\n */\n public static setup(components: Components, options: Options): Context {\n this.instance = new Context(components, options);\n\n this.instance.apollo = new Apollo();\n this.instance.collectModels();\n\n this.instance.logger.group(\"Context setup\");\n this.instance.logger.log(\"components\", this.instance.components);\n this.instance.logger.log(\"options\", this.instance.options);\n this.instance.logger.log(\"database\", this.instance.database);\n this.instance.logger.log(\"models\", this.instance.models);\n this.instance.logger.groupEnd();\n\n return this.instance;\n }\n\n public async loadSchema(): Promise {\n if (!this.schemaWillBeLoaded) {\n this.schemaWillBeLoaded = new Promise(async (resolve, reject) => {\n this.logger.log(\"Fetching GraphQL Schema initially ...\");\n\n this.connectionMode = this.adapter.getConnectionMode();\n\n // We send a custom header along with the request. This is required for our test suite to mock the schema request.\n const context = {\n headers: { \"X-GraphQL-Introspection-Query\": \"true\" }\n };\n\n const result = await this.apollo.simpleQuery(\n introspectionQuery,\n {},\n true,\n (context as unknown) as Data\n );\n\n this.schema = new Schema(result.data.__schema);\n\n this.logger.log(\"GraphQL Schema successful fetched\", result);\n\n this.logger.log(\"Starting to process the schema ...\");\n this.processSchema();\n this.logger.log(\"Schema procession done!\");\n\n resolve(this.schema);\n });\n }\n\n return this.schemaWillBeLoaded;\n }\n\n public processSchema() {\n this.models.forEach((model: Model) => {\n let type: GraphQLType;\n\n try {\n type = this.schema!.getType(model.singularName)!;\n } catch (error) {\n this.logger.warn(`Ignoring entity ${model.singularName} because it's not in the schema.`);\n return;\n }\n\n model.fields.forEach((field: Field, fieldName: string) => {\n if (!type.fields!.find(f => f.name === fieldName)) {\n this.logger.warn(\n `Ignoring field ${model.singularName}.${fieldName} because it's not in the schema.`\n );\n\n // TODO: Move skipFields to the model\n model.baseModel.skipFields = model.baseModel.skipFields ? model.baseModel.skipFields : [];\n if (!model.baseModel.skipFields.includes(fieldName)) {\n model.baseModel.skipFields.push(fieldName);\n }\n }\n });\n });\n\n if (this.connectionMode === ConnectionMode.AUTO) {\n this.connectionMode = this.schema!.determineQueryMode();\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by automatic detection`);\n } else {\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by config`);\n }\n }\n\n /**\n * Returns a model from the model collection by it's name\n *\n * @param {Model|string} model A Model instance, a singular or plural name of the model\n * @param {boolean} allowNull When true this method returns null instead of throwing an exception when no model was\n * found. Default is false\n * @returns {Model}\n */\n public getModel(model: Model | string, allowNull: boolean = false): Model {\n if (typeof model === \"string\") {\n const name: string = singularize(downcaseFirstLetter(model));\n model = this.models.get(name) as Model;\n if (!allowNull && !model) throw new Error(`No such model ${name}!`);\n }\n\n return model;\n }\n\n /**\n * Will add a mock for simple mutations or queries. These are model unrelated and have to be\n * handled globally.\n *\n * @param {Mock} mock - Mock config.\n */\n public addGlobalMock(mock: Mock): boolean {\n if (this.findGlobalMock(mock.action, mock.options)) return false;\n if (!this.globalMocks[mock.action]) this.globalMocks[mock.action] = [];\n\n this.globalMocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a global mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions like { name: 'example' }.\n * @returns {Mock | null} null when no mock was found.\n */\n public findGlobalMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.globalMocks[action]) {\n return (\n this.globalMocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by simpleMutation and simpleQuery actions in order to get the global mock\n * returnValue.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public globalMockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.findGlobalMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Wraps all Vuex-ORM entities in a Model object and saves them into this.models\n */\n private collectModels() {\n this.database.entities.forEach((entity: any) => {\n const model: Model = new Model(entity.model as typeof ORMModel);\n this.models.set(model.singularName, model);\n Model.augment(model);\n });\n }\n}\n","import { Relation } from \"@vuex-orm/core\";\nimport Model from \"../orm/model\";\nimport { Arguments, Field, GraphQLField, GraphQLType } from \"../support/interfaces\";\nimport { clone, isPlainObject, takeWhile, upcaseFirstLetter } from \"../support/utils\";\nimport gql from \"graphql-tag\";\nimport Context from \"../common/context\";\nimport Schema from \"./schema\";\nimport { ConnectionMode, ArgumentMode } from \"../adapters/adapter\";\n\n/**\n * Contains all logic to build GraphQL queries/mutations.\n */\nexport default class QueryBuilder {\n /**\n * Builds a field for the GraphQL query and a specific model\n *\n * @param {Model|string} model The model to use\n * @param {boolean} multiple Determines whether plural/nodes syntax or singular syntax is used.\n * @param {Arguments} args The args that will be passed to the query field ( user(role: $role) )\n * @param {Array} path The relations in this list are ignored (while traversing relations).\n * Mainly for recursion\n * @param {string} name Optional name of the field. If not provided, this will be the model name\n * @param filter\n * @param {boolean} allowIdFields Optional. Determines if id fields will be ignored for the argument generation.\n * See buildArguments\n * @returns {string}\n *\n * @todo Do we need the allowIdFields param?\n */\n public static buildField(\n model: Model | string,\n multiple: boolean = true,\n args?: Arguments,\n path: Array = [],\n name?: string,\n filter: boolean = false,\n allowIdFields: boolean = false\n ): string {\n const context = Context.getInstance();\n model = context.getModel(model);\n\n name = name ? name : model.pluralName;\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n let params: string = this.buildArguments(model, args, false, filter, allowIdFields, field);\n path = path.length === 0 ? [model.singularName] : path;\n\n const fields = `\n ${model.getQueryFields().join(\" \")}\n ${this.buildRelationsQuery(model, path)}\n `;\n\n if (multiple) {\n const header: string = `${name}${params}`;\n\n if (context.connectionMode === ConnectionMode.NODES) {\n return `\n ${header} {\n nodes {\n ${fields}\n }\n }\n `;\n } else if (context.connectionMode === ConnectionMode.EDGES) {\n return `\n ${header} {\n edges {\n node {\n ${fields}\n }\n }\n }\n `;\n } else {\n return `\n ${header} {\n ${fields}\n }\n `;\n }\n } else {\n return `\n ${name ? name : model.singularName}${params} {\n ${fields}\n }\n `;\n }\n }\n\n /**\n * Generates a query.\n * Currently only one root field for the query is possible.\n * @param {string} type 'mutation' or 'query'\n * @param {Model | string} model The model this query or mutation affects. This mainly determines the query fields.\n * @param {string} name Optional name of the query/mutation. Will overwrite the name from the model.\n * @param {Arguments} args Arguments for the query\n * @param {boolean} multiple Determines if the root query field is a connection or not (will be passed to buildField)\n * @param {boolean} filter When true the query arguments are passed via a filter object.\n * @returns {any} Whatever gql() returns\n */\n public static buildQuery(\n type: string,\n model: Model | string,\n name?: string,\n args?: Arguments,\n multiple?: boolean,\n filter?: boolean\n ) {\n const context = Context.getInstance();\n\n // model\n model = context.getModel(model);\n\n // arguments\n args = this.prepareArguments(args);\n\n // multiple\n multiple = multiple === undefined ? !args[\"id\"] : multiple;\n\n // name\n if (!name) name = multiple ? model.pluralName : model.singularName;\n\n // field\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n // build query\n const query: string =\n `${type} ${upcaseFirstLetter(name)}${this.buildArguments(\n model,\n args,\n true,\n filter,\n true,\n field\n )} {\\n` +\n ` ${this.buildField(model, multiple, args, [], name, filter, true)}\\n` +\n `}`;\n\n return gql(query);\n }\n\n /**\n * Generates the arguments string for a graphql query based on a given map.\n *\n * There are three types of arguments:\n *\n * 1) Signatures with primitive types (signature = true)\n * => 'mutation createUser($name: String!)'\n *\n * 2) Signatures with object types (signature = true, args = { user: { __type: 'User' }})\n * => 'mutation createUser($user: UserInput!)'\n *\n * 3) Fields with variables (signature = false)\n * => 'user(id: $id)'\n *\n * 4) Filter fields with variables (signature = false, filter = true)\n * => 'users(filter: { active: $active })'\n *\n * @param model\n * @param {Arguments | undefined} args\n * @param {boolean} signature When true, then this method generates a query signature instead of key/value pairs\n * @param filter\n * @param {boolean} allowIdFields If true, ID fields will be included in the arguments list\n * @param {GraphQLField} field Optional. The GraphQL mutation or query field\n * @returns {String}\n */\n public static buildArguments(\n model: Model,\n args?: Arguments,\n signature: boolean = false,\n filter: boolean = false,\n allowIdFields: boolean = true,\n field: GraphQLField | null = null\n ): string {\n const context = Context.getInstance();\n if (args === undefined) return \"\";\n\n let returnValue: string = \"\";\n let first: boolean = true;\n\n if (args) {\n Object.keys(args).forEach((key: string) => {\n let value: any = args[key];\n\n const isForeignKey = model.skipField(key);\n const skipFieldDueId = (key === \"id\" || isForeignKey) && !allowIdFields;\n\n let schemaField: GraphQLField | undefined = this.findSchemaFieldForArgument(\n key,\n field,\n model,\n filter\n );\n\n const isConnectionField =\n schemaField && Schema.getTypeNameOfField(schemaField).endsWith(\"TypeConnection\");\n\n // Ignore null fields, ids and connections\n if (value && !skipFieldDueId && !isConnectionField) {\n let typeOrValue: any = \"\";\n\n if (signature) {\n if (isPlainObject(value) && value.__type) {\n // Case 2 (User!)\n typeOrValue = context.adapter.getInputTypeName(context.getModel(value.__type)) + \"!\";\n } else if (value instanceof Array && field) {\n const arg = QueryBuilder.findSchemaFieldForArgument(key, field, model, filter);\n\n /* istanbul ignore next */\n if (!arg) {\n throw new Error(\n `The argument ${key} is of type array but it's not possible to determine the type, because it's not in the field ${\n field.name\n }`\n );\n }\n\n typeOrValue = Schema.getTypeNameOfField(arg) + \"!\";\n } else if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n // Case 1, 3 and 4\n typeOrValue = Schema.getTypeNameOfField(schemaField) + \"!\";\n } else if (key === \"id\" || isForeignKey) {\n // Case 1 (ID!)\n typeOrValue = \"ID!\";\n } else {\n // Case 1 (String!)\n typeOrValue = this.determineAttributeType(model, key, value, field || undefined);\n typeOrValue = typeOrValue + \"!\";\n }\n } else {\n // Case 3 or 4\n typeOrValue = `$${key}`;\n }\n\n returnValue = `${returnValue}${first ? \"\" : \", \"}${(signature ? \"$\" : \"\") +\n key}: ${typeOrValue}`;\n\n first = false;\n }\n });\n\n if (!first) {\n if (!signature && filter) returnValue = `filter: { ${returnValue} }`;\n returnValue = `(${returnValue})`;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Determines the GraphQL primitive type of a field in the variables hash by the field type or (when\n * the field type is generic attribute) by the variable type.\n * @param {Model} model\n * @param {string} key\n * @param {string} value\n * @param {GraphQLField} query Pass when we have to detect the type of an argument\n * @returns {string}\n */\n public static determineAttributeType(\n model: Model,\n key: string,\n value: any,\n query?: GraphQLField\n ): string {\n const context: Context = Context.getInstance();\n const field: undefined | Field = model.fields.get(key);\n let schemaField: undefined | GraphQLField;\n\n if (query) {\n schemaField = query.args.find(f => f.name === key);\n\n if (!schemaField) {\n const filterField = query.args.find(f => f.name === \"filter\");\n\n if (filterField) {\n schemaField = this.findSchemaFieldForArgument(key, null, model, true);\n }\n }\n } else {\n schemaField = context.schema!.getType(model.singularName)!.fields!.find(f => f.name === key);\n }\n\n if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n return Schema.getTypeNameOfField(schemaField);\n } else {\n if (field instanceof context.components.String) {\n return \"String\";\n } else if (field && field instanceof context.components.Number) {\n return \"Int\";\n } else if (field && field instanceof context.components.Boolean) {\n return \"Boolean\";\n } else {\n if (typeof value === \"number\") return \"Int\";\n if (typeof value === \"string\") return \"String\";\n if (typeof value === \"boolean\") return \"Boolean\";\n\n throw new Error(\n `Can't find suitable graphql type for field '${model.singularName}.${key}'.`\n );\n }\n }\n }\n\n private static findSchemaFieldForArgument(\n name: String,\n field: GraphQLField | null,\n model: Model,\n isFilter: boolean\n ): GraphQLField | undefined {\n const context = Context.getInstance();\n const schema = context.schema!;\n let schemaField: GraphQLField | undefined;\n\n if (field) {\n schemaField = field.args.find(f => f.name === name);\n if (schemaField) return schemaField;\n }\n\n // We try to find the FilterType or at least the Type this query belongs to.\n const type: GraphQLType | null = schema.getType(\n isFilter ? context.adapter.getFilterTypeName(model) : model.singularName,\n true\n );\n\n // Next we try to find the field from the type\n schemaField = type\n ? (isFilter ? type.inputFields! : type.fields!).find(f => f.name === name)\n : undefined;\n\n // Warn before we return null\n if (!schemaField) {\n Context.getInstance().logger.warn(\n `Couldn't find the argument with name ${name} for the mutation/query ${\n field ? field.name : \"(?)\"\n }`\n );\n }\n\n return schemaField;\n }\n\n /**\n * Generates the fields for all related models.\n *\n * @param {Model} model\n * @param {Array} path\n * @returns {string}\n */\n static buildRelationsQuery(model: null | Model, path: Array = []): string {\n if (model === null) return \"\";\n\n const context = Context.getInstance();\n const relationQueries: Array = [];\n\n model.getRelations().forEach((field: Relation, name: string) => {\n let relatedModel: Model = Model.getRelatedModel(field)!;\n\n // We will ignore the field, when it's already in the path. Means: When it's already queried. However there are\n // cases where the model will have a relationship to itself. For example a nested category strucure where the\n // category model has a parent: belongsTo(Category). So we also check if the model references itself. If this is\n // the case, we allow the nesting up to 5 times.\n const referencesItSelf = takeWhile(\n path.slice(0).reverse(),\n (p: string) => p === relatedModel.singularName\n ).length;\n const ignore = referencesItSelf\n ? referencesItSelf > 5\n : path.includes(relatedModel.singularName);\n\n // console.log(`-----> Will ${ignore ? '' : 'not'} ignore ${model.singularName}.${name}, path: ${path.join('.')}`);\n\n if (model.shouldEagerLoadRelation(name, field, relatedModel) && !ignore) {\n const newPath = path.slice(0);\n newPath.push(relatedModel.singularName);\n\n relationQueries.push(\n this.buildField(\n relatedModel,\n Model.isConnection(field as Field),\n undefined,\n newPath,\n name,\n false\n )\n );\n }\n });\n\n return relationQueries.join(\"\\n\");\n }\n\n private static prepareArguments(args?: Arguments): Arguments {\n args = (args ? clone(args) : {}) as Arguments;\n\n Object.keys(args).forEach((key: string) => {\n const value = args![key];\n\n if (value && isPlainObject(value)) {\n if (Context.getInstance().adapter.getArgumentMode() === ArgumentMode.LIST) {\n Object.keys(value).forEach((k: string) => {\n args![k] = value[k];\n });\n delete args![key];\n } else {\n args![key] = { __type: upcaseFirstLetter(key) };\n }\n }\n });\n\n return args;\n }\n}\n","import { Data, DispatchFunction } from \"../support/interfaces\";\nimport Context from \"../common/context\";\n\n/**\n * Provides some helper methods to interact with the Vuex-ORM store\n */\nexport class Store {\n /**\n * Inserts incoming data into the store. Existing data will be updated.\n *\n * @param {Data} data New data to insert/update\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @return {Promise} Inserted data as hash\n */\n public static async insertData(data: Data, dispatch: DispatchFunction): Promise {\n let insertedData: Data = {} as Data;\n\n await Promise.all(\n Object.keys(data).map(async key => {\n const value = data[key];\n Context.getInstance().logger.log(\"Inserting records\", value);\n const newData = await dispatch(\"insertOrUpdate\", ({ data: value } as unknown) as Data);\n\n Object.keys(newData).forEach(dataKey => {\n if (!insertedData[dataKey]) insertedData[dataKey] = [];\n insertedData[dataKey] = insertedData[dataKey].concat(newData[dataKey]);\n });\n })\n );\n\n return insertedData;\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport { Arguments, Data, DispatchFunction } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport RootState from \"@vuex-orm/core/lib/modules/contracts/RootState\";\nimport Transformer from \"../graphql/transformer\";\nimport Schema from \"../graphql/schema\";\nimport { singularize } from \"../support/utils\";\n\n/**\n * Base class for all Vuex actions. Contains some utility and convenience methods.\n */\nexport default class Action {\n /**\n * Sends a mutation.\n *\n * @param {string} name Name of the mutation like 'createUser'\n * @param {Data | undefined} variables Variables to send with the mutation\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @param {Model} model The model this mutation affects.\n * @param {boolean} multiple Tells if we're requesting a single record or multiple.\n * @returns {Promise}\n */\n protected static async mutation(\n name: string,\n variables: Data | undefined,\n dispatch: DispatchFunction,\n model: Model\n ): Promise {\n if (variables) {\n const context: Context = Context.getInstance();\n const schema: Schema = await context.loadSchema();\n\n const multiple: boolean = Schema.returnsConnection(schema.getMutation(name)!);\n const query = QueryBuilder.buildQuery(\"mutation\", model, name, variables, multiple);\n\n // Send GraphQL Mutation\n let newData = await context.apollo.request(model, query, variables, true);\n\n // When this was not a destroy action, we get new data, which we should insert in the store\n if (name !== context.adapter.getNameForDestroy(model)) {\n newData = newData[Object.keys(newData)[0]];\n\n // IDs as String cause terrible issues, so we convert them to integers.\n newData.id = parseInt(newData.id, 10);\n\n const insertedData: Data = await Store.insertData(\n { [model.pluralName]: newData } as Data,\n dispatch\n );\n\n // Try to find the record to return\n const records = insertedData[model.pluralName];\n const newRecord = records[records.length - 1];\n if (newRecord) {\n return newRecord;\n } else {\n Context.getInstance().logger.log(\n \"Couldn't find the record of type '\",\n model.pluralName,\n \"' within\",\n insertedData,\n \". Falling back to find()\"\n );\n return model.baseModel.query().last();\n }\n }\n\n return true;\n }\n }\n\n /**\n * Convenience method to get the model from the state.\n * @param {RootState} state Vuex state\n * @returns {Model}\n */\n static getModelFromState(state: RootState): Model {\n return Context.getInstance().getModel(state.$name);\n }\n\n /**\n * Makes sure args is a hash.\n *\n * @param {Arguments|undefined} args\n * @param {any} id When not undefined, it's added to the args\n * @returns {Arguments}\n */\n static prepareArgs(args?: Arguments, id?: any): Arguments {\n args = args || {};\n if (id) args[\"id\"] = id;\n\n return args;\n }\n\n /**\n * Adds the record itself to the args and sends it through transformOutgoingData. Key is named by the singular name\n * of the model.\n *\n * @param {Arguments} args\n * @param {Model} model\n * @param {Data} data\n * @returns {Arguments}\n */\n static addRecordToArgs(args: Arguments, model: Model, data: Data): Arguments {\n args[model.singularName] = Transformer.transformOutgoingData(model, data, false);\n return args;\n }\n\n /**\n * Transforms each field of the args which contains a model.\n * @param {Arguments} args\n * @returns {Arguments}\n */\n protected static transformArgs(args: Arguments): Arguments {\n const context = Context.getInstance();\n\n Object.keys(args).forEach((key: string) => {\n const value: Data = args[key];\n\n if (value instanceof context.components.Model) {\n const model = context.getModel(singularize(value.$self().entity));\n const transformedValue = Transformer.transformOutgoingData(model, value, false);\n context.logger.log(\n \"A\",\n key,\n \"model was found within the variables and will be transformed from\",\n value,\n \"to\",\n transformedValue\n );\n args[key] = transformedValue;\n }\n });\n\n return args;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Destroy action for sending a delete mutation. Will be used for record.$destroy().\n */\nexport default class Destroy extends Action {\n /**\n * @param {State} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to delete\n * @returns {Promise} true\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForDestroy(model);\n\n const mockReturnValue = model.$mockHook(\"destroy\", { id });\n\n if (mockReturnValue) {\n await Store.insertData(mockReturnValue, dispatch!);\n return true;\n }\n\n args = this.prepareArgs(args, id);\n\n await Action.mutation(mutationName, args as Data, dispatch!, model);\n return true;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The destroy action requires the 'id' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\n\n/**\n * Fetch action for sending a query. Will be used for Model.fetch().\n */\nexport default class Fetch extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {ActionParams} params Optional params to send with the query\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n params?: ActionParams\n ): Promise {\n const context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"fetch\", {\n filter: params ? params.filter || {} : {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n await context.loadSchema();\n\n // Filter\n let filter = {};\n\n if (params && params.filter) {\n filter = Transformer.transformOutgoingData(\n model,\n params.filter as Data,\n true,\n Object.keys(params.filter)\n );\n }\n\n const bypassCache = params && params.bypassCache;\n\n // When the filter contains an id, we query in singular mode\n const multiple: boolean = !filter[\"id\"];\n const name: string = context.adapter.getNameForFetch(model, multiple);\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, multiple);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(model, query, filter, false, bypassCache as boolean);\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n }\n}\n","import { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport Schema from \"../graphql/schema\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Mutate action for sending a custom mutation. Will be used for Model.mutate() and record.$mutate().\n */\nexport default class Mutate extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {Arguments} args Arguments for the mutation. Must contain a 'mutation' field.\n * @returns {Promise} The new record if any\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { args, name }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"mutate\", {\n name,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n args = this.prepareArgs(args);\n\n // There could be anything in the args, but we have to be sure that all records are gone through\n // transformOutgoingData()\n this.transformArgs(args);\n\n // Send the mutation\n return Action.mutation(name, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The mutate action requires the mutation name ('mutation') to be set\");\n }\n }\n}\n","import Context from \"../common/context\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Model from \"../orm/model\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Persist action for sending a create mutation. Will be used for record.$persist().\n */\nexport default class Persist extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to persist\n * @returns {Promise} The saved record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPersist(model);\n const oldRecord = model.getRecordWithId(id)!;\n\n const mockReturnValue = model.$mockHook(\"persist\", {\n id,\n args: args || {}\n });\n\n if (mockReturnValue) {\n const newRecord = await Store.insertData(mockReturnValue, dispatch!);\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n return newRecord;\n }\n\n // Arguments\n args = this.prepareArgs(args);\n this.addRecordToArgs(args, model, oldRecord);\n\n // Send mutation\n const newRecord = await Action.mutation(mutationName, args as Data, dispatch!, model);\n\n // Delete the old record if necessary\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n\n return newRecord;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'id' to be set\");\n }\n }\n\n /**\n * It's very likely that the server generated different ID for this record.\n * In this case Action.mutation has inserted a new record instead of updating the existing one.\n *\n * @param {Model} model\n * @param {Data} record\n * @returns {Promise}\n */\n private static async deleteObsoleteRecord(model: Model, newRecord: Data, oldRecord: Data) {\n if (newRecord && oldRecord && newRecord.id !== oldRecord.id) {\n Context.getInstance().logger.log(\"Dropping deprecated record\", oldRecord);\n return oldRecord.$delete();\n }\n\n return null;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Push action for sending a update mutation. Will be used for record.$push().\n */\nexport default class Push extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {Arguments} data New data to save\n * @param {Arguments} args Additional arguments\n * @returns {Promise} The updated record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { data, args }: ActionParams\n ): Promise {\n if (data) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPush(model);\n\n const mockReturnValue = model.$mockHook(\"push\", {\n data,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n // Arguments\n args = this.prepareArgs(args, data.id);\n this.addRecordToArgs(args, model, data);\n\n // Send the mutation\n return Action.mutation(mutationName, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'data' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Schema from \"../graphql/schema\";\n\n/**\n * Query action for sending a custom query. Will be used for Model.customQuery() and record.$customQuery.\n */\nexport default class Query extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {object} filter Filter object (arguments)\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { name, filter, bypassCache }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"query\", {\n name,\n filter: filter || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n\n // Filter\n filter = filter ? Transformer.transformOutgoingData(model, filter as Data, true) : {};\n\n // Multiple?\n const multiple: boolean = Schema.returnsConnection(schema.getQuery(name)!);\n\n // Build query\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, false);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(\n model,\n query,\n filter,\n false,\n bypassCache as boolean\n );\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The customQuery action requires the query name ('name') to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery, removeSymbols } from \"../support/utils\";\n\n/**\n * SimpleQuery action for sending a model unrelated simple query.\n */\nexport default class SimpleQuery extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, bypassCache, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleQuery\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n\n const result = await context.apollo.simpleQuery(\n graphQlDocumentToString(parsedQuery),\n variables,\n bypassCache\n );\n\n // remove the symbols\n return removeSymbols(clone(result.data));\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleQuery action requires the 'query' to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery } from \"../support/utils\";\n\n/**\n * SimpleMutation action for sending a model unrelated simple mutation.\n */\nexport default class SimpleMutation extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleMutation\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n const result = await context.apollo.simpleMutation(\n graphQlDocumentToString(parsedQuery),\n variables\n );\n\n // remove the symbols\n return clone(result.data);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleMutation action requires the 'query' to be set\");\n }\n }\n}\n","import { PatchedModel, Options, ActionParams } from \"./support/interfaces\";\nimport Context from \"./common/context\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { Destroy, Fetch, Mutate, Persist, Push } from \"./actions\";\nimport Query from \"./actions/query\";\nimport SimpleQuery from \"./actions/simple-query\";\nimport SimpleMutation from \"./actions/simple-mutation\";\nimport { isPlainObject } from \"./support/utils\";\n\n/**\n * Main class of the plugin. Setups the internal context, Vuex actions and model methods\n */\nexport default class VuexORMGraphQL {\n /**\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n public constructor(components: Components, options: Options) {\n Context.setup(components, options);\n VuexORMGraphQL.setupActions();\n VuexORMGraphQL.setupModelMethods();\n }\n\n /**\n * Allow everything to read the context.\n */\n public getContext(): Context {\n return Context.getInstance();\n }\n\n /**\n * This method will setup following Vuex actions: fetch, persist, push, destroy, mutate\n */\n private static setupActions() {\n const context = Context.getInstance();\n\n context.components.RootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);\n context.components.RootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);\n\n context.components.Actions.fetch = Fetch.call.bind(Fetch);\n context.components.Actions.persist = Persist.call.bind(Persist);\n context.components.Actions.push = Push.call.bind(Push);\n context.components.Actions.destroy = Destroy.call.bind(Destroy);\n context.components.Actions.mutate = Mutate.call.bind(Mutate);\n context.components.Actions.query = Query.call.bind(Query);\n }\n\n /**\n * This method will setup following model methods: Model.fetch, Model.mutate, Model.customQuery, record.$mutate,\n * record.$persist, record.$push, record.$destroy and record.$deleteAndDestroy, record.$customQuery\n */\n private static setupModelMethods() {\n const context = Context.getInstance();\n\n // Register static model convenience methods\n (context.components.Model as typeof PatchedModel).fetch = async function(\n filter: any,\n bypassCache = false\n ) {\n let filterObj = filter;\n if (!isPlainObject(filterObj)) {\n filterObj = { id: filter };\n }\n return this.dispatch(\"fetch\", { filter: filterObj, bypassCache });\n };\n\n (context.components.Model as typeof PatchedModel).mutate = async function(\n params: ActionParams\n ) {\n return this.dispatch(\"mutate\", params);\n };\n\n (context.components.Model as typeof PatchedModel).customQuery = async function({\n name,\n filter,\n multiple,\n bypassCache\n }: ActionParams) {\n return this.dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n // Register model convenience methods\n const model: PatchedModel = context.components.Model.prototype as PatchedModel;\n\n model.$mutate = async function({ name, args, multiple }: ActionParams) {\n args = args || {};\n if (!args[\"id\"]) args[\"id\"] = this.$id;\n return this.$dispatch(\"mutate\", { name, args, multiple });\n };\n\n model.$customQuery = async function({ name, filter, multiple, bypassCache }: ActionParams) {\n filter = filter || {};\n if (!filter[\"id\"]) filter[\"id\"] = this.$id;\n return this.$dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n model.$persist = async function(args: any) {\n return this.$dispatch(\"persist\", { id: this.$id, args });\n };\n\n model.$push = async function(args: any) {\n return this.$dispatch(\"push\", { data: this, args });\n };\n\n model.$destroy = async function() {\n return this.$dispatch(\"destroy\", { id: this.$id });\n };\n\n model.$deleteAndDestroy = async function() {\n await this.$delete();\n return this.$destroy();\n };\n }\n}\n","import VuexORMGraphQL from './vuex-orm-graphql';\nimport { Components, Plugin } from '@vuex-orm/core/lib/plugins/use';\nimport { Options } from './support/interfaces';\n\n/**\n * Plugin class. This just provides a static install method for Vuex-ORM and stores the instance of the model\n * within this.instance.\n */\nexport default class VuexORMGraphQLPlugin implements Plugin {\n /**\n * Contains the instance of VuexORMGraphQL\n */\n public static instance: VuexORMGraphQL;\n\n /**\n * This is called, when VuexORM.install(VuexOrmGraphQL, options) is called.\n *\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {VuexORMGraphQL}\n */\n public static install (components: Components, options: Options): VuexORMGraphQL {\n VuexORMGraphQLPlugin.instance = new VuexORMGraphQL(components, options);\n return VuexORMGraphQLPlugin.instance;\n }\n}\n","import { Model as ORMModel } from \"@vuex-orm/core\";\nimport Context from \"./common/context\";\nimport Model from \"./orm/model\";\nimport VuexORMGraphQLPlugin from \"./index\";\n\nlet context: Context | null = null;\n\nexport function setupTestUtils(plugin: typeof VuexORMGraphQLPlugin): void {\n /* istanbul ignore next */\n if (!plugin.instance) {\n throw new Error(\"Please call this function after setting up the store!\");\n }\n\n context = plugin.instance.getContext();\n}\n\nexport interface MockOptions {\n [key: string]: any;\n}\n\ntype ReturnObject = { [key: string]: any };\n\nexport type ReturnValue =\n | (() => ReturnObject | Array)\n | ReturnObject\n | Array;\n\nexport class Mock {\n public readonly action: string;\n public readonly options?: MockOptions;\n public modelClass?: typeof ORMModel;\n public returnValue?: ReturnValue;\n\n constructor(action: string, options?: MockOptions) {\n this.action = action;\n this.options = options;\n }\n\n public for(modelClass: typeof ORMModel): Mock {\n this.modelClass = modelClass;\n return this;\n }\n\n public andReturn(returnValue: ReturnValue): Mock {\n this.returnValue = returnValue;\n this.installMock();\n return this;\n }\n\n private installMock(): void {\n if (this.action === \"simpleQuery\" || this.action === \"simpleMutation\") {\n context!.addGlobalMock(this);\n } else {\n const model: Model = context!.getModel(this.modelClass!.entity);\n model.$addMock(this);\n }\n }\n}\n\nexport async function clearORMStore() {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n await context.database.store.dispatch(\"entities/deleteAll\");\n}\n\nexport function mock(action: string, options?: MockOptions): Mock {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n return new Mock(action, options);\n}\n"],"names":["Object","defineProperty","exports","value","condition","message","Error","undefined","obj","_invariant2","_invariant","__esModule","default","Source","body","name","locationOffset","instance","Constructor","TypeError","_classCallCheck","this","line","column","source","position","lineRegexp","match","exec","index","length","highlightSourceAtLocation","location","lineOffset","columnOffset","getColumnOffset","contextLine","contextColumn","prevLineNum","toString","lineNum","nextLineNum","padLen","lines","split","whitespace","lpad","filter","Boolean","join","len","Array","str","error","printedLocations","nodes","forEach","node","loc","push","_location","getLocation","start","locations","concat","GraphQLError","positions","path","originalError","extensions","_nodes","isArray","_source","_positions","reduce","list","_locations","providedSource","map","pos","defineProperties","enumerable","writable","stack","configurable","captureStackTrace","prototype","create","constructor","_printError","printError","description","_GraphQLError","_extends","assign","target","i","arguments","key","hasOwnProperty","call","get","_syntaxError","syntaxError","_locatedError","locatedError","_formatError","formatError","leadingWhitespace","isBlank","rawString","commonIndent","indent","_i","slice","shift","pop","options","startOfFileToken","Tok","SOF","lastToken","token","lineStart","advance","advanceLexer","lookahead","kind","_blockStringValue2","_blockStringValue","EOF","next","readToken","COMMENT","BANG","DOLLAR","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","NAME","INT","FLOAT","STRING","BLOCK_STRING","charCodeAt","String","end","prev","printCharCode","code","isNaN","JSON","stringify","fromCharCode","toUpperCase","lexer","bodyLength","startPosition","positionAfterWhitespace","col","_error","readComment","readName","firstCode","isFloat","readDigits","readNumber","chunkStart","rawValue","readBlockString","charCode","a","b","c","d","char2hex","readString","unexpectedCharacterMessage","toJSON","inspect","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","parseName","expect","_lexer","TokenKind","_kinds","parseDefinition","peek","parseExecutableDefinition","parseTypeSystemDefinition","peekDescription","unexpected","parseOperationDefinition","expectKeyword","experimentalFragmentVariables","parseFragmentName","variableDefinitions","parseVariableDefinitions","typeCondition","parseNamedType","directives","parseDirectives","selectionSet","parseSelectionSet","parseFragmentDefinition","OPERATION_DEFINITION","operation","parseOperationType","operationToken","many","parseVariableDefinition","VARIABLE_DEFINITION","variable","parseVariable","type","parseTypeReference","defaultValue","skip","parseValueLiteral","VARIABLE","SELECTION_SET","selections","parseSelection","parseFragment","nameOrAlias","alias","parseArguments","parseField","isConst","item","parseConstArgument","parseArgument","ARGUMENT","parseConstValue","parseValueValue","LIST","values","openKind","parseFn","closeKind","any","parseList","fields","parseObjectField","parseObject","parseStringLiteral","BOOLEAN","NULL","block","OBJECT_FIELD","parseDirective","DIRECTIVE","LIST_TYPE","NON_NULL_TYPE","NAMED_TYPE","keywordToken","operationTypes","parseOperationTypeDefinition","SCHEMA_DEFINITION","parseSchemaDefinition","parseDescription","SCALAR_TYPE_DEFINITION","parseScalarTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","OBJECT_TYPE_DEFINITION","parseObjectTypeDefinition","INTERFACE_TYPE_DEFINITION","parseInterfaceTypeDefinition","types","parseMemberTypesDefinition","UNION_TYPE_DEFINITION","parseUnionTypeDefinition","parseEnumValuesDefinition","ENUM_TYPE_DEFINITION","parseEnumTypeDefinition","parseInputFieldsDefinition","INPUT_OBJECT_TYPE_DEFINITION","parseInputObjectTypeDefinition","SCALAR_TYPE_EXTENSION","parseScalarTypeExtension","OBJECT_TYPE_EXTENSION","parseObjectTypeExtension","INTERFACE_TYPE_EXTENSION","parseInterfaceTypeExtension","UNION_TYPE_EXTENSION","parseUnionTypeExtension","ENUM_TYPE_EXTENSION","parseEnumTypeExtension","INPUT_OBJECT_TYPE_EXTENSION","parseInputObjectTypeExtension","parseTypeExtension","args","parseArgumentDefs","parseDirectiveLocation","parseDirectiveLocations","DIRECTIVE_DEFINITION","parseDirectiveDefinition","OPERATION_TYPE_DEFINITION","parseFieldDefinition","parseInputValueDef","INPUT_VALUE_DEFINITION","parseEnumValueDefinition","ENUM_VALUE_DEFINITION","_directiveLocation","DirectiveLocation","startToken","noLocation","Loc","endToken","getTokenDesc","atToken","sourceObj","definitions","DOCUMENT","parseDocument","createLexer","root","visitor","visitorKeys","QueryDocumentKeys","inArray","keys","edits","parent","ancestors","newRoot","isLeaving","isEdited","clone","k","editOffset","ii","editKey","editValue","splice","result","isNode","visitFn","getVisitFn","BREAK","visitors","skipping","enter","fn","apply","leave","typeInfo","Name","Document","OperationDefinition","VariableDefinition","Variable","SelectionSet","Field","Argument","FragmentSpread","InlineFragment","FragmentDefinition","IntValue","FloatValue","StringValue","BooleanValue","NullValue","EnumValue","ListValue","ObjectValue","ObjectField","Directive","NamedType","ListType","NonNullType","SchemaDefinition","OperationTypeDefinition","ScalarTypeDefinition","ObjectTypeDefinition","FieldDefinition","InputValueDefinition","InterfaceTypeDefinition","UnionTypeDefinition","EnumTypeDefinition","EnumValueDefinition","InputObjectTypeDefinition","ScalarTypeExtension","ObjectTypeExtension","InterfaceTypeExtension","UnionTypeExtension","EnumTypeExtension","InputObjectTypeExtension","DirectiveDefinition","maybeNode","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","ast","_visitor","visit","printDocASTReducer","op","varDefs","wrap","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","isDescription","indexOf","replace","printBlockString","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","maybeArray","separator","x","array","maybeString","LARGE_ARRAY_SIZE","HASH_UNDEFINED","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","MAX_SAFE_INTEGER","argsTag","arrayTag","asyncTag","boolTag","dateTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","arrayBufferTag","dataViewTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","freeSelf","self","Function","freeExports","nodeType","freeModule","module","moduleExports","freeProcess","process","nodeUtil","binding","e","nodeIsTypedArray","isTypedArray","arraySome","predicate","mapToArray","size","setToArray","set","uid","func","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","IE_PROTO","nativeObjectToString","reIsNative","RegExp","Buffer","Symbol","Uint8Array","propertyIsEnumerable","symToStringTag","toStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","arg","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","SetCache","__data__","add","Stack","data","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","n","iteratee","baseTimes","isIndex","assocIndexOf","eq","baseGetTag","isOwn","tag","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","object","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","byteLength","byteOffset","buffer","convert","isPartial","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isObject","isFunction","test","baseKeys","Ctor","proto","arrLength","seen","arrValue","othIndex","has","keysFunc","symbolsFunc","offset","arrayPush","baseGetAllKeys","getSymbols","getMapData","getValue","hash","string","pairs","resIndex","arrayFilter","symbol","ArrayBuffer","resolve","ctorString","isLength","baseUnary","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","cloneableTags","addMapEntry","pair","addSetEntry","arrayReduce","accumulator","initAccum","isHostObject","overArg","getPrototype","getPrototypeOf","objectCreate","isArrayLike","isArrayLikeObject","assignValue","baseClone","isDeep","isFull","input","initCloneArray","copyArray","isFunc","copy","cloneBuffer","isPrototype","initCloneObject","copyObject","copySymbols","baseAssign","cloneFunc","cloneArrayBuffer","dataView","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneSet","initCloneByTag","props","arrayEach","subValue","arrayBuffer","newValue","cache","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","charAt","substr","toLowerCase","sanitizeWord","rules","replaceWord","replaceMap","keepMap","checkWord","bool","count","inclusive","pluralized","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","require","pluralizeLib","singularize","upcaseFirstLetter","downcaseFirstLetter","prettify","query","print","parseQuery","parse","graphQlDocumentToString","isPlainObject","pick","prop","isEqual","lodashIsEqual","lodashClone","takeWhile","removeSymbols","enabled","log","console","groupCollapsed","PREFIX","messages","groupEnd","warn","variables","fetchPolicy","prettified","group","trim","baseModel","singularName","entity","pluralName","field","context","Context","getInstance","components","Number","Increment","Attr","BelongsTo","HasOne","MorphTo","MorphOne","model","originalFieldGenerator","bind","originalFields","boolean","relation","BelongsToMany","HasMany","HasManyThrough","MorphedByMany","MorphMany","MorphToMany","getModel","related","HasManyBy","Model","isFieldAttribute","_this","skipField","startsWith","skipFields","shouldSkipField","getRelations","foreignKey","relations","found","models","id","withAllRecursive","where","first","fieldName","relatedModel","eagerLoadList","eagerLoad","eagerSync","find","eagerSaveList","eagerSave","mock","$findMock","action","mocks","m","returnValue","r","$isPersisted","opts","cmp","f","cycles","aobj","bobj","isFinite","out","seenIndex","sort","isStringValue","isBooleanValue","isIntValue","isFloatValue","isVariable","isObjectValue","isListValue","isEnumValue","isNullValue","valueToObjectRepresentation","argObj","nestedArgObj_1","variableValue","listValue","nestedArgArrayObj","flattenSelections","selection","selectionNode","selected","getDirectiveNames","doc","definition","directive","hasDirectives","names","some","sources","getMutationDefinition","checkDocument","mutationDef","operations","getOperationDefinition","getOperationDefinitionOrDie","document","def","getOperationName","getFragmentDefinitions","getQueryDefinition","queryDef","createFragmentMap","fragments","symTable","fragment","getDefaultValues","defaultValues","_a","defaultValueObj","cloneDeep","cloneDeepHelper","val","copy_1","child","copy_2","isNotEmpty","getDirectiveMatcher","dir","removeDirectivesFromSelectionSet","agressiveRemove","remove","directiveMatcher","shouldKeep","removeDirectivesFromDocument","docClone","NetworkStatus","connectionRemoveConfig","willRemove","removeConnectionDirectiveFromDocument","getEnv","env","NODE_ENV","isEnv","isProduction","tryFunctionOrLogError","graphQLResultHasError","errors","Date","getTime","isNetworkRequestInFlight","networkStatus","_createClass","descriptor","protoProps","staticProps","hasSymbols","hasSymbol","getSymbol","observable","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","Observable","isObservable","hostReportError","setTimeout","enqueue","then","cleanupSubscription","subscription","cleanup","_cleanup","unsubscribe","closeSubscription","_observer","_queue","_state","notifySubscription","observer","onNotify","queue","flushSubscription","Subscription","subscriber","subscriptionObserver","SubscriptionObserver","_subscription","_subscriber","complete","reject","subscribe","done","_this2","_this3","_this4","C","hasSeed","hasValue","acc","_this5","_len","_key","startNext","v","from","_this6","subscriptions","outer","inner","completeIfDone","closed","s","method","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","err","return","_len2","items","_key2","require$$0","zenObservable","validateOperation","OPERATION_FIELDS","link","_super","__extends","isTerminating","request","fromError","errorValue","transformOperation","transformedOperation","operationName","createOperation","starting","getKey","passthrough","forward","of","toLink","handler","ApolloLink","empty","links","y","left","right","leftLink","rightLink","second","firstLink","LinkError","nextLink","execute","symbolObservablePonyfill","ponyfill","window","$$observable","LinkObservable","isApolloError","FetchType","generateErrorMessage","graphQLErrors","graphQLError","errorMessage","networkError","extraInfo","__proto__","ApolloError","hasError","storeValue","policy","scheduler","_b","shouldSubscribe","onSubscribe","isCurrentlyPolling","isTornDown","queryId","queryManager","generateQueryId","observers","subscriptionHandles","ObservableQuery","that","obs","removeQuery","lastError","lastResult","loading","queryStoreValue","queryStore","errorPolicy","partial","queryLoading","ready","stale","lastResultSnapshot","__assign","newResult","snapshot","isNetworkFetchPolicy","combinedOptions","fetchQuery","refetch","fetchMoreOptions","updateQuery","qid","normal","fetchMoreResult","previousResult","startGraphQLSubscription","subscriptionData","previous","onError","oldOptions","pollInterval","startPolling","stopPolling","tryFetch","setVariables","fetchResults","newVariables","mapFn","dataStore","markUpdateQueryResult","broadcastQueries","stopPollingQuery","startPollingQuery","setUpQuery","tearDownQuery","addObservableQuery","startQuery","queryListenerForObserver","sub","removeObservableQuery","stopQuery","DedupLink","getContext","forceFetch","toKey","operationKey","inFlightRequestObservables","delete","subscribers","subscription_1","singleObserver_1","sharedObserver","ssrMode","QueryScheduler","fetchType","catch","listener","registeredQueries","addQueryListener","addQueryOnInterval","interval","intervalQueries","checkInFlight","queryOptions","pollingOptions","poll","clearInterval","pollingTimers","setInterval","fetchQueriesOnInterval","MutationStore","store","mutationId","mutationString","mutation","QueryStore","previousQuery","isSetVariables","previousVariables","storePreviousVariables","isPoll","isRefetch","metadata","fetchMoreForQueryId","fetchMore","markQueryResultClient","observableQueryIds","res","queryDeduplication","_c","onBroadcast","_d","deduplicator","Deduplicator","QueryManager","optimisticResponse","updateQueriesByName","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","getCache","transformDocument","setQuery","generateUpdateQueriesInfo","ret","queryName","queryIdsByName","updater","mutationStore","initMutation","markMutationInit","updateQueries","update","storeResult","buildOperationForLink","markMutationResult","markMutationError","markMutationComplete","refetchQueryPromises","refetchQueries_1","refetchQuery","promise","refetchQueryByName","all","needToFetch","shouldFetch","requestId","generateRequestId","cancel","updateQueryWatch","lastRequestId","invalidated","invalidate","initQuery","networkResult","fetchRequest","markQueryError","removeFetchQueryPromise","previouslyHadError","newData","observableQuery","getLastResult","getLastError","shouldNotifyIfLoading","networkStatusChanged","errorStatusChanged","notifyOnNetworkStatusChange","apolloError_1","info","isMissing","document_1","readResult","diff","optimistic","resultFromStore","isDifferentFromLastResult","queryDefinition","transformedOptions","returnPartialData","idCounter","addFetchQueryPromise","watchQuery","listeners","watch","callback","fetchQueryPromises","resetIds","queries","reset","clearStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getObservableQueryPromises","isCacheEnabled","transformedDoc","markSubscriptionResult","stopQueryInStore","read","queryIdOrObservable","foundObserveableQuery","resetLastResults","errorsFromStore","markQueryResult","refetchedQueries","getQuery","newInfo","extraContext","transformForLink","getCacheKey","config","dataIdFromObject","initialCache","DataStore","ignoreErrors","writeWithErrors","write","dataId","optimistic_1","recordOptimisticTransaction","orig","cacheWrites_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","performTransaction","update_1","removeOptimistic","hasSuggestedDevtools","ssrForceFetchDelay","connectToDevTools","defaultOptions","supportedCache","supportedDirectives","disableNetworkFetches","mutate","resetStore","defaultConnectToDevTools","__APOLLO_CLIENT__","top","__APOLLO_DEVTOOLS_GLOBAL_HOOK__","navigator","userAgent","debug","version","ApolloClient","initQueryManager","initProxy","readQuery","readFragment","writeQuery","writeFragment","writeData","cb","devToolsHookCb","payload","state","getStore","mutations","dataWithOptimisticResults","extract","resetStoreCallbacks","serializedState","restore","proxy","genericMessage","setPrototypeOf","InvariantError","framesToPop","invariant","storeKeyNameFromField","directivesObj","getStoreKeyName","KNOWN_DIRECTIVES","filterKeys","queryArgs_1","filteredArgs_1","completeFieldName","stringifiedArgs","argumentsObjectFromField","argObj_1","resultKeyNameFromField","isField","isInlineFragment","isIdValue","idObject","generated","toIdValue","idConfig","typename","isJsonValue","jsonObject","getDirectiveInfoFromField","directiveObj_1","shouldInclude","directiveArguments","directiveName","ifArgument","ifValue","evaledValue","getFragmentQueryDocument","fragmentName","actualFragmentName","getMainDefinition","queryDoc","fragmentDefinition","TYPENAME_FIELD","addTypenameToDocument","lastIndexOf","isTest","mergeDeepArray","pastCopies","shallowCopyForMerge","mergeHelper","isExtensible","sourceKey","sourceValue","targetValue","queryFromPojo","selectionSetFromObj","fragmentFromPojo","justTypenameQuery","ApolloCache","rootId","typenameResult","__typename","dataToWrite","Cache","newest","oldest","max","dispose","Cp","getEntry","older","newer","clean","useSymbol","for","brand","globalKey","freeze","isObjRef","UniversalWeakMap","_weakMap","_strongMap","_getMap","canCreate","lookup","lookupArray","tuple","arguments$1","t","argc","isTuple","toArray","mustConvertThisToArray","desc","getOwnPropertyDescriptor","forEachArrayMethod","fakeNullFiber","getCurrentFiber","Fiber","reverse","current","fiber","getLocal","UNKNOWN_VALUE","emptySetPool","entryPool","assert","optionalMessage","Entry","parents","childValues","dirtyChildren","dirty","recomputing","reportOrphan","acquire","Ep","maybeReportOrphan","report","reportDirty","reportDirtyChild","reportClean","reportCleanChild","mightBeDirty","cv","childValue","setDirty","removeDirtyChild","dc","POOL_TARGET_SIZE","reallyRecompute","originalChildren","forgetChildren","local","currentParentEntry","threw","setClean","recompute","rememberParent","recomputeIfDirty","forgetChild","release","reusableEmptyArray","children","unsub","require$$1","require$$2","require$$3","normalizeOptions","makeCacheKey","Math","pow","disposable","testMap","set_1","testSet","add_1","frozen","seal","preventExtensions","haveWarned","shouldWarn","answer","HeuristicFragmentMatcher","idValue","CacheKeyNode","getOrCreate","hasOwn","depend","DepTrackingCache","defaultNormalizedCacheFactory","seed","cacheKeyRoot","reader","executeStoreQuery","executeSelectionSet","rootValue","contextValue","variableValues","fragmentMatcher","execContext","StoreReader","diffQueryAgainstStore","fragmentMatcherFunction","cacheRedirects","execResult","hasMissingFields","missing","tolerable","mainDefinition","fragmentMap","finalResult","objectsToMerge","handleMissing","fieldResult","executeField","fragmentExecResult","readStoreResult","readStoreResolver","resultKey","combineExecResults","executeSubSelectedArray","assertSelectionSetForIdValue","execResults","childResult","defaultFragmentMatcher","storeKeyName","fieldValue","resolver","storeObj","json","ObjectCache","tslib_1.__extends","enhanceErrorWithDocument","enhancedError","WriteError","StoreWriter","writeResultToStore","operationDefinition","writeSelectionSetToStore","processedData","resultFieldKey","writeFieldToStore","isDefered","isClient","matches","fakeContext","storeObject","storeFieldName","generatedId","processArrayValue","valueDataId","isGeneratedId","semanticId","isDataProcessed","escapedId","hadTypename","hasTypename","typenameChanged","mergeWithGenerated","itemDataId","generatedKey","realKey","real","madeChanges","realValue","newRealValue","defaultConfig","defaultDataIdFromObject","addTypename","resultCaching","_id","optimisticId","transaction","OptimisticCacheLayer","toObject","customResolvers","cacheResolvers","optimisticData","storeReader","storeWriter","maybeBroadcastWatch","InMemoryCache","readQueryFromStore","broadcastWatches","watches","idToRemove","toReapply","removedCount","layer","layer_1","silenceBroadcast","typenameDocumentCache","defaultHttpOptions","includeQuery","includeExtensions","defaultHeaders","accept","content-type","fallbackHttpConfig","http","headers","throwServerError","response","statusCode","status","parseAndCheckHttpResponse","text","bodyText","parseError","checkFetcher","fetcher","fetch","library","createSignalIfSupported","AbortController","controller","signal","selectHttpOptionsAndBody","fallbackConfig","configs","credentials","serializeFetchParameter","p","label","serialized","selectURI","fallbackURI","contextURI","uri","createHttpLink","linkOptions","useGETForQueries","requestOptions","linkConfig","fetchOptions","chosenURI","contextConfig","_controller","newURI","setContext","abort","rewriteURIForGET","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","ConnectionMode","ArgumentMode","whitelist","outgoingRecords","recursiveCall","isRelation","isRecursion","shouldIncludeOutgoingField","getRelatedModel","arrayModel_1","addRecordForRecursionDetection","transformOutgoingData","$id","$self","logger","transformIncomingData","localModel","connectionMode","NODES","edges","EDGES","newKey","isFieldNumber","parseFloat","endsWith","isTypeFieldOfPolymorphicRelation","forFilter","includes","shouldEagerSaveRelation","records","record","ids","parser","normalize","docCache","fragmentSourceMap","cacheKeyFromLoc","substring","resetCaches","printFragmentWarnings","processFragments","astFragmentMap","disableFragmentWarnings","stripLoc","removeLocAtThisLevel","docType","valueType","cacheKey","parsed","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","gql","literals","apolloClient","httpLink","HttpLink","url","debugMode","bypassCache","logQuery","Apollo","getHeaders","Transformer","schema","getType","adapter","getRootQueryName","getRootMutationName","connection","typeName","Schema","getTypeNameOfField","PLAIN","allowNull","prepareSchemaTypeName","getRealType","ofType","TYPE","AUTO","database","Logger","DefaultAdapter","apollo","collectModels","schemaWillBeLoaded","getConnectionMode","X-GraphQL-Introspection-Query","simpleQuery","introspectionQuery","__schema","processSchema","determineQueryMode","name_1","findGlobalMock","globalMocks","entities","augment","multiple","allowIdFields","getMutation","params","buildArguments","getQueryFields","buildRelationsQuery","header","prepareArguments","buildField","signature","isForeignKey","skipFieldDueId","schemaField","findSchemaFieldForArgument","isConnectionField","typeOrValue","__type","getInputTypeName","QueryBuilder","determineAttributeType","isFilter","getFilterTypeName","inputFields","relationQueries","referencesItSelf","ignore","shouldEagerLoadRelation","newPath","isConnection","getArgumentMode","dispatch","dataKey","insertedData","loadSchema","returnsConnection","buildQuery","getNameForDestroy","parseInt","Store","insertData","newRecord","last","$name","transformedValue","getModelFromState","$mockHook","mockReturnValue","prepareArgs","Action","mutationName","getNameForFetch","transformArgs","getNameForPersist","getRecordWithId","deleteObsoleteRecord","newRecord_1","oldRecord","addRecordToArgs","$delete","getNameForPush","globalMockHook","parsedQuery","simpleMutation","setup","setupActions","setupModelMethods","RootActions","SimpleQuery","SimpleMutation","Actions","Fetch","persist","Persist","Push","destroy","Destroy","Mutate","Query","filterObj","customQuery","$mutate","$dispatch","$customQuery","$persist","$push","$destroy","$deleteAndDestroy","VuexORMGraphQL","VuexORMGraphQLPlugin","setupTestUtils","plugin","modelClass","installMock","addGlobalMock","$addMock","clearORMStore","Mock"],"mappings":"w4EAEAA,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,UAUA,SAAmBE,EAAWC,GAE5B,IAAKD,EACH,MAAM,IAAIE,MAAMD,+EChBpBL,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,cAAiBK,EAIjB,IAEgCC,EAF5BC,GAE4BD,EAFSE,cAEYF,EAAIG,WAAaH,GAAQI,QAASJ,GAmB1EN,SAAiB,SAASW,EAAOC,EAAMC,EAAMC,IAjB1D,SAAyBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAkB9GC,CAAgBC,KAAMR,GAEtBQ,KAAKP,KAAOA,EACZO,KAAKN,KAAOA,GAAQ,kBACpBM,KAAKL,eAAiBA,IAAoBM,KAAM,EAAGC,OAAQ,GACzDF,KAAKL,eAAeM,KAAO,IAAK,EAAIb,EAAYG,SAAS,EAAG,4DAC5DS,KAAKL,eAAeO,OAAS,IAAK,EAAId,EAAYG,SAAS,EAAG,gKCnClEZ,OAAOC,eAAeC,EAAS,cAC7BC,OAAO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BAAqB,UACrB,SAAU,OACV,WAAY,QACZ,OAAQ,QACTlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU2B,cAAcpB,EAAK,GAAIA,EAAK,QAO5C,MAAO,KACP,SAAU,OACV,gEAAiE,SACjE,kCAAmC,QACnC,QAAS,MACT,uFAAwF,SACxF,oBAAqB,SACrB,aAAc,WACd,sBAAuB,OACvB,iFAAkF,OAClF,qEAAsE,UACtE,iCAAkC,OAClC,oBAAqB,SACrB,kGAAmG,SACnG,yGAA0G,SAC1G,8FAA+F,SAC/F,0BAA2B,QAC3B,+BAAgC,SAChC,sBAAuB,SACvB,oBAAqB,WACrB,eAAgB,OAChB,YAAa,OACb,QAAS,QACVlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU6B,gBAAgBtB,EAAK,GAAIA,EAAK,OAQ/C,YACA,SACA,SACA,MACA,UACA,OACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,MACA,UACA,UACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,QACA,OACA,OACA,WACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,QACA,SACA,UACA,gBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAlqB,QAAQ2pB,EAAU8B,oBAEb9B,GApegB,mBAAZiC,gBAETtP,UAAiBqN,IAQjB5X,EAAK4X,UAAYA,wNCFRA,YAAYkC,UAAaV,OACzBW,YAAcD,UAAaX,kBAQxBa,kBAAkBhE,UACzBA,EAAMsC,OAAO,GAAG3jB,cAAgBqhB,EAAMrkB,MAAM,YASrCsoB,oBAAoBjE,UAC3BA,EAAMsC,OAAO,GAAGE,c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D,eAAeliC,EAAYvqB,GACxD0sD,EAAqB9yD,eClB5BwwB,QAA0B,cAEduiC,eAAeC,OAExBA,EAAOhzD,eACJ,IAAIX,MAAM,iEAGR2zD,EAAOhzD,SAAS8lC,aAc5B,+BAMclS,EAAgBxtB,QACrBwtB,OAASA,OACTxtB,QAAUA,yBAGjB,SAAW6sD,eACJA,WAAaA,EACX7yD,4BAGT,SAAiB2zB,eACVA,YAAcA,OACdm/B,cACE9yD,8BAGT,WACsB,gBAAhBA,KAAKwzB,QAA4C,mBAAhBxzB,KAAKwzB,eAC/Bu/B,cAAc/yD,MAEFowB,QAASuB,SAAS3xB,KAAK6yD,WAAY5iC,QAClD+iC,SAAShzD,qBAKCizD,8HAEf7iC,cACG,IAAInxB,MAAM,iDAGZmxB,QAAQ27B,SAASxkB,MAAMynB,SAAS,gEAGxB17B,KAAKE,EAAgBxtB,OAE9BoqB,cACG,IAAInxB,MAAM,+CAGX,IAAIi0D,KAAK1/B,EAAQxtB"} \ No newline at end of file diff --git a/dist/vuex-orm-graphql.umd.js.map b/dist/vuex-orm-graphql.umd.js.map index c93b07fe..b5982f9f 100644 --- a/dist/vuex-orm-graphql.umd.js.map +++ b/dist/vuex-orm-graphql.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"vuex-orm-graphql.umd.js","sources":["../node_modules/graphql/jsutils/invariant.js","../node_modules/graphql/language/source.js","../node_modules/graphql/language/location.js","../node_modules/graphql/error/printError.js","../node_modules/graphql/error/GraphQLError.js","../node_modules/graphql/error/syntaxError.js","../node_modules/graphql/error/locatedError.js","../node_modules/graphql/error/formatError.js","../node_modules/graphql/error/index.js","../node_modules/graphql/language/blockStringValue.js","../node_modules/graphql/language/lexer.js","../node_modules/graphql/language/kinds.js","../node_modules/graphql/language/directiveLocation.js","../node_modules/graphql/language/parser.js","../node_modules/graphql/language/visitor.js","../node_modules/graphql/language/printer.js","../node_modules/lodash.isequal/index.js","../node_modules/lodash.clone/index.js","../node_modules/pluralize/pluralize.js","../src/support/utils.ts","../src/common/logger.ts","../src/orm/model.ts","../node_modules/fast-json-stable-stringify/index.js","../node_modules/apollo-client/node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/cloneDeep.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/transform.ts","../node_modules/src/core/networkStatus.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/errorHandling.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/zen-observable/lib/Observable.js","../node_modules/zen-observable-ts/src/zenObservable.ts","../node_modules/zen-observable/index.js","../node_modules/apollo-link/src/linkUtils.ts","../node_modules/apollo-link/src/link.ts","../node_modules/apollo-link/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/src/util/Observable.ts","../node_modules/src/errors/ApolloError.ts","../node_modules/src/core/types.ts","../node_modules/src/core/ObservableQuery.ts","../node_modules/apollo-link-dedup/src/dedupLink.ts","../node_modules/src/scheduler/scheduler.ts","../node_modules/src/data/mutations.ts","../node_modules/src/data/queries.ts","../node_modules/src/core/QueryManager.ts","../node_modules/src/data/store.ts","../node_modules/apollo-client/version.js","../node_modules/src/ApolloClient.ts","../node_modules/ts-invariant/lib/invariant.esm.js","../node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-utilities/src/fragments.ts","../node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-utilities/src/transform.ts","../node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/apollo-utilities/src/util/mergeDeep.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/utils.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/cache.ts","../node_modules/optimism/lib/cache.js","../node_modules/immutable-tuple/dist/tuple.js","../node_modules/optimism/lib/local.js","../node_modules/optimism/lib/entry.js","../node_modules/optimism/lib/index.js","../node_modules/apollo-cache-inmemory/src/fixPolyfills.ts","../node_modules/apollo-cache-inmemory/src/fragmentMatcher.ts","../node_modules/apollo-cache-inmemory/src/cacheKeys.ts","../node_modules/apollo-cache-inmemory/src/depTrackingCache.ts","../node_modules/apollo-cache-inmemory/src/readFromStore.ts","../node_modules/apollo-cache-inmemory/src/objectCache.ts","../node_modules/apollo-cache-inmemory/src/writeToStore.ts","../node_modules/apollo-cache-inmemory/src/inMemoryCache.ts","../node_modules/apollo-link-http-common/src/index.ts","../node_modules/apollo-link-http/src/httpLink.ts","../src/adapters/adapter.ts","../src/graphql/transformer.ts","../node_modules/graphql-tag/src/index.js","../src/graphql/apollo.ts","../src/graphql/schema.ts","../src/adapters/builtin/default-adapter.ts","../src/common/context.ts","../src/graphql/introspection-query.ts","../src/graphql/query-builder.ts","../src/orm/store.ts","../src/actions/action.ts","../src/actions/destroy.ts","../src/actions/fetch.ts","../src/actions/mutate.ts","../src/actions/persist.ts","../src/actions/push.ts","../src/actions/query.ts","../src/actions/simple-query.ts","../src/actions/simple-mutation.ts","../src/vuex-orm-graphql.ts","../src/plugin.ts","../src/test-utils.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = invariant;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Source = undefined;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * A representation of source input to GraphQL.\n * `name` and `locationOffset` are optional. They are useful for clients who\n * store GraphQL documents in source files; for example, if the GraphQL input\n * starts at line 40 in a file named Foo.graphql, it might be useful for name to\n * be \"Foo.graphql\" and location to be `{ line: 40, column: 0 }`.\n * line and column in locationOffset are 1-indexed\n */\nvar Source = exports.Source = function Source(body, name, locationOffset) {\n _classCallCheck(this, Source);\n\n this.body = body;\n this.name = name || 'GraphQL request';\n this.locationOffset = locationOffset || { line: 1, column: 1 };\n !(this.locationOffset.line > 0) ? (0, _invariant2.default)(0, 'line in locationOffset is 1-indexed and must be positive') : void 0;\n !(this.locationOffset.column > 0) ? (0, _invariant2.default)(0, 'column in locationOffset is 1-indexed and must be positive') : void 0;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLocation = getLocation;\n\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}\n\n/**\n * Represents a location in a Source.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.printError = printError;\n\nvar _location = require('../language/location');\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nfunction printError(error) {\n var printedLocations = [];\n if (error.nodes) {\n error.nodes.forEach(function (node) {\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, (0, _location.getLocation)(node.loc.source, node.loc.start)));\n }\n });\n } else if (error.source && error.locations) {\n var source = error.source;\n error.locations.forEach(function (location) {\n printedLocations.push(highlightSourceAtLocation(source, location));\n });\n }\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction highlightSourceAtLocation(source, location) {\n var line = location.line;\n var lineOffset = source.locationOffset.line - 1;\n var columnOffset = getColumnOffset(source, location);\n var contextLine = line + lineOffset;\n var contextColumn = location.column + columnOffset;\n var prevLineNum = (contextLine - 1).toString();\n var lineNum = contextLine.toString();\n var nextLineNum = (contextLine + 1).toString();\n var padLen = nextLineNum.length;\n var lines = source.body.split(/\\r\\n|[\\n\\r]/g);\n lines[0] = whitespace(source.locationOffset.column - 1) + lines[0];\n var outputLines = [source.name + ' (' + contextLine + ':' + contextColumn + ')', line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];\n return outputLines.filter(Boolean).join('\\n');\n}\n\nfunction getColumnOffset(source, location) {\n return location.line === 1 ? source.locationOffset.column - 1 : 0;\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GraphQLError = GraphQLError;\n\nvar _printError = require('./printError');\n\nvar _location = require('../language/location');\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined;\n\n // Compute locations in the source for the given nodes/positions.\n var _source = source;\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n return list;\n }, []);\n }\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations = void 0;\n if (positions && source) {\n var providedSource = source;\n _locations = positions.map(function (pos) {\n return (0, _location.getLocation)(providedSource, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push((0, _location.getLocation)(node.loc.source, node.loc.start));\n }\n return list;\n }, []);\n }\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n value: extensions || originalError && originalError.extensions\n }\n });\n\n // Include (non-enumerable) stack trace.\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\n\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: { value: GraphQLError },\n name: { value: 'GraphQLError' },\n toString: {\n value: function toString() {\n return (0, _printError.printError)(this);\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syntaxError = syntaxError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction syntaxError(source, position, description) {\n return new _GraphQLError.GraphQLError('Syntax Error: ' + description, undefined, source, [position]);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.locatedError = locatedError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Given an arbitrary Error, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\nfunction locatedError(originalError, nodes, path) {\n // Note: this uses a brand-check to support GraphQL errors originating from\n // other contexts.\n if (originalError && Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError);\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nexports.formatError = formatError;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nfunction formatError(error) {\n !error ? (0, _invariant2.default)(0, 'Received null or undefined error.') : void 0;\n return _extends({}, error.extensions, {\n message: error.message || 'An unknown error occurred.',\n locations: error.locations,\n path: error.path\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _GraphQLError = require('./GraphQLError');\n\nObject.defineProperty(exports, 'GraphQLError', {\n enumerable: true,\n get: function get() {\n return _GraphQLError.GraphQLError;\n }\n});\n\nvar _syntaxError = require('./syntaxError');\n\nObject.defineProperty(exports, 'syntaxError', {\n enumerable: true,\n get: function get() {\n return _syntaxError.syntaxError;\n }\n});\n\nvar _locatedError = require('./locatedError');\n\nObject.defineProperty(exports, 'locatedError', {\n enumerable: true,\n get: function get() {\n return _locatedError.locatedError;\n }\n});\n\nvar _printError = require('./printError');\n\nObject.defineProperty(exports, 'printError', {\n enumerable: true,\n get: function get() {\n return _printError.printError;\n }\n});\n\nvar _formatError = require('./formatError');\n\nObject.defineProperty(exports, 'formatError', {\n enumerable: true,\n get: function get() {\n return _formatError.formatError;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = blockStringValue;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n */\nfunction blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g);\n\n // Remove common indentation from all lines but first.\n var commonIndent = null;\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n var indent = leadingWhitespace(line);\n if (indent < line.length && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n if (commonIndent === 0) {\n break;\n }\n }\n }\n\n if (commonIndent) {\n for (var _i = 1; _i < lines.length; _i++) {\n lines[_i] = lines[_i].slice(commonIndent);\n }\n }\n\n // Remove leading and trailing blank lines.\n while (lines.length > 0 && isBlank(lines[0])) {\n lines.shift();\n }\n while (lines.length > 0 && isBlank(lines[lines.length - 1])) {\n lines.pop();\n }\n\n // Return a string of the lines joined with U+000A.\n return lines.join('\\n');\n}\n\nfunction leadingWhitespace(str) {\n var i = 0;\n while (i < str.length && (str[i] === ' ' || str[i] === '\\t')) {\n i++;\n }\n return i;\n}\n\nfunction isBlank(str) {\n return leadingWhitespace(str) === str.length;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TokenKind = undefined;\nexports.createLexer = createLexer;\nexports.getTokenDesc = getTokenDesc;\n\nvar _error = require('../error');\n\nvar _blockStringValue = require('./blockStringValue');\n\nvar _blockStringValue2 = _interopRequireDefault(_blockStringValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a Source object, this returns a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}\n\nfunction advanceLexer() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n}\n\nfunction lookahead() {\n var token = this.token;\n if (token.kind !== EOF) {\n do {\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = token.next || (token.next = readToken(this, token));\n } while (token.kind === COMMENT);\n }\n return token;\n}\n\n/**\n * The return type of createLexer.\n */\n\n\n// Each kind of token.\nvar SOF = '';\nvar EOF = '';\nvar BANG = '!';\nvar DOLLAR = '$';\nvar PAREN_L = '(';\nvar PAREN_R = ')';\nvar SPREAD = '...';\nvar COLON = ':';\nvar EQUALS = '=';\nvar AT = '@';\nvar BRACKET_L = '[';\nvar BRACKET_R = ']';\nvar BRACE_L = '{';\nvar PIPE = '|';\nvar BRACE_R = '}';\nvar NAME = 'Name';\nvar INT = 'Int';\nvar FLOAT = 'Float';\nvar STRING = 'String';\nvar BLOCK_STRING = 'BlockString';\nvar COMMENT = 'Comment';\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind = exports.TokenKind = {\n SOF: SOF,\n EOF: EOF,\n BANG: BANG,\n DOLLAR: DOLLAR,\n PAREN_L: PAREN_L,\n PAREN_R: PAREN_R,\n SPREAD: SPREAD,\n COLON: COLON,\n EQUALS: EQUALS,\n AT: AT,\n BRACKET_L: BRACKET_L,\n BRACKET_R: BRACKET_R,\n BRACE_L: BRACE_L,\n PIPE: PIPE,\n BRACE_R: BRACE_R,\n NAME: NAME,\n INT: INT,\n FLOAT: FLOAT,\n STRING: STRING,\n BLOCK_STRING: BLOCK_STRING,\n COMMENT: COMMENT\n};\n\n/**\n * A helper function to describe a token as a string for debugging\n */\nfunction getTokenDesc(token) {\n var value = token.value;\n return value ? token.kind + ' \"' + value + '\"' : token.kind;\n}\n\nvar charCodeAt = String.prototype.charCodeAt;\nvar slice = String.prototype.slice;\n\n/**\n * Helper function for constructing the Token object.\n */\nfunction Tok(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nTok.prototype.toJSON = Tok.prototype.inspect = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n};\n\nfunction printCharCode(code) {\n return (\n // NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n '\"\\\\u' + ('00' + code.toString(16).toUpperCase()).slice(-4) + '\"'\n );\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace and comments until it finds the next lexable\n * token, then lexes punctuators immediately or calls the appropriate helper\n * function for more complicated tokens.\n */\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var position = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + position - lexer.lineStart;\n\n if (position >= bodyLength) {\n return new Tok(EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, position);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(BANG, position, position + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, position, line, col, prev);\n // $\n case 36:\n return new Tok(DOLLAR, position, position + 1, line, col, prev);\n // (\n case 40:\n return new Tok(PAREN_L, position, position + 1, line, col, prev);\n // )\n case 41:\n return new Tok(PAREN_R, position, position + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, position + 1) === 46 && charCodeAt.call(body, position + 2) === 46) {\n return new Tok(SPREAD, position, position + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(COLON, position, position + 1, line, col, prev);\n // =\n case 61:\n return new Tok(EQUALS, position, position + 1, line, col, prev);\n // @\n case 64:\n return new Tok(AT, position, position + 1, line, col, prev);\n // [\n case 91:\n return new Tok(BRACKET_L, position, position + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(BRACKET_R, position, position + 1, line, col, prev);\n // {\n case 123:\n return new Tok(BRACE_L, position, position + 1, line, col, prev);\n // |\n case 124:\n return new Tok(PIPE, position, position + 1, line, col, prev);\n // }\n case 125:\n return new Tok(BRACE_R, position, position + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, position, line, col, prev);\n // - 0-9\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 return readNumber(source, position, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n return readBlockString(source, position, line, col, prev);\n }\n return readString(source, position, line, col, prev);\n }\n\n throw (0, _error.syntaxError)(source, position, unexpectedCharacterMessage(code));\n}\n\n/**\n * Report a message that an unexpected character was encountered.\n */\nfunction unexpectedCharacterMessage(code) {\n if (code === 39) {\n // '\n return \"Unexpected single quote character ('), did you mean to use \" + 'a double quote (\")?';\n }\n\n return 'Cannot parse the unexpected character ' + printCharCode(code) + '.';\n}\n\n/**\n * Reads from body starting at startPosition until it finds a non-whitespace\n * or commented character, then returns the position of that character for\n * lexing.\n */\nfunction positionAfterWhitespace(body, startPosition, lexer) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // tab | space | comma | BOM\n if (code === 9 || code === 32 || code === 44 || code === 0xfeff) {\n ++position;\n } else if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (charCodeAt.call(body, position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n } else {\n break;\n }\n }\n return position;\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code = void 0;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && (\n // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n}\n\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = charCodeAt.call(body, ++position);\n }\n\n if (code === 48) {\n // 0\n code = charCodeAt.call(body, ++position);\n if (code >= 48 && code <= 57) {\n throw (0, _error.syntaxError)(source, position, 'Invalid number, unexpected digit after 0: ' + printCharCode(code) + '.');\n }\n } else {\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n if (code === 43 || code === 45) {\n // + -\n code = charCodeAt.call(body, ++position);\n }\n position = readDigits(source, position, code);\n }\n\n return new Tok(isFloat ? FLOAT : INT, start, position, line, col, prev, slice.call(body, start, position));\n}\n\n/**\n * Returns the new position in the source after reading digits.\n */\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = charCodeAt.call(body, ++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n return position;\n }\n throw (0, _error.syntaxError)(source, position, 'Invalid number, expected digit but got: ' + printCharCode(code) + '.');\n}\n\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null &&\n // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += slice.call(body, chunkStart, position);\n return new Tok(STRING, start, position + 1, line, col, prev, value);\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n ++position;\n if (code === 92) {\n // \\\n value += slice.call(body, chunkStart, position - 1);\n code = charCodeAt.call(body, position);\n switch (code) {\n case 34:\n value += '\"';\n break;\n case 47:\n value += '/';\n break;\n case 92:\n value += '\\\\';\n break;\n case 98:\n value += '\\b';\n break;\n case 102:\n value += '\\f';\n break;\n case 110:\n value += '\\n';\n break;\n case 114:\n value += '\\r';\n break;\n case 116:\n value += '\\t';\n break;\n case 117:\n // u\n var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));\n if (charCode < 0) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: ' + ('\\\\u' + body.slice(position + 1, position + 5) + '.'));\n }\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n default:\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: \\\\' + String.fromCharCode(code) + '.');\n }\n ++position;\n chunkStart = position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\nfunction readBlockString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n rawValue += slice.call(body, chunkStart, position);\n return new Tok(BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockStringValue2.default)(rawValue));\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n // Escape Triple-Quote (\\\"\"\")\n if (code === 92 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34 && charCodeAt.call(body, position + 3) === 34) {\n rawValue += slice.call(body, chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Converts four hexidecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\nfunction readName(source, position, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var end = position + 1;\n var code = 0;\n while (end !== bodyLength && (code = charCodeAt.call(body, end)) !== null && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++end;\n }\n return new Tok(NAME, position, end, line, col, prev, slice.call(body, position, end));\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n// Name\n\nvar NAME = exports.NAME = 'Name';\n\n// Document\n\nvar DOCUMENT = exports.DOCUMENT = 'Document';\nvar OPERATION_DEFINITION = exports.OPERATION_DEFINITION = 'OperationDefinition';\nvar VARIABLE_DEFINITION = exports.VARIABLE_DEFINITION = 'VariableDefinition';\nvar VARIABLE = exports.VARIABLE = 'Variable';\nvar SELECTION_SET = exports.SELECTION_SET = 'SelectionSet';\nvar FIELD = exports.FIELD = 'Field';\nvar ARGUMENT = exports.ARGUMENT = 'Argument';\n\n// Fragments\n\nvar FRAGMENT_SPREAD = exports.FRAGMENT_SPREAD = 'FragmentSpread';\nvar INLINE_FRAGMENT = exports.INLINE_FRAGMENT = 'InlineFragment';\nvar FRAGMENT_DEFINITION = exports.FRAGMENT_DEFINITION = 'FragmentDefinition';\n\n// Values\n\nvar INT = exports.INT = 'IntValue';\nvar FLOAT = exports.FLOAT = 'FloatValue';\nvar STRING = exports.STRING = 'StringValue';\nvar BOOLEAN = exports.BOOLEAN = 'BooleanValue';\nvar NULL = exports.NULL = 'NullValue';\nvar ENUM = exports.ENUM = 'EnumValue';\nvar LIST = exports.LIST = 'ListValue';\nvar OBJECT = exports.OBJECT = 'ObjectValue';\nvar OBJECT_FIELD = exports.OBJECT_FIELD = 'ObjectField';\n\n// Directives\n\nvar DIRECTIVE = exports.DIRECTIVE = 'Directive';\n\n// Types\n\nvar NAMED_TYPE = exports.NAMED_TYPE = 'NamedType';\nvar LIST_TYPE = exports.LIST_TYPE = 'ListType';\nvar NON_NULL_TYPE = exports.NON_NULL_TYPE = 'NonNullType';\n\n// Type System Definitions\n\nvar SCHEMA_DEFINITION = exports.SCHEMA_DEFINITION = 'SchemaDefinition';\nvar OPERATION_TYPE_DEFINITION = exports.OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n\n// Type Definitions\n\nvar SCALAR_TYPE_DEFINITION = exports.SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\nvar OBJECT_TYPE_DEFINITION = exports.OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\nvar FIELD_DEFINITION = exports.FIELD_DEFINITION = 'FieldDefinition';\nvar INPUT_VALUE_DEFINITION = exports.INPUT_VALUE_DEFINITION = 'InputValueDefinition';\nvar INTERFACE_TYPE_DEFINITION = exports.INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\nvar UNION_TYPE_DEFINITION = exports.UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\nvar ENUM_TYPE_DEFINITION = exports.ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\nvar ENUM_VALUE_DEFINITION = exports.ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\nvar INPUT_OBJECT_TYPE_DEFINITION = exports.INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n\n// Type Extensions\n\nvar SCALAR_TYPE_EXTENSION = exports.SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\nvar OBJECT_TYPE_EXTENSION = exports.OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\nvar INTERFACE_TYPE_EXTENSION = exports.INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\nvar UNION_TYPE_EXTENSION = exports.UNION_TYPE_EXTENSION = 'UnionTypeExtension';\nvar ENUM_TYPE_EXTENSION = exports.ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\nvar INPUT_OBJECT_TYPE_EXTENSION = exports.INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n\n// Directive Definitions\n\nvar DIRECTIVE_DEFINITION = exports.DIRECTIVE_DEFINITION = 'DirectiveDefinition';","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation = exports.DirectiveLocation = {\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n};\n\n/**\n * The enum type representing the directive location values.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parse = parse;\nexports.parseValue = parseValue;\nexports.parseType = parseType;\nexports.parseConstValue = parseConstValue;\nexports.parseTypeReference = parseTypeReference;\nexports.parseNamedType = parseNamedType;\n\nvar _source = require('./source');\n\nvar _error = require('../error');\n\nvar _lexer = require('./lexer');\n\nvar _kinds = require('./kinds');\n\nvar _directiveLocation = require('./directiveLocation');\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\n\n\n/**\n * Configuration options to control parser behavior\n */\nfunction parse(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n if (!(sourceObj instanceof _source.Source)) {\n throw new TypeError('Must provide Source. Received: ' + String(sourceObj));\n }\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n return parseDocument(lexer);\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction parseValue(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var value = parseValueLiteral(lexer, false);\n expect(lexer, _lexer.TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\nfunction parseType(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.EOF);\n return type;\n}\n\n/**\n * Converts a name lex token into a name parse node.\n */\nfunction parseName(lexer) {\n var token = expect(lexer, _lexer.TokenKind.NAME);\n return {\n kind: _kinds.NAME,\n value: token.value,\n loc: loc(lexer, token)\n };\n}\n\n// Implements the parsing rules in the Document section.\n\n/**\n * Document : Definition+\n */\nfunction parseDocument(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SOF);\n var definitions = [];\n do {\n definitions.push(parseDefinition(lexer));\n } while (!skip(lexer, _lexer.TokenKind.EOF));\n\n return {\n kind: _kinds.DOCUMENT,\n definitions: definitions,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n */\nfunction parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n/**\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\nfunction parseExecutableDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseOperationDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n// Implements the parsing rules in the Operations section.\n\n/**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\nfunction parseOperationDefinition(lexer) {\n var start = lexer.token;\n if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n var operation = parseOperationType(lexer);\n var name = void 0;\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n name = parseName(lexer);\n }\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: parseVariableDefinitions(lexer),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationType : one of query mutation subscription\n */\nfunction parseOperationType(lexer) {\n var operationToken = expect(lexer, _lexer.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return 'query';\n case 'mutation':\n return 'mutation';\n case 'subscription':\n return 'subscription';\n }\n\n throw unexpected(lexer, operationToken);\n}\n\n/**\n * VariableDefinitions : ( VariableDefinition+ )\n */\nfunction parseVariableDefinitions(lexer) {\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, parseVariableDefinition, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * VariableDefinition : Variable : Type DefaultValue?\n */\nfunction parseVariableDefinition(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, _lexer.TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, _lexer.TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Variable : $ Name\n */\nfunction parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * SelectionSet : { Selection+ }\n */\nfunction parseSelectionSet(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.SELECTION_SET,\n selections: many(lexer, _lexer.TokenKind.BRACE_L, parseSelection, _lexer.TokenKind.BRACE_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\nfunction parseSelection(lexer) {\n return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}\n\n/**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\nfunction parseField(lexer) {\n var start = lexer.token;\n\n var nameOrAlias = parseName(lexer);\n var alias = void 0;\n var name = void 0;\n if (skip(lexer, _lexer.TokenKind.COLON)) {\n alias = nameOrAlias;\n name = parseName(lexer);\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: _kinds.FIELD,\n alias: alias,\n name: name,\n arguments: parseArguments(lexer, false),\n directives: parseDirectives(lexer, false),\n selectionSet: peek(lexer, _lexer.TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\nfunction parseArguments(lexer, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, item, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * Argument[Const] : Name : Value[?Const]\n */\nfunction parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}\n\nfunction parseConstArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseConstValue(lexer)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Fragments section.\n\n/**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\nfunction parseFragment(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SPREAD);\n if (peek(lexer, _lexer.TokenKind.NAME) && lexer.token.value !== 'on') {\n return {\n kind: _kinds.FRAGMENT_SPREAD,\n name: parseFragmentName(lexer),\n directives: parseDirectives(lexer, false),\n loc: loc(lexer, start)\n };\n }\n var typeCondition = void 0;\n if (lexer.token.value === 'on') {\n lexer.advance();\n typeCondition = parseNamedType(lexer);\n }\n return {\n kind: _kinds.INLINE_FRAGMENT,\n typeCondition: typeCondition,\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\nfunction parseFragmentDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'fragment');\n // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n if (lexer.options.experimentalFragmentVariables) {\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n variableDefinitions: parseVariableDefinitions(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentName : Name but not `on`\n */\nfunction parseFragmentName(lexer) {\n if (lexer.token.value === 'on') {\n throw unexpected(lexer);\n }\n return parseName(lexer);\n}\n\n// Implements the parsing rules in the Values section.\n\n/**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\nfunction parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}\n\nfunction parseStringLiteral(lexer) {\n var token = lexer.token;\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n block: token.kind === _lexer.TokenKind.BLOCK_STRING,\n loc: loc(lexer, token)\n };\n}\n\nfunction parseConstValue(lexer) {\n return parseValueLiteral(lexer, true);\n}\n\nfunction parseValueValue(lexer) {\n return parseValueLiteral(lexer, false);\n}\n\n/**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\nfunction parseList(lexer, isConst) {\n var start = lexer.token;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: _kinds.LIST,\n values: any(lexer, _lexer.TokenKind.BRACKET_L, item, _lexer.TokenKind.BRACKET_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\nfunction parseObject(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.BRACE_L);\n var fields = [];\n while (!skip(lexer, _lexer.TokenKind.BRACE_R)) {\n fields.push(parseObjectField(lexer, isConst));\n }\n return {\n kind: _kinds.OBJECT,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectField[Const] : Name : Value[?Const]\n */\nfunction parseObjectField(lexer, isConst) {\n var start = lexer.token;\n return {\n kind: _kinds.OBJECT_FIELD,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, isConst)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Directives section.\n\n/**\n * Directives[Const] : Directive[?Const]+\n */\nfunction parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}\n\n/**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\nfunction parseDirective(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.AT);\n return {\n kind: _kinds.DIRECTIVE,\n name: parseName(lexer),\n arguments: parseArguments(lexer, isConst),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Types section.\n\n/**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\nfunction parseTypeReference(lexer) {\n var start = lexer.token;\n var type = void 0;\n if (skip(lexer, _lexer.TokenKind.BRACKET_L)) {\n type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.BRACKET_R);\n type = {\n kind: _kinds.LIST_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n } else {\n type = parseNamedType(lexer);\n }\n if (skip(lexer, _lexer.TokenKind.BANG)) {\n return {\n kind: _kinds.NON_NULL_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n }\n return type;\n}\n\n/**\n * NamedType : Name\n */\nfunction parseNamedType(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.NAMED_TYPE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Type Definition section.\n\n/**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - TypeExtension\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\nfunction parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeDefinition(lexer);\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n case 'union':\n return parseUnionTypeDefinition(lexer);\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n case 'extend':\n return parseTypeExtension(lexer);\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\nfunction peekDescription(lexer) {\n return peek(lexer, _lexer.TokenKind.STRING) || peek(lexer, _lexer.TokenKind.BLOCK_STRING);\n}\n\n/**\n * Description : StringValue\n */\nfunction parseDescription(lexer) {\n if (peekDescription(lexer)) {\n return parseStringLiteral(lexer);\n }\n}\n\n/**\n * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ }\n */\nfunction parseSchemaDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = many(lexer, _lexer.TokenKind.BRACE_L, parseOperationTypeDefinition, _lexer.TokenKind.BRACE_R);\n return {\n kind: _kinds.SCHEMA_DEFINITION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationTypeDefinition : OperationType : NamedType\n */\nfunction parseOperationTypeDefinition(lexer) {\n var start = lexer.token;\n var operation = parseOperationType(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseNamedType(lexer);\n return {\n kind: _kinds.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\nfunction parseScalarTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\nfunction parseObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ImplementsInterfaces : implements NamedType+\n */\nfunction parseImplementsInterfaces(lexer) {\n var types = [];\n if (lexer.token.value === 'implements') {\n lexer.advance();\n do {\n types.push(parseNamedType(lexer));\n } while (peek(lexer, _lexer.TokenKind.NAME));\n }\n return types;\n}\n\n/**\n * FieldsDefinition : { FieldDefinition+ }\n */\nfunction parseFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseFieldDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\nfunction parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\nfunction parseArgumentDefs(lexer) {\n if (!peek(lexer, _lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer, _lexer.TokenKind.PAREN_L, parseInputValueDef, _lexer.TokenKind.PAREN_R);\n}\n\n/**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\nfunction parseInputValueDef(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var defaultValue = void 0;\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n defaultValue = parseConstValue(lexer);\n }\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\nfunction parseInterfaceTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? MemberTypesDefinition?\n */\nfunction parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * MemberTypesDefinition : = MemberTypes\n *\n * MemberTypes :\n * - `|`? NamedType\n * - MemberTypes | NamedType\n */\nfunction parseMemberTypesDefinition(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}\n\n/**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\nfunction parseEnumTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n return {\n kind: _kinds.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\nfunction parseEnumValuesDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseEnumValueDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\nfunction parseEnumValueDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\nfunction parseInputObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\nfunction parseInputFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseInputValueDef, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\nfunction parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\n/**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\nfunction parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\nfunction parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeExtension :\n * - extend interface Name Directives[Const]? FieldsDefinition\n * - extend interface Name Directives[Const]\n */\nfunction parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? MemberTypesDefinition\n * - extend union Name Directives[Const]\n */\nfunction parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\nfunction parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\nfunction parseInputObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? on DirectiveLocations\n */\nfunction parseDirectiveDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'directive');\n expect(lexer, _lexer.TokenKind.AT);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expectKeyword(lexer, 'on');\n var locations = parseDirectiveLocations(lexer);\n return {\n kind: _kinds.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n locations: locations,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\nfunction parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}\n\n/*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\nfunction parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n if (_directiveLocation.DirectiveLocation.hasOwnProperty(name.value)) {\n return name;\n }\n throw unexpected(lexer, start);\n}\n\n// Core parsing utility functions\n\n/**\n * Returns a location object, used to identify the place in\n * the source that created a given parsed object.\n */\nfunction loc(lexer, startToken) {\n if (!lexer.options.noLocation) {\n return new Loc(startToken, lexer.lastToken, lexer.source);\n }\n}\n\nfunction Loc(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nLoc.prototype.toJSON = Loc.prototype.inspect = function toJSON() {\n return { start: this.start, end: this.end };\n};\n\n/**\n * Determines if the next token is of a given kind\n */\nfunction peek(lexer, kind) {\n return lexer.token.kind === kind;\n}\n\n/**\n * If the next token is of the given kind, return true after advancing\n * the lexer. Otherwise, do not change the parser state and return false.\n */\nfunction skip(lexer, kind) {\n var match = lexer.token.kind === kind;\n if (match) {\n lexer.advance();\n }\n return match;\n}\n\n/**\n * If the next token is of the given kind, return that token after advancing\n * the lexer. Otherwise, do not change the parser state and throw an error.\n */\nfunction expect(lexer, kind) {\n var token = lexer.token;\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * If the next token is a keyword with the given value, return that token after\n * advancing the lexer. Otherwise, do not change the parser state and return\n * false.\n */\nfunction expectKeyword(lexer, value) {\n var token = lexer.token;\n if (token.kind === _lexer.TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected \"' + value + '\", found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Helper function for creating an error when an unexpected lexed token\n * is encountered.\n */\nfunction unexpected(lexer, atToken) {\n var token = atToken || lexer.token;\n return (0, _error.syntaxError)(lexer.source, token.start, 'Unexpected ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Returns a possibly empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction any(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}\n\n/**\n * Returns a non-empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction many(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [parseFn(lexer)];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.visit = visit;\nexports.visitInParallel = visitInParallel;\nexports.visitWithTypeInfo = visitWithTypeInfo;\nexports.getVisitFn = getVisitFn;\n\n\n/**\n * A visitor is comprised of visit functions, which are called on each node\n * during the visitor's traversal.\n */\n\n\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar QueryDocumentKeys = exports.QueryDocumentKeys = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name',\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations']\n};\n\n/**\n * A KeyMap describes each the traversable properties of each kind of node.\n */\nvar BREAK = exports.BREAK = {};\n\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\nfunction visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n node = clone;\n }\n var editOffset = 0;\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n if (inArray) {\n editKey -= editOffset;\n }\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n if (node === null || node === undefined) {\n continue;\n }\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + JSON.stringify(node));\n }\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n if (parent) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\nfunction visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\nfunction visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}\n\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\nfunction getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n var specificKindVisitor = specificVisitor[kind];\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.print = print;\n\nvar _visitor = require('./visitor');\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\nfunction print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n\n // Document\n\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet;\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n\n\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue;\n return variable + ': ' + type + wrap(' = ', defaultValue);\n },\n\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n\n // Fragments\n\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'fragment ' + name + wrap('(', join(variableDefinitions, ', '), ')') + ' ' + ('on ' + typeCondition + ' ' + wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n\n // Value\n\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return JSON.stringify(value);\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n\n // Directive\n\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n\n // Type\n\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n\n // Type System Definitions\n\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n\n ScalarTypeDefinition: function ScalarTypeDefinition(_ref22) {\n var description = _ref22.description,\n name = _ref22.name,\n directives = _ref22.directives;\n return join([description, join(['scalar', name, join(directives, ' ')], ' ')], '\\n');\n },\n\n ObjectTypeDefinition: function ObjectTypeDefinition(_ref23) {\n var description = _ref23.description,\n name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join([description, join(['type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n FieldDefinition: function FieldDefinition(_ref24) {\n var description = _ref24.description,\n name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return join([description, name + wrap('(', join(args, ', '), ')') + ': ' + type + wrap(' ', join(directives, ' '))], '\\n');\n },\n\n InputValueDefinition: function InputValueDefinition(_ref25) {\n var description = _ref25.description,\n name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([description, join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ')], '\\n');\n },\n\n InterfaceTypeDefinition: function InterfaceTypeDefinition(_ref26) {\n var description = _ref26.description,\n name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join([description, join(['interface', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n UnionTypeDefinition: function UnionTypeDefinition(_ref27) {\n var description = _ref27.description,\n name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join([description, join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ')], '\\n');\n },\n\n EnumTypeDefinition: function EnumTypeDefinition(_ref28) {\n var description = _ref28.description,\n name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join([description, join(['enum', name, join(directives, ' '), block(values)], ' ')], '\\n');\n },\n\n EnumValueDefinition: function EnumValueDefinition(_ref29) {\n var description = _ref29.description,\n name = _ref29.name,\n directives = _ref29.directives;\n return join([description, join([name, join(directives, ' ')], ' ')], '\\n');\n },\n\n InputObjectTypeDefinition: function InputObjectTypeDefinition(_ref30) {\n var description = _ref30.description,\n name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join([description, join(['input', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n ScalarTypeExtension: function ScalarTypeExtension(_ref31) {\n var name = _ref31.name,\n directives = _ref31.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n\n ObjectTypeExtension: function ObjectTypeExtension(_ref32) {\n var name = _ref32.name,\n interfaces = _ref32.interfaces,\n directives = _ref32.directives,\n fields = _ref32.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ');\n },\n\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives,\n fields = _ref33.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n\n UnionTypeExtension: function UnionTypeExtension(_ref34) {\n var name = _ref34.name,\n directives = _ref34.directives,\n types = _ref34.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n\n EnumTypeExtension: function EnumTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n values = _ref35.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n fields = _ref36.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n },\n\n DirectiveDefinition: function DirectiveDefinition(_ref37) {\n var description = _ref37.description,\n name = _ref37.name,\n args = _ref37.arguments,\n locations = _ref37.locations;\n return join([description, 'directive @' + name + wrap('(', join(args, ', '), ')') + ' on ' + join(locations, ' | ')], '\\n');\n }\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\nfunction block(array) {\n return array && array.length !== 0 ? indent('{\\n' + join(array, '\\n')) + '\\n}' : '';\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && maybeString.replace(/\\n/g, '\\n ');\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\nfunction printBlockString(value, isDescription) {\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n}","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, false, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = clone;\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Upper cased words. E.g. \"HELLO\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word\n * @param {number} count\n * @param {boolean} inclusive\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['whiskey', 'whiskies']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/(m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/(m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],\n [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'alcohol',\n 'ammo',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'manga',\n 'news',\n 'pike',\n 'plankton',\n 'pliers',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transporation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","import { parse } from \"graphql/language/parser\";\nimport { print } from \"graphql/language/printer\";\nimport { DocumentNode } from \"graphql/language/ast\";\n\n// @ts-ignore\nimport lodashIsEqual from \"lodash.isequal\";\n\n// @ts-ignore\nimport lodashClone from \"lodash.clone\";\n\n// @ts-ignore\nimport pluralizeLib from \"pluralize\";\nexport const pluralize = pluralizeLib.plural;\nexport const singularize = pluralizeLib.singular;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function upcaseFirstLetter(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n\n/**\n * Down cases the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function downcaseFirstLetter(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n\n/**\n * Takes a string with a graphql query and formats it. Useful for debug output and the tests.\n * @param {string} query\n * @returns {string}\n */\nexport function prettify(query: string | DocumentNode): string {\n return print(parseQuery(query));\n}\n\n/**\n * Returns a parsed query as GraphQL AST DocumentNode.\n *\n * @param {string | DocumentNode} query - Query as string or GraphQL AST DocumentNode.\n *\n * @returns {DocumentNode} Query as GraphQL AST DocumentNode.\n */\nexport function parseQuery(query: string | DocumentNode): DocumentNode {\n return typeof query === \"string\" ? parse(query) : query;\n}\n\n/**\n * @param {DocumentNode} query - The GraphQL AST DocumentNode.\n *\n * @returns {string} the GraphQL query within a DocumentNode as a plain string.\n */\nexport function graphQlDocumentToString(query: DocumentNode): string {\n return query.loc!.source.body;\n}\n\n/**\n * Tells if a object is just a simple object.\n *\n * @param {any} obj - Value to check.\n */\nexport function isPlainObject(obj: any): boolean {\n // Basic check for Type object that's not null\n return obj !== null && !(obj instanceof Array) && typeof obj === \"object\";\n}\n\n/**\n * Creates an object composed of the picked `object` properties.\n * @param {object} object - Object.\n * @param {array} props - Properties to pick.\n */\nexport function pick(object: any, props: Array) {\n if (!object) {\n return {};\n }\n\n let index = -1;\n const length = props.length;\n const result = {};\n\n while (++index < length) {\n const prop = props[index];\n result[prop] = object[prop];\n }\n\n return result;\n}\n\nexport function isEqual(a: object, b: object): boolean {\n // Couldn' find a simpler working implementation yet.\n return lodashIsEqual(a, b);\n}\n\nexport function clone(input: any): any {\n // Couldn' find a simpler working implementation yet.\n return lodashClone(input);\n}\n\nexport function takeWhile(\n array: Array,\n predicate: (x: any, idx: number, array: Array) => any\n) {\n let index = -1;\n\n while (++index < array.length && predicate(array[index], index, array)) {\n // just increase index\n }\n\n return array.slice(0, index);\n}\n\nexport function matches(source: any) {\n source = clone(source);\n\n return (object: any) => isEqual(object, source);\n}\n\nexport function removeSymbols(input: any) {\n return JSON.parse(JSON.stringify(input));\n}\n","import { DocumentNode } from \"graphql/language/ast\";\nimport { Arguments } from \"../support/interfaces\";\nimport { FetchPolicy } from \"apollo-client\";\nimport { isPlainObject, prettify } from \"../support/utils\";\n\n/**\n * Vuex-ORM-Apollo Debug Logger.\n * Wraps console and only logs if enabled.\n *\n * Also contains some methods to format graphql queries for the output\n */\nexport default class Logger {\n /**\n * Tells if any logging should happen\n * @type {boolean}\n */\n private readonly enabled: boolean;\n\n /**\n * Fancy Vuex-ORM-Apollo prefix for all log messages.\n * @type {string[]}\n */\n private readonly PREFIX = [\n \"%c Vuex-ORM: GraphQL Plugin %c\",\n \"background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;\",\n \"background: transparent;\"\n ];\n\n /**\n * @constructor\n * @param {boolean} enabled Tells if any logging should happen\n */\n public constructor(enabled: boolean) {\n this.enabled = enabled;\n this.log(\"Logging is enabled.\");\n }\n\n /**\n * Wraps console.group. In TEST env console.log is used instead because console.group doesn't work on CLI.\n * If available console.groupCollapsed will be used instead.\n * @param {Array} messages\n */\n public group(...messages: Array): void {\n if (this.enabled) {\n if (console.groupCollapsed) {\n console.groupCollapsed(...this.PREFIX, ...messages);\n } else {\n console.log(...this.PREFIX, ...messages);\n }\n }\n }\n\n /**\n * Wrapper for console.groupEnd. In TEST env nothing happens because console.groupEnd doesn't work on CLI.\n */\n public groupEnd(): void {\n if (this.enabled && console.groupEnd) console.groupEnd();\n }\n\n /**\n * Wrapper for console.log.\n * @param {Array} messages\n */\n public log(...messages: Array): void {\n if (this.enabled) {\n console.log(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Wrapper for console.warn.\n * @param {Array} messages\n */\n public warn(...messages: Array): void {\n if (this.enabled) {\n console.warn(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Logs a graphql query in a readable format and with all information like fetch policy and variables.\n * @param {string | DocumentNode} query\n * @param {Arguments} variables\n * @param {FetchPolicy} fetchPolicy\n */\n public logQuery(query: string | DocumentNode, variables?: Arguments, fetchPolicy?: FetchPolicy) {\n if (this.enabled) {\n try {\n let prettified = \"\";\n if (isPlainObject(query) && (query as DocumentNode).loc) {\n prettified = prettify((query as DocumentNode).loc!.source.body);\n } else {\n prettified = prettify(query as string);\n }\n\n this.group(\n \"Sending query:\",\n prettified\n .split(\"\\n\")[1]\n .replace(\"{\", \"\")\n .trim()\n );\n console.log(prettified);\n\n if (variables) console.log(\"VARIABLES:\", variables);\n if (fetchPolicy) console.log(\"FETCH POLICY:\", fetchPolicy);\n\n this.groupEnd();\n } catch (e) {\n console.error(\"[Vuex-ORM-Apollo] There is a syntax error in the query!\", e, query);\n }\n }\n }\n}\n","import { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport { Field, PatchedModel } from \"../support/interfaces\";\nimport Context from \"../common/context\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport { pluralize, singularize, pick, isEqual } from \"../support/utils\";\n\n/**\n * Wrapper around a Vuex-ORM model with some useful methods.\n *\n * Also provides a mock system, to define mocking responses for actions.\n */\nexport default class Model {\n /**\n * The singular name of a model like `blogPost`\n * @type {string}\n */\n public readonly singularName: string;\n\n /**\n * The plural name of a model like `blogPosts`\n * @type {string}\n */\n public readonly pluralName: string;\n\n /**\n * The original Vuex-ORM model\n */\n public readonly baseModel: typeof PatchedModel;\n\n /**\n * The fields of the model\n * @type {Map}\n */\n public readonly fields: Map = new Map();\n\n /**\n * Container for the mocks.\n * @type {Object}\n */\n private mocks: { [key: string]: Array } = {};\n\n /**\n * @constructor\n * @param {Model} baseModel The original Vuex-ORM model\n */\n public constructor(baseModel: typeof ORMModel) {\n this.baseModel = baseModel as typeof PatchedModel;\n\n // Generate name variants\n this.singularName = singularize(this.baseModel.entity);\n this.pluralName = pluralize(this.baseModel.entity);\n\n // Cache the fields of the model in this.fields\n const fields = this.baseModel.fields();\n Object.keys(fields).forEach((name: string) => {\n this.fields.set(name, fields[name] as Field);\n });\n }\n\n /**\n * Tells if a field is a numeric field.\n *\n * @param {Field | undefined} field\n * @returns {boolean}\n */\n public static isFieldNumber(field: Field | undefined): boolean {\n if (!field) return false;\n\n const context = Context.getInstance();\n return (\n field instanceof context.components.Number || field instanceof context.components.Increment\n );\n }\n\n /**\n * Tells if a field is a attribute (and thus not a relation)\n * @param {Field} field\n * @returns {boolean}\n */\n public static isFieldAttribute(field: Field): boolean {\n const context = Context.getInstance();\n\n return (\n field instanceof context.components.Increment ||\n field instanceof context.components.Attr ||\n field instanceof context.components.String ||\n field instanceof context.components.Number ||\n field instanceof context.components.Boolean\n );\n }\n\n /**\n * Tells if a field which represents a relation is a connection (multiple).\n * @param {Field} field\n * @returns {boolean}\n */\n public static isConnection(field: Field): boolean {\n const context = Context.getInstance();\n\n return !(\n field instanceof context.components.BelongsTo ||\n field instanceof context.components.HasOne ||\n field instanceof context.components.MorphTo ||\n field instanceof context.components.MorphOne\n );\n }\n\n /**\n * Adds $isPersisted and other meta fields to the model by overwriting the fields() method.\n * @todo is this a good way to add fields?\n * @param {Model} model\n */\n public static augment(model: Model) {\n const originalFieldGenerator = model.baseModel.fields.bind(model.baseModel);\n\n model.baseModel.fields = () => {\n const originalFields = originalFieldGenerator();\n\n originalFields[\"$isPersisted\"] = model.baseModel.boolean(false);\n\n return originalFields;\n };\n }\n\n /**\n * Returns the related model for a relation.\n * @param {Field|undefined} relation Relation field.\n * @returns {Model|null}\n */\n public static getRelatedModel(relation?: Relation) {\n if (relation === undefined) return null;\n\n const context: Context = Context.getInstance();\n\n if (\n relation instanceof context.components.BelongsToMany ||\n relation instanceof context.components.HasMany ||\n relation instanceof context.components.HasManyThrough ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphToMany ||\n relation instanceof context.components.HasOne\n ) {\n return context.getModel(relation.related.entity, true);\n } else if (\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasManyBy\n ) {\n return context.getModel(relation.parent.entity, true);\n } else if (relation instanceof context.components.MorphTo) {\n return context.getModel(relation.type, true);\n } else {\n console.warn(\"Failed relation\", typeof relation, relation);\n throw new Error(`Can't find related model for relation of type ${typeof relation}!`);\n }\n }\n\n /**\n * Returns all fields which should be included in a graphql query: All attributes which are not included in the\n * skipFields array or start with $.\n * @returns {Array} field names which should be queried\n */\n public getQueryFields(): Array {\n const fields: Array = [];\n\n this.fields.forEach((field: Field, name: string) => {\n if (Model.isFieldAttribute(field) && !this.skipField(name)) {\n fields.push(name);\n }\n });\n\n return fields;\n }\n\n /**\n * Tells if a field should be ignored. This is true for fields that start with a `$` or is it is within the skipField\n * property or is the foreignKey of a belongsTo/hasOne relation.\n *\n * @param {string} field\n * @returns {boolean}\n */\n public skipField(field: string) {\n if (field.startsWith(\"$\")) return true;\n if (this.baseModel.skipFields && this.baseModel.skipFields.indexOf(field) >= 0) return true;\n\n const context = Context.getInstance();\n\n let shouldSkipField: boolean = false;\n\n this.getRelations().forEach((relation: Relation) => {\n if (\n (relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasOne) &&\n relation.foreignKey === field\n ) {\n shouldSkipField = true;\n return false;\n }\n return true;\n });\n\n return shouldSkipField;\n }\n\n /**\n * @returns {Map} all relations of the model.\n */\n public getRelations(): Map {\n const relations = new Map();\n\n this.fields.forEach((field: Field, name: string) => {\n if (!Model.isFieldAttribute(field)) {\n relations.set(name, field as Relation);\n }\n });\n\n return relations;\n }\n\n /**\n * This accepts a field like `subjectType` and checks if this is just randomly named `...Type` or it is part\n * of a polymorphic relation.\n * @param {string} name\n * @returns {boolean}\n */\n public isTypeFieldOfPolymorphicRelation(name: string): boolean {\n const context = Context.getInstance();\n let found: boolean = false;\n\n context.models.forEach(model => {\n if (found) return false;\n\n model.getRelations().forEach(relation => {\n if (\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphTo ||\n relation instanceof context.components.MorphToMany\n ) {\n const related = (relation as Field).related;\n\n if (relation.type === name && related && related.entity === this.baseModel.entity) {\n found = true;\n return false; // break\n }\n }\n\n return true;\n });\n\n return true;\n });\n\n return found;\n }\n\n /**\n * Returns a record of this model with the given ID.\n * @param {number} id\n * @returns {any}\n */\n public getRecordWithId(id: number) {\n return this.baseModel\n .query()\n .withAllRecursive()\n .where(\"id\", id)\n .first();\n }\n\n /**\n * Determines if we should eager load (means: add as a field in the graphql query) a related entity. belongsTo,\n * hasOne and morphOne related entities are always eager loaded. Others can be added to the `eagerLoad` array\n * or `eagerSync` of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerLoadRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // HasOne, BelongsTo and MorphOne are always eager loaded\n if (\n relation instanceof context.components.HasOne ||\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.MorphOne\n ) {\n return true;\n }\n\n // Create a list of all relations that have to be eager loaded\n const eagerLoadList: Array = this.baseModel.eagerLoad || [];\n Array.prototype.push.apply(eagerLoadList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerLoadList.\n return (\n eagerLoadList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Determines if we should eager save (means: add as a field in the graphql mutation) a related entity. belongsTo\n * related entities are always eager saved. Others can be added to the `eagerSave` or `eagerSync` array of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerSaveRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // BelongsTo is always eager saved\n if (relation instanceof context.components.BelongsTo) {\n return true;\n }\n\n // Create a list of all relations that have to be eager saved\n const eagerSaveList: Array = this.baseModel.eagerSave || [];\n Array.prototype.push.apply(eagerSaveList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerSaveList.\n return (\n eagerSaveList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Adds a mock.\n *\n * @param {Mock} mock - Mock config.\n * @returns {boolean}\n */\n public $addMock(mock: Mock): boolean {\n if (this.$findMock(mock.action, mock.options)) return false;\n if (!this.mocks[mock.action]) this.mocks[mock.action] = [];\n\n this.mocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions like { variables: { id: 42 } }.\n * @returns {Mock | null} null when no mock was found.\n */\n public $findMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.mocks[action]) {\n return (\n this.mocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by all actions in order to get the mock returnValue.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public $mockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.$findMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n if (returnValue) {\n if (returnValue instanceof Array) {\n returnValue.forEach(r => (r.$isPersisted = true));\n } else {\n returnValue.$isPersisted = true;\n }\n\n return { [this.pluralName]: returnValue };\n }\n\n return null;\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","// Provides the methods that allow QueryManager to handle\r\n// the `skip` and `include` directives within GraphQL.\r\nimport {\r\n FieldNode,\r\n OperationDefinitionNode,\r\n SelectionNode,\r\n VariableNode,\r\n BooleanValueNode,\r\n DirectiveNode,\r\n DocumentNode,\r\n} from 'graphql';\r\n\r\nimport { argumentsObjectFromField } from './storeUtils';\r\n\r\nexport type DirectiveInfo = {\r\n [fieldName: string]: { [argName: string]: any };\r\n};\r\n\r\nexport function getDirectiveInfoFromField(\r\n field: FieldNode,\r\n variables: Object,\r\n): DirectiveInfo {\r\n if (field.directives && field.directives.length) {\r\n const directiveObj: DirectiveInfo = {};\r\n field.directives.forEach((directive: DirectiveNode) => {\r\n directiveObj[directive.name.value] = argumentsObjectFromField(\r\n directive,\r\n variables,\r\n );\r\n });\r\n return directiveObj;\r\n }\r\n return null;\r\n}\r\n\r\nexport function shouldInclude(\r\n selection: SelectionNode,\r\n variables: { [name: string]: any } = {},\r\n): boolean {\r\n if (!selection.directives) {\r\n return true;\r\n }\r\n\r\n let res: boolean = true;\r\n selection.directives.forEach(directive => {\r\n // TODO should move this validation to GraphQL validation once that's implemented.\r\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\r\n // Just don't worry about directives we don't understand\r\n return;\r\n }\r\n\r\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\r\n const directiveArguments = directive.arguments || [];\r\n const directiveName = directive.name.value;\r\n if (directiveArguments.length !== 1) {\r\n throw new Error(\r\n `Incorrect number of arguments for the @${directiveName} directive.`,\r\n );\r\n }\r\n\r\n const ifArgument = directiveArguments[0];\r\n if (!ifArgument.name || ifArgument.name.value !== 'if') {\r\n throw new Error(`Invalid argument for the @${directiveName} directive.`);\r\n }\r\n\r\n const ifValue = directiveArguments[0].value;\r\n let evaledValue: boolean = false;\r\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\r\n // means it has to be a variable value if this is a valid @skip or @include directive\r\n if (ifValue.kind !== 'Variable') {\r\n throw new Error(\r\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\r\n );\r\n } else {\r\n evaledValue = variables[(ifValue as VariableNode).name.value];\r\n if (evaledValue === undefined) {\r\n throw new Error(\r\n `Invalid variable referenced in @${directiveName} directive.`,\r\n );\r\n }\r\n }\r\n } else {\r\n evaledValue = (ifValue as BooleanValueNode).value;\r\n }\r\n\r\n if (directiveName === 'skip') {\r\n evaledValue = !evaledValue;\r\n }\r\n\r\n if (!evaledValue) {\r\n res = false;\r\n }\r\n });\r\n\r\n return res;\r\n}\r\n\r\nexport function flattenSelections(selection: SelectionNode): SelectionNode[] {\r\n if (\r\n !(selection as FieldNode).selectionSet ||\r\n !((selection as FieldNode).selectionSet.selections.length > 0)\r\n )\r\n return [selection];\r\n\r\n return [selection].concat(\r\n (selection as FieldNode).selectionSet.selections\r\n .map(selectionNode =>\r\n [selectionNode].concat(flattenSelections(selectionNode)),\r\n )\r\n .reduce((selections, selected) => selections.concat(selected), []),\r\n );\r\n}\r\n\r\nexport function getDirectiveNames(doc: DocumentNode) {\r\n // operation => [names of directives];\r\n const directiveNames = doc.definitions\r\n .filter(\r\n (definition: OperationDefinitionNode) =>\r\n definition.selectionSet && definition.selectionSet.selections,\r\n )\r\n // operation => [[Selection]]\r\n .map(x => flattenSelections(x as any))\r\n // [[Selection]] => [Selection]\r\n .reduce((selections, selected) => selections.concat(selected), [])\r\n // [Selection] => [Selection with Directives]\r\n .filter(\r\n (selection: SelectionNode) =>\r\n selection.directives && selection.directives.length > 0,\r\n )\r\n // [Selection with Directives] => [[Directives]]\r\n .map((selection: SelectionNode) => selection.directives)\r\n // [[Directives]] => [Directives]\r\n .reduce((directives, directive) => directives.concat(directive), [])\r\n // [Directives] => [Name]\r\n .map((directive: DirectiveNode) => directive.name.value);\r\n return directiveNames;\r\n}\r\n\r\nexport function hasDirectives(names: string[], doc: DocumentNode) {\r\n return getDirectiveNames(doc).some(\r\n (name: string) => names.indexOf(name) > -1,\r\n );\r\n}\r\n","/**\r\n * Adds the properties of one or more source objects to a target object. Works exactly like\r\n * `Object.assign`, but as a utility to maintain support for IE 11.\r\n *\r\n * @see https://github.com/apollostack/apollo-client/pull/1009\r\n */\r\nexport function assign(a: A, b: B): A & B;\r\nexport function assign(a: A, b: B, c: C): A & B & C;\r\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\r\nexport function assign(\r\n a: A,\r\n b: B,\r\n c: C,\r\n d: D,\r\n e: E,\r\n): A & B & C & D & E;\r\nexport function assign(target: any, ...sources: Array): any;\r\nexport function assign(\r\n target: { [key: string]: any },\r\n ...sources: Array<{ [key: string]: any }>\r\n): { [key: string]: any } {\r\n sources.forEach(source => {\r\n if (typeof source === 'undefined' || source === null) {\r\n return;\r\n }\r\n Object.keys(source).forEach(key => {\r\n target[key] = source[key];\r\n });\r\n });\r\n return target;\r\n}\r\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new Error(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new Error(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n DefinitionNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { cloneDeep } from './util/cloneDeep';\n\nimport {\n checkDocument,\n getOperationDefinitionOrDie,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n} from './getFromAST';\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isNotEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): Boolean {\n // keep selections that are still valid\n return (\n op.selectionSet.selections.filter(\n selectionSet =>\n // anything that doesn't match the compound filter is okay\n !// not an empty array\n (\n selectionSet &&\n // look into fragments to verify they should stay\n selectionSet.kind === 'FragmentSpread' &&\n // see if the fragment in the map is valid (recursively)\n !isNotEmpty(fragments[selectionSet.name.value], fragments)\n ),\n ).length > 0\n );\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode): Boolean {\n return directives.some(\n (dir: RemoveDirectiveConfig | GetDirectiveConfig) => {\n if (dir.name && dir.name === directive.name.value) return true;\n if (dir.test && dir.test(directive)) return true;\n return false;\n },\n );\n };\n}\n\nfunction addTypenameToSelectionSet(\n selectionSet: SelectionSetNode,\n isRoot = false,\n) {\n if (selectionSet.selections) {\n if (!isRoot) {\n const alreadyHasThisField = selectionSet.selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n });\n\n if (!alreadyHasThisField) {\n selectionSet.selections.push(TYPENAME_FIELD);\n }\n }\n\n selectionSet.selections.forEach(selection => {\n // Must not add __typename if we're inside an introspection query\n if (selection.kind === 'Field') {\n if (\n selection.name.value.lastIndexOf('__', 0) !== 0 &&\n selection.selectionSet\n ) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n } else if (selection.kind === 'InlineFragment') {\n if (selection.selectionSet) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n }\n });\n }\n}\n\nexport type RemoveDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n remove?: boolean;\n};\n\nfunction removeDirectivesFromSelectionSet(\n directives: RemoveDirectiveConfig[],\n selectionSet: SelectionSetNode,\n): SelectionSetNode {\n if (!selectionSet.selections) return selectionSet;\n // if any of the directives are set to remove this selectionSet, remove it\n const agressiveRemove = directives.some(\n (dir: RemoveDirectiveConfig) => dir.remove,\n );\n\n selectionSet.selections = selectionSet.selections\n .map(selection => {\n if (\n selection.kind !== 'Field' ||\n !(selection as FieldNode) ||\n !selection.directives\n )\n return selection;\n const directiveMatcher = getDirectiveMatcher(directives);\n let remove: boolean;\n selection.directives = selection.directives.filter(directive => {\n const shouldKeep = !directiveMatcher(directive);\n\n if (!remove && !shouldKeep && agressiveRemove) remove = true;\n\n return shouldKeep;\n });\n\n return remove ? null : selection;\n })\n .filter(x => !!x);\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n removeDirectivesFromSelectionSet(directives, selection.selectionSet);\n }\n });\n\n return selectionSet;\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n removeDirectivesFromSelectionSet(\n directives,\n (definition as OperationDefinitionNode).selectionSet,\n );\n });\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode) {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n const isRoot = definition.kind === 'OperationDefinition';\n addTypenameToSelectionSet(\n (definition as OperationDefinitionNode).selectionSet,\n isRoot,\n );\n });\n return docClone;\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n checkDocument(doc);\n return removeDirectivesFromDocument([connectionRemoveConfig], doc);\n}\n\nexport type GetDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n};\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n if (!(selectionSet && selectionSet.selections)) {\n return false;\n }\n const matchedSelections = selectionSet.selections.filter(selection => {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n });\n return matchedSelections.length > 0;\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n const directiveMatcher = getDirectiveMatcher(directives);\n const matchedDirectives = selection.directives.filter(directiveMatcher);\n return (\n matchedDirectives.length > 0 ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nfunction getDirectivesFromSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n) {\n selectionSet.selections = selectionSet.selections\n .filter(selection => {\n return hasDirectivesInSelection(directives, selection, true);\n })\n .map(selection => {\n if (hasDirectivesInSelection(directives, selection, false)) {\n return selection;\n }\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n selection.selectionSet = getDirectivesFromSelectionSet(\n directives,\n selection.selectionSet,\n );\n }\n return selection;\n });\n return selectionSet;\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n includeAllFragments = false,\n): DocumentNode | null {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n docClone.definitions = docClone.definitions.map(definition => {\n if (\n (definition.kind === 'OperationDefinition' ||\n (definition.kind === 'FragmentDefinition' && !includeAllFragments)) &&\n definition.selectionSet\n ) {\n definition.selectionSet = getDirectivesFromSelectionSet(\n directives,\n definition.selectionSet,\n );\n }\n return definition;\n });\n\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/networkStatus.ts"},"export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// === Symbol Support ===\n\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species');\n\n// === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n\n if (value == null) return undefined;\n\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n if (ctor === null) {\n ctor = undefined;\n }\n }\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n if (!queue) {\n return;\n }\n subscription._queue = undefined;\n subscription._state = 'ready';\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({ type: type, value: value });\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{ type: type, value: value }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = function () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: 'unsubscribe',\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: 'closed',\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = function () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: 'next',\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: 'error',\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: 'complete',\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: 'closed',\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = exports.Observable = function () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: 'subscribe',\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: 'forEach',\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: 'map',\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'filter',\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'reduce',\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'concat',\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscription = void 0;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: 'flatMap',\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: 'from',\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n\n if (x == null) throw new TypeError(x + ' is not an object');\n\n var method = getMethod(x, SymbolObservable);\n if (method) {\n var observable = method.call(x);\n\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n\n if (isObservable(observable) && observable.constructor === C) return observable;\n\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n\n observer.next(item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: 'of',\n value: function of() {\n for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n","module.exports = require('./lib/Observable.js').Observable;\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/util/Observable.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/errors/ApolloError.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/types.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/ObservableQuery.ts"},"import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n Observable,\n} from 'apollo-link';\n\n/*\n * Expects context to contain the forceFetch field if no dedup\n */\nexport class DedupLink extends ApolloLink {\n private inFlightRequestObservables: Map<\n string,\n Observable\n > = new Map();\n private subscribers: Map = new Map();\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable {\n // sometimes we might not want to deduplicate a request, for example when we want to force fetch it.\n if (operation.getContext().forceFetch) {\n return forward(operation);\n }\n\n const key = operation.toKey();\n\n const cleanup = operationKey => {\n this.inFlightRequestObservables.delete(operationKey);\n const prev = this.subscribers.get(operationKey);\n return prev;\n };\n\n if (!this.inFlightRequestObservables.get(key)) {\n // this is a new request, i.e. we haven't deduplicated it yet\n // call the next link\n const singleObserver = forward(operation);\n let subscription;\n\n const sharedObserver = new Observable(observer => {\n // this will still be called by each subscriber regardless of\n // deduplication status\n let prev = this.subscribers.get(key);\n if (!prev) prev = { next: [], error: [], complete: [] };\n\n this.subscribers.set(key, {\n next: prev.next.concat([observer.next.bind(observer)]),\n error: prev.error.concat([observer.error.bind(observer)]),\n complete: prev.complete.concat([observer.complete.bind(observer)]),\n });\n\n if (!subscription) {\n subscription = singleObserver.subscribe({\n next: result => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) {\n previous.next.forEach(next => next(result));\n previous.complete.forEach(complete => complete());\n }\n },\n error: error => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) previous.error.forEach(err => err(error));\n },\n });\n }\n\n return () => {\n if (subscription) subscription.unsubscribe();\n this.inFlightRequestObservables.delete(key);\n };\n });\n\n this.inFlightRequestObservables.set(key, sharedObserver);\n }\n\n // return shared Observable\n return this.inFlightRequestObservables.get(key);\n }\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/scheduler/scheduler.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/mutations.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/queries.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/core/QueryManager.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/data/store.ts"},"exports.version = \"2.4.6\"",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/home/viktor/proj/plugin-graphql/node_modules/src/ApolloClient.ts"},"import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\n(function (invariant) {\r\n function warn() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.warn.apply(console, args);\r\n }\r\n invariant.warn = warn;\r\n function error() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.error.apply(console, args);\r\n }\r\n invariant.error = error;\r\n})(invariant || (invariant = {}));\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant };\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n if (!selection.directives) {\n return true;\n }\n\n let res: boolean = true;\n selection.directives.forEach(directive => {\n // TODO should move this validation to GraphQL validation once that's implemented.\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\n // Just don't worry about directives we don't understand\n return;\n }\n\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\n const directiveArguments = directive.arguments || [];\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue = directiveArguments[0].value;\n let evaledValue: boolean = false;\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue.kind === 'Variable',\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n evaledValue = variables[(ifValue as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directiveName} directive.`,\n );\n } else {\n evaledValue = (ifValue as BooleanValueNode).value;\n }\n\n if (directiveName === 'skip') {\n evaledValue = !evaledValue;\n }\n\n if (!evaledValue) {\n res = false;\n }\n });\n\n return res;\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more then one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n ((selection as FieldNode).name.value === '__typename' ||\n (selection as FieldNode).name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n },\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","\"use strict\";\n\nfunction Cache(options) {\n this.map = new Map;\n this.newest = null;\n this.oldest = null;\n this.max = options && options.max;\n this.dispose = options && options.dispose;\n}\n\nexports.Cache = Cache;\n\nvar Cp = Cache.prototype;\n\nCp.has = function (key) {\n return this.map.has(key);\n};\n\nCp.get = function (key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n};\n\nfunction getEntry(cache, key) {\n var entry = cache.map.get(key);\n if (entry &&\n entry !== cache.newest) {\n var older = entry.older;\n var newer = entry.newer;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = cache.newest;\n entry.older.newer = entry;\n\n entry.newer = null;\n cache.newest = entry;\n\n if (entry === cache.oldest) {\n cache.oldest = newer;\n }\n }\n\n return entry;\n}\n\nCp.set = function (key, value) {\n var entry = getEntry(this, key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n};\n\nCp.clean = function () {\n if (typeof this.max === \"number\") {\n while (this.oldest &&\n this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n};\n\nCp.delete = function (key) {\n var entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n\n if (typeof this.dispose === \"function\") {\n this.dispose(key, entry.value);\n }\n\n return true;\n }\n\n return false;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Although `Symbol` is widely supported these days, we can safely fall\n// back to using a non-enumerable string property without violating any\n// assumptions elsewhere in the implementation.\nvar useSymbol =\n typeof Symbol === \"function\" &&\n typeof Symbol.for === \"function\";\n\n// Used to mark `tuple.prototype` so that all objects that inherit from\n// any `tuple.prototype` object (there could be more than one) will test\n// positive according to `tuple.isTuple`.\nvar brand = useSymbol\n ? Symbol.for(\"immutable-tuple\")\n : \"@@__IMMUTABLE_TUPLE__@@\";\n\n// Used to save a reference to the globally shared `UniversalWeakMap` that\n// stores all known `tuple` objects.\nvar globalKey = useSymbol\n ? Symbol.for(\"immutable-tuple-root\")\n : \"@@__IMMUTABLE_TUPLE_ROOT__@@\";\n\n// Convenient helper for defining hidden immutable properties.\nfunction def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}\n\nvar freeze = Object.freeze || function (obj) {\n return obj;\n};\n\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null) {\n return false;\n }\n case \"function\":\n return true;\n default:\n return false;\n }\n}\n\n// The `mustConvertThisToArray` value is true when the corresponding\n// `Array` method does not attempt to modify `this`, which means we can\n// pass a `tuple` object as `this` without first converting it to an\n// `Array`.\nfunction forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}\n\n// A map data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nvar UniversalWeakMap = function UniversalWeakMap() {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n this._weakMap = null;\n this._strongMap = null;\n this.data = null;\n};\n\n// Since `get` and `set` are the only methods used, that's all I've\n// implemented here.\n\nUniversalWeakMap.prototype.get = function get (key) {\n var map = this._getMap(key, false);\n if (map) {\n return map.get(key);\n }\n};\n\nUniversalWeakMap.prototype.set = function set (key, value) {\n this._getMap(key, true).set(key, value);\n // An actual `Map` or `WeakMap` would return `this` here, but\n // returning the `value` is more convenient for the `tuple`\n // implementation.\n return value;\n};\n\nUniversalWeakMap.prototype._getMap = function _getMap (key, canCreate) {\n if (! canCreate) {\n return isObjRef(key) ? this._weakMap : this._strongMap;\n }\n if (isObjRef(key)) {\n return this._weakMap || (this._weakMap = new WeakMap);\n }\n return this._strongMap || (this._strongMap = new Map);\n};\n\n// See [`universal-weak-map.js`](universal-weak-map.html).\n// See [`util.js`](util.html).\n// If this package is installed multiple times, there could be mutiple\n// implementations of the `tuple` function with distinct `tuple.prototype`\n// objects, but the shared pool of `tuple` objects must be the same across\n// all implementations. While it would be ideal to use the `global`\n// object, there's no reliable way to get the global object across all JS\n// environments without using the `Function` constructor, so instead we\n// use the global `Array` constructor as a shared namespace.\nvar root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);\n\nfunction lookup() {\n return lookupArray(arguments);\n}\n\nfunction lookupArray(array) {\n var node = root;\n\n // Because we are building a tree of *weak* maps, the tree will not\n // prevent objects in tuples from being garbage collected, since the\n // tree itself will be pruned over time when the corresponding `tuple`\n // objects become unreachable. In addition to internalization, this\n // property is a key advantage of the `immutable-tuple` package.\n var len = array.length;\n for (var i = 0; i < len; ++i) {\n var item = array[i];\n node = node.get(item) || node.set(item, new UniversalWeakMap);\n }\n\n // Return node.data rather than node itself to prevent tampering with\n // the UniversalWeakMap tree.\n return node.data || (node.data = Object.create(null));\n}\n\n// See [`lookup.js`](lookup.html).\n// See [`util.js`](util.html).\n// When called with any number of arguments, this function returns an\n// object that inherits from `tuple.prototype` and is guaranteed to be\n// `===` any other `tuple` object that has exactly the same items. In\n// computer science jargon, `tuple` instances are \"internalized\" or just\n// \"interned,\" which allows for constant-time equality checking, and makes\n// it possible for tuple objects to be used as `Map` or `WeakMap` keys, or\n// stored in a `Set`.\nfunction tuple() {\n var arguments$1 = arguments;\n\n var node = lookup.apply(null, arguments);\n\n if (node.tuple) {\n return node.tuple;\n }\n\n var t = Object.create(tuple.prototype);\n\n // Define immutable items with numeric indexes, and permanently fix the\n // `.length` property.\n var argc = arguments.length;\n for (var i = 0; i < argc; ++i) {\n t[i] = arguments$1[i];\n }\n\n def(t, \"length\", argc, false);\n\n // Remember this new `tuple` object so that we can return the same object\n // earlier next time.\n return freeze(node.tuple = t);\n}\n\n// Since the `immutable-tuple` package could be installed multiple times\n// in an application, there is no guarantee that the `tuple` constructor\n// or `tuple.prototype` will be unique, so `value instanceof tuple` is\n// unreliable. Instead, to test if a value is a tuple, you should use\n// `tuple.isTuple(value)`.\ndef(tuple.prototype, brand, true, false);\nfunction isTuple(that) {\n return !! (that && that[brand] === true);\n}\n\ntuple.isTuple = isTuple;\n\nfunction toArray(tuple) {\n var array = [];\n var i = tuple.length;\n while (i--) { array[i] = tuple[i]; }\n return array;\n}\n\n// Copy all generic non-destructive Array methods to `tuple.prototype`.\n// This works because (for example) `Array.prototype.slice` can be invoked\n// against any `Array`-like object.\nforEachArrayMethod(function (name, desc, mustConvertThisToArray) {\n var method = desc && desc.value;\n if (typeof method === \"function\") {\n desc.value = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = method.apply(\n mustConvertThisToArray ? toArray(this) : this,\n args\n );\n // Of course, `tuple.prototype.slice` should return a `tuple` object,\n // not a new `Array`.\n return Array.isArray(result) ? tuple.apply(void 0, result) : result;\n };\n Object.defineProperty(tuple.prototype, name, desc);\n }\n});\n\n// Like `Array.prototype.concat`, except for the extra effort required to\n// convert any tuple arguments to arrays, so that\n// ```\n// tuple(1).concat(tuple(2), 3) === tuple(1, 2, 3)\n// ```\nvar ref = Array.prototype;\nvar concat = ref.concat;\ntuple.prototype.concat = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return tuple.apply(void 0, concat.apply(toArray(this), args.map(\n function (item) { return isTuple(item) ? toArray(item) : item; }\n )));\n};\n\nexports.default = tuple;\nexports.tuple = tuple;\nexports.lookup = lookup;\nexports.lookupArray = lookupArray;\n","\"use strict\";\n\nvar fakeNullFiber = new (function Fiber(){});\nvar localKey = \"_optimism_local\";\n\nfunction getCurrentFiber() {\n return fakeNullFiber;\n}\n\nif (typeof module === \"object\") {\n try {\n var Fiber = module[\"eriuqer\".split(\"\").reverse().join(\"\")](\"fibers\");\n // If we were able to require fibers, redefine the getCurrentFiber\n // function so that it has a chance to return Fiber.current.\n getCurrentFiber = function () {\n return Fiber.current || fakeNullFiber;\n };\n } catch (e) {}\n}\n\n// Returns an object unique to Fiber.current, if fibers are enabled.\n// This object is used for Fiber-local storage in ./entry.js.\nexports.get = function () {\n var fiber = getCurrentFiber();\n return fiber[localKey] || (fiber[localKey] = Object.create(null));\n};\n","\"use strict\";\n\nvar getLocal = require(\"./local.js\").get;\nvar UNKNOWN_VALUE = Object.create(null);\nvar emptySetPool = [];\nvar entryPool = [];\n\n// Don't let the emptySetPool or entryPool grow larger than this size,\n// since unconstrained pool growth could lead to memory leaks.\nexports.POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition, optionalMessage) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nfunction Entry(fn, key, args) {\n this.parents = new Set;\n this.childValues = new Map;\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n this.dirtyChildren = null;\n\n reset(this, fn, key, args);\n\n ++Entry.count;\n}\n\nEntry.count = 0;\n\nfunction reset(entry, fn, key, args) {\n entry.fn = fn;\n entry.key = key;\n entry.args = args;\n entry.value = UNKNOWN_VALUE;\n entry.dirty = true;\n entry.subscribe = null;\n entry.unsubscribe = null;\n entry.recomputing = false;\n // Optional callback that will be invoked when entry.parents becomes\n // empty. The Entry object is given as the first parameter. If the\n // callback returns true, then this entry can be removed from the graph\n // and safely recycled into the entryPool.\n entry.reportOrphan = null;\n}\n\nEntry.acquire = function (fn, key, args) {\n var entry = entryPool.pop();\n if (entry) {\n reset(entry, fn, key, args);\n return entry;\n }\n return new Entry(fn, key, args);\n};\n\nfunction release(entry) {\n assert(entry.parents.size === 0);\n assert(entry.childValues.size === 0);\n assert(entry.dirtyChildren === null);\n if (entryPool.length < exports.POOL_TARGET_SIZE) {\n entryPool.push(entry);\n }\n}\n\nexports.Entry = Entry;\n\nvar Ep = Entry.prototype;\n\n// The public API of Entry objects consists of the Entry constructor,\n// along with the recompute, setDirty, and dispose methods.\n\nEp.recompute = function recompute() {\n if (! rememberParent(this) &&\n maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispos(), which recycles it\n // into the entryPool, so we don't need to (and should not) proceed\n // with the recomputation.\n return;\n }\n\n return recomputeIfDirty(this);\n};\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry) {\n var report = entry.reportOrphan;\n return typeof report === \"function\" &&\n entry.parents.size === 0 &&\n report(entry) === true;\n}\n\nEp.setDirty = function setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n unsubscribe(this);\n};\n\nEp.dispose = function dispose() {\n var entry = this;\n forgetChildren(entry).forEach(maybeReportOrphan);\n unsubscribe(entry);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n entry.parents.forEach(function (parent) {\n parent.setDirty();\n forgetChild(parent, entry);\n });\n\n // Since this entry has no parents and no children anymore, and the\n // caller of Entry#dispose has indicated that entry.value no longer\n // matters, we can safely recycle this Entry object for later use.\n release(entry);\n};\n\nfunction setClean(entry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(entry) {\n entry.parents.forEach(function (parent) {\n reportDirtyChild(parent, entry);\n });\n}\n\nfunction reportClean(entry) {\n entry.parents.forEach(function (parent) {\n reportCleanChild(parent, entry);\n });\n}\n\nfunction mightBeDirty(entry) {\n return entry.dirty ||\n (entry.dirtyChildren &&\n entry.dirtyChildren.size);\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (entry.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n entry.dirtyChildren.add(child);\n reportDirty(entry);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(entry, child) {\n var cv = entry.childValues;\n\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(cv.has(child));\n assert(! mightBeDirty(child));\n\n var childValue = cv.get(child);\n if (childValue === UNKNOWN_VALUE) {\n cv.set(child, child.value);\n } else if (childValue !== child.value) {\n entry.setDirty();\n }\n\n removeDirtyChild(entry, child);\n\n if (mightBeDirty(entry)) {\n return;\n }\n\n reportClean(entry);\n}\n\nfunction removeDirtyChild(entry, child) {\n var dc = entry.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < exports.POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n entry.dirtyChildren = null;\n }\n }\n}\n\nfunction rememberParent(entry) {\n var local = getLocal();\n var parent = local.currentParentEntry;\n if (parent) {\n entry.parents.add(parent);\n\n if (! parent.childValues.has(entry)) {\n parent.childValues.set(entry, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(entry)) {\n reportDirtyChild(parent, entry);\n } else {\n reportCleanChild(parent, entry);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren.forEach(function (child) {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n var originalChildren = forgetChildren(entry);\n\n var local = getLocal();\n var parent = local.currentParentEntry;\n local.currentParentEntry = entry;\n\n var threw = true;\n try {\n entry.value = entry.fn.apply(null, entry.args);\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n assert(local.currentParentEntry === entry);\n local.currentParentEntry = parent;\n\n if (threw || ! subscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nvar reusableEmptyArray = [];\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(entry) {\n var children = reusableEmptyArray;\n\n if (entry.childValues.size > 0) {\n children = [];\n entry.childValues.forEach(function (value, child) {\n forgetChild(entry, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefor must have been reset to null.\n assert(entry.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(entry, child) {\n child.parents.delete(entry);\n entry.childValues.delete(child);\n removeDirtyChild(entry, child);\n}\n\nfunction subscribe(entry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n unsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction unsubscribe(entry) {\n var unsub = entry.unsubscribe;\n if (typeof unsub === \"function\") {\n entry.unsubscribe = null;\n unsub();\n }\n}\n","\"use strict\";\n\nvar Cache = require(\"./cache.js\").Cache;\nvar tuple = require(\"immutable-tuple\").tuple;\nvar Entry = require(\"./entry.js\").Entry;\nvar getLocal = require(\"./local.js\").get;\n\n// Exported so that custom makeCacheKey functions can easily reuse the\n// default implementation (with different arguments).\nexports.defaultMakeCacheKey = tuple;\n\nfunction normalizeOptions(options) {\n options = options || Object.create(null);\n\n if (typeof options.makeCacheKey !== \"function\") {\n options.makeCacheKey = tuple;\n }\n\n if (typeof options.max !== \"number\") {\n options.max = Math.pow(2, 16);\n }\n\n return options;\n}\n\nfunction wrap(fn, options) {\n options = normalizeOptions(options);\n\n // If this wrapped function is disposable, then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n var disposable = !! options.disposable;\n\n var cache = new Cache({\n max: options.max,\n dispose: function (key, entry) {\n entry.dispose();\n }\n });\n\n function reportOrphan(entry) {\n if (disposable) {\n // Triggers the entry.dispose() call above.\n cache.delete(entry.key);\n return true;\n }\n }\n\n function optimistic() {\n if (disposable && ! getLocal().currentParentEntry) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return;\n }\n\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return fn.apply(null, arguments);\n }\n\n var args = [], len = arguments.length;\n while (len--) args[len] = arguments[len];\n\n var entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n cache.set(key, entry = Entry.acquire(fn, key, args));\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = reportOrphan;\n }\n }\n\n var value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if this entry\n // has no parents, which means we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (entry.parents.size === 0) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n if (! disposable) {\n return value;\n }\n }\n\n optimistic.dirty = function () {\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return;\n }\n\n if (! cache.has(key)) {\n return;\n }\n\n cache.get(key).setDirty();\n };\n\n return optimistic;\n}\n\nexports.wrap = wrap;\n","// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n invariant(\n obj.__typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","export class CacheKeyNode {\n private children: Map> | null = null;\n private key: KeyType | null = null;\n\n lookup(...args: any[]): KeyType {\n return this.lookupArray(args);\n }\n\n lookupArray(array: any[]): KeyType {\n let node: CacheKeyNode = this;\n array.forEach(value => {\n node = node.getOrCreate(value);\n });\n return node.key || (node.key = Object.create(null));\n }\n\n getOrCreate(value: any): CacheKeyNode {\n const map = this.children || (this.children = new Map());\n let node = map.get(value);\n if (!node) {\n map.set(value, (node = new CacheKeyNode()));\n }\n return node;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<(dataId: string) => StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n assign,\n getDefaultValues,\n getQueryDefinition,\n isEqual,\n DirectiveInfo,\n FragmentMap,\n IdValue,\n StoreValue,\n argumentsObjectFromField,\n createFragmentMap,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getStoreKeyName,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n resultKeyNameFromField,\n shouldInclude,\n toIdValue,\n mergeDeepArray,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap } from 'optimism';\nimport { CacheKeyNode } from './cacheKeys';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\nexport class StoreReader {\n constructor(\n private cacheKeyRoot = new CacheKeyNode,\n ) {\n const reader = this;\n const {\n executeStoreQuery,\n executeSelectionSet,\n } = reader;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n query,\n contextValue.store,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n selectionSet,\n execContext.contextValue.store,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray(\n field,\n readStoreResult.result,\n execContext,\n ),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n result = result.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray(field, item, execContext));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n return { result, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const idValue = toIdValue({ id: 'self', typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ self: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { CacheKeyNode } from './cacheKeys';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new CacheKeyNode();\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeReader = new StoreReader(this.cacheKeyRoot);\n this.storeWriter = new StoreWriter();\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n","import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = Error & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new Error(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch is nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n","import Model from \"../orm/model\";\n\nexport enum ConnectionMode {\n AUTO,\n PLAIN,\n NODES,\n EDGES\n}\n\nexport enum ArgumentMode {\n TYPE,\n LIST\n}\n\nexport default interface Adapter {\n getRootQueryName(): string;\n getRootMutationName(): string;\n\n getNameForPersist(model: Model): string;\n getNameForPush(model: Model): string;\n getNameForDestroy(model: Model): string;\n getNameForFetch(model: Model, plural: boolean): string;\n\n getConnectionMode(): ConnectionMode;\n\n getArgumentMode(): ArgumentMode;\n\n getFilterTypeName(model: Model): string;\n getInputTypeName(model: Model, action?: string): string;\n\n prepareSchemaTypeName(name: string): string;\n}\n","import { Data, Field } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport Context from \"../common/context\";\nimport {\n clone,\n downcaseFirstLetter,\n isPlainObject,\n pluralize,\n singularize\n} from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\n\n/**\n * This class provides methods to transform incoming data from GraphQL in to a format Vuex-ORM understands and\n * vice versa.\n */\nexport default class Transformer {\n /**\n * Transforms outgoing data. Use for variables param.\n *\n * @param {Model} model Base model of the mutation/query\n * @param {Data} data Data to transform\n * @param {boolean} read Tells if this is a write or a read action. read is fetch, write is push and persist.\n * @param {Array} whitelist of fields\n * @param {Map>} outgoingRecords List of record IDs that are already added to the\n * outgoing data in order to detect recursion.\n * @param {boolean} recursiveCall Tells if it's a recursive call.\n * @returns {Data}\n */\n public static transformOutgoingData(\n model: Model,\n data: Data,\n read: boolean,\n whitelist?: Array,\n outgoingRecords?: Map>,\n recursiveCall?: boolean\n ): Data {\n const context = Context.getInstance();\n const relations: Map = model.getRelations();\n const returnValue: Data = {} as Data;\n if (outgoingRecords === undefined) outgoingRecords = new Map>();\n if (recursiveCall === undefined) recursiveCall = false;\n\n Object.keys(data).forEach(key => {\n const value = data[key];\n\n const isRelation = model.getRelations().has(key);\n let isRecursion = false;\n\n if (value instanceof Array) {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value[0]);\n } else {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value);\n }\n\n // shouldIncludeOutgoingField and the read param is tricky. In the initial call of this method\n // we want to include any relation, so we have to make sure it's false. In the recursive calls\n // it should be true when we transform the outgoing data for fetch (and false for the others)\n if (\n !isRecursion &&\n this.shouldIncludeOutgoingField(\n (recursiveCall as boolean) && read,\n key,\n value,\n model,\n whitelist\n )\n ) {\n let relatedModel = Model.getRelatedModel(relations.get(key)!);\n\n if (value instanceof Array) {\n // Either this is a hasMany field or a .attr() field which contains an array.\n const arrayModel = context.getModel(singularize(key), true);\n\n if (arrayModel) {\n this.addRecordForRecursionDetection(outgoingRecords!, value[0]);\n returnValue[key] = value.map(v => {\n return this.transformOutgoingData(\n arrayModel || model,\n v,\n read,\n undefined,\n outgoingRecords,\n true\n );\n });\n } else {\n // Simple field, not a relation\n returnValue[key] = value;\n }\n } else if (typeof value === \"object\" && value.$id !== undefined) {\n if (!relatedModel) {\n relatedModel = context.getModel((value as ORMModel).$self().entity);\n }\n\n this.addRecordForRecursionDetection(outgoingRecords!, value);\n\n // Value is a record, transform that too\n returnValue[key] = this.transformOutgoingData(\n relatedModel,\n value,\n read,\n undefined,\n outgoingRecords,\n true\n );\n } else {\n // In any other case just let the value be what ever it is\n returnValue[key] = value;\n }\n }\n });\n\n return returnValue;\n }\n\n /**\n * Transforms a set of incoming data to the format vuex-orm requires.\n *\n * @param {Data | Array} data\n * @param model\n * @param mutation required to transform something like `disableUserAddress` to the actual model name.\n * @param {boolean} recursiveCall\n * @returns {Data}\n */\n public static transformIncomingData(\n data: Data | Array,\n model: Model,\n mutation: boolean = false,\n recursiveCall: boolean = false\n ): Data {\n let result: Data | Array = {} as Data;\n const context = Context.getInstance();\n\n if (!recursiveCall) {\n context.logger.group(\"Transforming incoming data\");\n context.logger.log(\"Raw data:\", data);\n }\n\n if (Array.isArray(data)) {\n result = data.map((d: any) => this.transformIncomingData(d, model, mutation, true));\n } else {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined && data[key] !== null && key in data) {\n if (isPlainObject(data[key])) {\n const localModel: Model = context.getModel(key, true) || model;\n\n if (data[key].nodes && context.connectionMode === ConnectionMode.NODES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].nodes,\n localModel,\n mutation,\n true\n );\n } else if (data[key].edges && context.connectionMode === ConnectionMode.EDGES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].edges,\n localModel,\n mutation,\n true\n );\n } else if (data[\"node\"] && context.connectionMode === ConnectionMode.EDGES) {\n result = this.transformIncomingData(data[\"node\"], localModel, mutation, true);\n } else {\n let newKey = key;\n\n if (mutation && !recursiveCall) {\n newKey = data[key].nodes ? localModel.pluralName : localModel.singularName;\n newKey = downcaseFirstLetter(newKey);\n }\n\n result[newKey] = this.transformIncomingData(data[key], localModel, mutation, true);\n }\n } else if (Model.isFieldNumber(model.fields.get(key))) {\n result[key] = parseFloat(data[key]);\n } else if (key.endsWith(\"Type\") && model.isTypeFieldOfPolymorphicRelation(key)) {\n result[key] = pluralize(downcaseFirstLetter(data[key]));\n } else {\n result[key] = data[key];\n }\n }\n });\n }\n\n if (!recursiveCall) {\n context.logger.log(\"Transformed data:\", result);\n context.logger.groupEnd();\n } else {\n result[\"$isPersisted\"] = true;\n }\n\n // Make sure this is really a plain JS object. We had some issues in testing here.\n return clone(result);\n }\n\n /**\n * Tells if a field should be included in the outgoing data.\n * @param {boolean} forFilter Tells whether a filter is constructed or not.\n * @param {string} fieldName Name of the field to check.\n * @param {any} value Value of the field.\n * @param {Model} model Model class which contains the field.\n * @param {Array|undefined} whitelist Contains a list of fields which should always be included.\n * @returns {boolean}\n */\n public static shouldIncludeOutgoingField(\n forFilter: boolean,\n fieldName: string,\n value: any,\n model: Model,\n whitelist?: Array\n ): boolean {\n // Always add fields on the whitelist.\n if (whitelist && whitelist.includes(fieldName)) return true;\n\n // Ignore internal fields\n if (fieldName.startsWith(\"$\")) return false;\n\n // Ignore empty fields\n if (value === null || value === undefined) return false;\n\n // Include all eager save connections\n if (model.getRelations().has(fieldName)) {\n // We never add relations to filters.\n if (forFilter) return false;\n\n const relation: Relation = model.getRelations().get(fieldName)!;\n const related: Model | null = Model.getRelatedModel(relation);\n if (related && model.shouldEagerSaveRelation(fieldName, relation, related)) return true;\n\n // All other relations are skipped\n return false;\n }\n\n // Everything else is ok\n return true;\n }\n\n /**\n * Registers a record for recursion detection.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to register.\n */\n private static addRecordForRecursionDetection(\n records: Map>,\n record: ORMModel\n ): void {\n const context: Context = Context.getInstance();\n\n if (!record) {\n context.logger.warn(\"Trying to add invalid record\", record, \"to recursion detection\");\n return;\n }\n\n if (!record.$self) {\n context.logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return;\n }\n\n const model: Model = context.getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n ids.push(record.$id!);\n records.set(model.singularName, ids);\n }\n\n /**\n * Detects recursions.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to check.\n * @return {boolean} true when the record is already included in the records.\n */\n private static isRecursion(records: Map>, record: ORMModel): boolean {\n if (!record) return false;\n\n if (!record.$self) {\n Context.getInstance().logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return false;\n }\n\n const model: Model = Context.getInstance().getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n return ids.includes(record.$id!);\n }\n}\n","var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\n\nmodule.exports = gql;\n","import { ApolloClient, FetchPolicy } from \"apollo-client\";\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\nimport { HttpLink } from \"apollo-link-http\";\nimport { ApolloLink } from \"apollo-link\";\nimport Context from \"../common/context\";\nimport { Arguments, Data } from \"../support/interfaces\";\nimport Transformer from \"./transformer\";\nimport Model from \"../orm/model\";\nimport gql from \"graphql-tag\";\n\n/**\n * This class takes care of the communication with the graphql endpoint by leveraging the awesome apollo-client lib.\n */\nexport default class Apollo {\n /**\n * The http link instance to use.\n * @type {HttpLink}\n */\n private readonly httpLink: ApolloLink;\n\n /**\n * The ApolloClient instance\n * @type {ApolloClient}\n */\n private readonly apolloClient: ApolloClient;\n\n /**\n * @constructor\n */\n public constructor() {\n const context = Context.getInstance();\n\n // This allows the test suite to pass a custom link\n if (!context.options.apolloClient && context.options.link) {\n this.httpLink = context.options.link;\n } else {\n /* istanbul ignore next */\n this.httpLink = new HttpLink({\n uri: context.options.url ? context.options.url : \"/graphql\",\n credentials: context.options.credentials ? context.options.credentials : \"same-origin\",\n useGETForQueries: Boolean(context.options.useGETForQueries)\n });\n }\n\n if (context.options.apolloClient) {\n this.apolloClient = (context => {\n return context.options.apolloClient;\n })(context);\n } else {\n this.apolloClient = new ApolloClient({\n link: this.httpLink,\n cache: new InMemoryCache(),\n connectToDevTools: context.debugMode\n });\n }\n }\n\n /**\n * Sends a request to the GraphQL API via apollo\n * @param model\n * @param {any} query The query to send (result from gql())\n * @param {Arguments} variables Optional. The variables to send with the query\n * @param {boolean} mutation Optional. If this is a mutation (true) or a query (false, default)\n * @param {boolean} bypassCache If true the query will be send to the server without using the cache. For queries only\n * @returns {Promise} The new records\n */\n public async request(\n model: Model,\n query: any,\n variables?: Arguments,\n mutation: boolean = false,\n bypassCache: boolean = false\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n Context.getInstance().logger.logQuery(query, variables, fetchPolicy);\n\n const context = { headers: Apollo.getHeaders() };\n\n let response;\n if (mutation) {\n response = await this.apolloClient.mutate({ mutation: query, variables, context });\n } else {\n response = await this.apolloClient.query({ query, variables, fetchPolicy, context });\n }\n\n // Transform incoming data into something useful\n return Transformer.transformIncomingData(response.data as Data, model, mutation);\n }\n\n public async simpleQuery(\n query: string,\n variables: Arguments,\n bypassCache: boolean = false,\n context?: Data\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n return this.apolloClient.query({\n query: gql(query),\n variables,\n fetchPolicy,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n public async simpleMutation(query: string, variables: Arguments, context?: Data): Promise {\n return this.apolloClient.mutate({\n mutation: gql(query),\n variables,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n private static getHeaders() {\n const context = Context.getInstance();\n\n let headers: any = context.options.headers ? context.options.headers : {};\n\n if (typeof headers === \"function\") {\n headers = headers(context);\n }\n\n return headers;\n }\n}\n","import {\n GraphQLField,\n GraphQLSchema,\n GraphQLType,\n GraphQLTypeDefinition\n} from \"../support/interfaces\";\nimport { upcaseFirstLetter } from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\nimport Context from \"../common/context\";\n\nexport default class Schema {\n private schema: GraphQLSchema;\n private types: Map;\n private mutations: Map;\n private queries: Map;\n\n public constructor(schema: GraphQLSchema) {\n const context = Context.getInstance();\n\n this.schema = schema;\n this.types = new Map();\n this.mutations = new Map();\n this.queries = new Map();\n\n this.schema.types.forEach((t: GraphQLType) => this.types.set(t.name, t));\n\n this.getType(context.adapter.getRootQueryName())!.fields!.forEach(f =>\n this.queries.set(f.name, f)\n );\n this.getType(context.adapter.getRootMutationName())!.fields!.forEach(f =>\n this.mutations.set(f.name, f)\n );\n }\n\n public determineQueryMode(): ConnectionMode {\n let connection: GraphQLType | null = null;\n\n this.queries.forEach(query => {\n const typeName = Schema.getTypeNameOfField(query);\n if (typeName.endsWith(\"TypeConnection\")) {\n connection = this.getType(typeName);\n return false; // break\n }\n return true;\n });\n\n /* istanbul ignore next */\n if (!connection) {\n throw new Error(\n \"Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!\"\n );\n }\n\n if (connection!.fields!.find(f => f.name === \"nodes\")) {\n return ConnectionMode.NODES;\n } else if (connection!.fields!.find(f => f.name === \"edges\")) {\n return ConnectionMode.EDGES;\n } else {\n return ConnectionMode.PLAIN;\n }\n }\n\n public getType(name: string, allowNull: boolean = false): GraphQLType | null {\n name = Context.getInstance().adapter.prepareSchemaTypeName(name);\n const type = this.types.get(name);\n\n if (!allowNull && !type) {\n throw new Error(`Couldn't find Type of name ${name} in the GraphQL Schema.`);\n }\n\n return type || null;\n }\n\n public getMutation(name: string, allowNull: boolean = false): GraphQLField | null {\n const mutation = this.mutations.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !mutation) {\n throw new Error(`Couldn't find Mutation of name ${name} in the GraphQL Schema.`);\n }\n\n return mutation || null;\n }\n\n public getQuery(name: string, allowNull: boolean = false): GraphQLField | null {\n const query = this.queries.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !query) {\n throw new Error(`Couldn't find Query of name ${name} in the GraphQL Schema.`);\n }\n\n return query || null;\n }\n\n static returnsConnection(field: GraphQLField): boolean {\n return Schema.getTypeNameOfField(field).endsWith(\"TypeConnection\");\n }\n\n static getRealType(type: GraphQLTypeDefinition): GraphQLTypeDefinition {\n if (type.kind === \"NON_NULL\") {\n return this.getRealType(type.ofType);\n } else {\n return type;\n }\n }\n\n static getTypeNameOfField(field: GraphQLField): string {\n let type = this.getRealType(field.type);\n\n if (type.kind === \"LIST\") {\n while (!type.name) type = type.ofType;\n return `[${type.name}]`;\n } else {\n while (!type.name) type = type.ofType;\n\n /* istanbul ignore next */\n if (!type.name) throw new Error(`Can't find type name for field ${field.name}`);\n\n return type.name;\n }\n }\n}\n","import Adapter, { ConnectionMode, ArgumentMode } from \"../adapter\";\nimport Model from \"../../orm/model\";\nimport { upcaseFirstLetter } from \"../../support/utils\";\n\nexport default class DefaultAdapter implements Adapter {\n getRootMutationName(): string {\n return \"Mutation\";\n }\n\n getRootQueryName(): string {\n return \"Query\";\n }\n\n getConnectionMode(): ConnectionMode {\n return ConnectionMode.NODES;\n }\n\n getArgumentMode(): ArgumentMode {\n return ArgumentMode.TYPE;\n }\n\n getFilterTypeName(model: Model): string {\n return `${upcaseFirstLetter(model.singularName)}Filter`;\n }\n\n getInputTypeName(model: Model, action?: string): string {\n return `${upcaseFirstLetter(model.singularName)}Input`;\n }\n\n getNameForDestroy(model: Model): string {\n return `delete${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForFetch(model: Model, plural: boolean): string {\n return plural ? model.pluralName : model.singularName;\n }\n\n getNameForPersist(model: Model): string {\n return `create${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForPush(model: Model): string {\n return `update${upcaseFirstLetter(model.singularName)}`;\n }\n\n prepareSchemaTypeName(name: string): string {\n return upcaseFirstLetter(name);\n }\n}\n","import Logger from \"./logger\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel } from \"@vuex-orm/core\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { downcaseFirstLetter, isEqual, pick, singularize } from \"../support/utils\";\nimport Apollo from \"../graphql/apollo\";\nimport Database from \"@vuex-orm/core/lib/database/Database\";\nimport { Data, Field, GraphQLType, Options } from \"../support/interfaces\";\nimport Schema from \"../graphql/schema\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport Adapter, { ConnectionMode } from \"../adapters/adapter\";\nimport DefaultAdapter from \"../adapters/builtin/default-adapter\";\nimport introspectionQuery from \"../graphql/introspection-query\";\n\n/**\n * Internal context of the plugin. This class contains all information, the models, database, logger and so on.\n *\n * It's a singleton class, so just call Context.getInstance() anywhere you need the context.\n */\nexport default class Context {\n /**\n * Contains the instance for the singleton pattern.\n * @type {Context}\n */\n public static instance: Context;\n\n /**\n * Components collection of Vuex-ORM\n * @type {Components}\n */\n public readonly components: Components;\n\n /**\n * The options which have been passed to VuexOrm.install\n * @type {Options}\n */\n public readonly options: Options;\n\n /**\n * GraphQL Adapter.\n * @type {Adapter}\n */\n public readonly adapter: Adapter;\n\n /**\n * The Vuex-ORM database\n * @type {Database}\n */\n public readonly database: Database;\n\n /**\n * Collection of all Vuex-ORM models wrapped in a Model instance.\n * @type {Map}\n */\n public readonly models: Map = new Map();\n\n /**\n * When true, the logging is enabled.\n * @type {boolean}\n */\n public readonly debugMode: boolean = false;\n\n /**\n * Our nice Vuex-ORM-GraphQL logger\n * @type {Logger}\n */\n public readonly logger: Logger;\n\n /**\n * Instance of Apollo which cares about the communication with the graphql endpoint.\n * @type {Apollo}\n */\n public apollo!: Apollo;\n\n /**\n * The graphql schema. Is null until the first request.\n * @type {Schema}\n */\n public schema: Schema | undefined;\n\n /**\n * Tells if the schema is already loaded or the loading is currently processed.\n * @type {boolean}\n */\n private schemaWillBeLoaded: Promise | undefined;\n\n /**\n * Defines how to query connections. 'auto' | 'nodes' | 'edges' | 'plain'\n */\n public connectionMode: ConnectionMode = ConnectionMode.AUTO;\n\n /**\n * Container for the global mocks.\n * @type {Object}\n */\n private globalMocks: { [key: string]: Array } = {};\n\n /**\n * Private constructor, called by the setup method\n *\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n private constructor(components: Components, options: Options) {\n this.components = components;\n this.options = options;\n\n this.database = options.database;\n this.debugMode = Boolean(options.debug);\n this.logger = new Logger(this.debugMode);\n this.adapter = options.adapter || new DefaultAdapter();\n\n /* istanbul ignore next */\n if (!options.database) {\n throw new Error(\"database param is required to initialize vuex-orm-graphql!\");\n }\n }\n\n /**\n * Get the singleton instance of the context.\n * @returns {Context}\n */\n public static getInstance(): Context {\n return this.instance;\n }\n\n /**\n * This is called only once and creates a new instance of the Context.\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {Context}\n */\n public static setup(components: Components, options: Options): Context {\n this.instance = new Context(components, options);\n\n this.instance.apollo = new Apollo();\n this.instance.collectModels();\n\n this.instance.logger.group(\"Context setup\");\n this.instance.logger.log(\"components\", this.instance.components);\n this.instance.logger.log(\"options\", this.instance.options);\n this.instance.logger.log(\"database\", this.instance.database);\n this.instance.logger.log(\"models\", this.instance.models);\n this.instance.logger.groupEnd();\n\n return this.instance;\n }\n\n public async loadSchema(): Promise {\n if (!this.schemaWillBeLoaded) {\n this.schemaWillBeLoaded = new Promise(async (resolve, reject) => {\n this.logger.log(\"Fetching GraphQL Schema initially ...\");\n\n this.connectionMode = this.adapter.getConnectionMode();\n\n // We send a custom header along with the request. This is required for our test suite to mock the schema request.\n const context = {\n headers: { \"X-GraphQL-Introspection-Query\": \"true\" }\n };\n\n const result = await this.apollo.simpleQuery(\n introspectionQuery,\n {},\n true,\n (context as unknown) as Data\n );\n\n this.schema = new Schema(result.data.__schema);\n\n this.logger.log(\"GraphQL Schema successful fetched\", result);\n\n this.logger.log(\"Starting to process the schema ...\");\n this.processSchema();\n this.logger.log(\"Schema procession done!\");\n\n resolve(this.schema);\n });\n }\n\n return this.schemaWillBeLoaded;\n }\n\n public processSchema() {\n this.models.forEach((model: Model) => {\n let type: GraphQLType;\n\n try {\n type = this.schema!.getType(model.singularName)!;\n } catch (error) {\n this.logger.warn(`Ignoring entity ${model.singularName} because it's not in the schema.`);\n return;\n }\n\n model.fields.forEach((field: Field, fieldName: string) => {\n if (!type.fields!.find(f => f.name === fieldName)) {\n this.logger.warn(\n `Ignoring field ${model.singularName}.${fieldName} because it's not in the schema.`\n );\n\n // TODO: Move skipFields to the model\n model.baseModel.skipFields = model.baseModel.skipFields ? model.baseModel.skipFields : [];\n if (!model.baseModel.skipFields.includes(fieldName)) {\n model.baseModel.skipFields.push(fieldName);\n }\n }\n });\n });\n\n if (this.connectionMode === ConnectionMode.AUTO) {\n this.connectionMode = this.schema!.determineQueryMode();\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by automatic detection`);\n } else {\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by config`);\n }\n }\n\n /**\n * Returns a model from the model collection by it's name\n *\n * @param {Model|string} model A Model instance, a singular or plural name of the model\n * @param {boolean} allowNull When true this method returns null instead of throwing an exception when no model was\n * found. Default is false\n * @returns {Model}\n */\n public getModel(model: Model | string, allowNull: boolean = false): Model {\n if (typeof model === \"string\") {\n const name: string = singularize(downcaseFirstLetter(model));\n model = this.models.get(name) as Model;\n if (!allowNull && !model) throw new Error(`No such model ${name}!`);\n }\n\n return model;\n }\n\n /**\n * Will add a mock for simple mutations or queries. These are model unrelated and have to be\n * handled globally.\n *\n * @param {Mock} mock - Mock config.\n */\n public addGlobalMock(mock: Mock): boolean {\n if (this.findGlobalMock(mock.action, mock.options)) return false;\n if (!this.globalMocks[mock.action]) this.globalMocks[mock.action] = [];\n\n this.globalMocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a global mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions like { name: 'example' }.\n * @returns {Mock | null} null when no mock was found.\n */\n public findGlobalMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.globalMocks[action]) {\n return (\n this.globalMocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by simpleMutation and simpleQuery actions in order to get the global mock\n * returnValue.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public globalMockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.findGlobalMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Wraps all Vuex-ORM entities in a Model object and saves them into this.models\n */\n private collectModels() {\n this.database.entities.forEach((entity: any) => {\n const model: Model = new Model(entity.model as typeof ORMModel);\n this.models.set(model.singularName, model);\n Model.augment(model);\n });\n }\n}\n","export default `\nquery Introspection {\n __schema {\n types {\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n inputFields {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n`;\n","import { Relation } from \"@vuex-orm/core\";\nimport Model from \"../orm/model\";\nimport { Arguments, Field, GraphQLField, GraphQLType } from \"../support/interfaces\";\nimport { clone, isPlainObject, takeWhile, upcaseFirstLetter } from \"../support/utils\";\nimport gql from \"graphql-tag\";\nimport Context from \"../common/context\";\nimport Schema from \"./schema\";\nimport { ConnectionMode, ArgumentMode } from \"../adapters/adapter\";\n\n/**\n * Contains all logic to build GraphQL queries/mutations.\n */\nexport default class QueryBuilder {\n /**\n * Builds a field for the GraphQL query and a specific model\n *\n * @param {Model|string} model The model to use\n * @param {boolean} multiple Determines whether plural/nodes syntax or singular syntax is used.\n * @param {Arguments} args The args that will be passed to the query field ( user(role: $role) )\n * @param {Array} path The relations in this list are ignored (while traversing relations).\n * Mainly for recursion\n * @param {string} name Optional name of the field. If not provided, this will be the model name\n * @param filter\n * @param {boolean} allowIdFields Optional. Determines if id fields will be ignored for the argument generation.\n * See buildArguments\n * @returns {string}\n *\n * @todo Do we need the allowIdFields param?\n */\n public static buildField(\n model: Model | string,\n multiple: boolean = true,\n args?: Arguments,\n path: Array = [],\n name?: string,\n filter: boolean = false,\n allowIdFields: boolean = false\n ): string {\n const context = Context.getInstance();\n model = context.getModel(model);\n\n name = name ? name : model.pluralName;\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n let params: string = this.buildArguments(model, args, false, filter, allowIdFields, field);\n path = path.length === 0 ? [model.singularName] : path;\n\n const fields = `\n ${model.getQueryFields().join(\" \")}\n ${this.buildRelationsQuery(model, path)}\n `;\n\n if (multiple) {\n const header: string = `${name}${params}`;\n\n if (context.connectionMode === ConnectionMode.NODES) {\n return `\n ${header} {\n nodes {\n ${fields}\n }\n }\n `;\n } else if (context.connectionMode === ConnectionMode.EDGES) {\n return `\n ${header} {\n edges {\n node {\n ${fields}\n }\n }\n }\n `;\n } else {\n return `\n ${header} {\n ${fields}\n }\n `;\n }\n } else {\n return `\n ${name ? name : model.singularName}${params} {\n ${fields}\n }\n `;\n }\n }\n\n /**\n * Generates a query.\n * Currently only one root field for the query is possible.\n * @param {string} type 'mutation' or 'query'\n * @param {Model | string} model The model this query or mutation affects. This mainly determines the query fields.\n * @param {string} name Optional name of the query/mutation. Will overwrite the name from the model.\n * @param {Arguments} args Arguments for the query\n * @param {boolean} multiple Determines if the root query field is a connection or not (will be passed to buildField)\n * @param {boolean} filter When true the query arguments are passed via a filter object.\n * @returns {any} Whatever gql() returns\n */\n public static buildQuery(\n type: string,\n model: Model | string,\n name?: string,\n args?: Arguments,\n multiple?: boolean,\n filter?: boolean\n ) {\n const context = Context.getInstance();\n\n // model\n model = context.getModel(model);\n\n // arguments\n args = this.prepareArguments(args);\n\n // multiple\n multiple = multiple === undefined ? !args[\"id\"] : multiple;\n\n // name\n if (!name) name = multiple ? model.pluralName : model.singularName;\n\n // field\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n // build query\n const query: string =\n `${type} ${upcaseFirstLetter(name)}${this.buildArguments(\n model,\n args,\n true,\n filter,\n true,\n field\n )} {\\n` +\n ` ${this.buildField(model, multiple, args, [], name, filter, true)}\\n` +\n `}`;\n\n return gql(query);\n }\n\n /**\n * Generates the arguments string for a graphql query based on a given map.\n *\n * There are three types of arguments:\n *\n * 1) Signatures with primitive types (signature = true)\n * => 'mutation createUser($name: String!)'\n *\n * 2) Signatures with object types (signature = true, args = { user: { __type: 'User' }})\n * => 'mutation createUser($user: UserInput!)'\n *\n * 3) Fields with variables (signature = false)\n * => 'user(id: $id)'\n *\n * 4) Filter fields with variables (signature = false, filter = true)\n * => 'users(filter: { active: $active })'\n *\n * @param model\n * @param {Arguments | undefined} args\n * @param {boolean} signature When true, then this method generates a query signature instead of key/value pairs\n * @param filter\n * @param {boolean} allowIdFields If true, ID fields will be included in the arguments list\n * @param {GraphQLField} field Optional. The GraphQL mutation or query field\n * @returns {String}\n */\n public static buildArguments(\n model: Model,\n args?: Arguments,\n signature: boolean = false,\n filter: boolean = false,\n allowIdFields: boolean = true,\n field: GraphQLField | null = null\n ): string {\n const context = Context.getInstance();\n if (args === undefined) return \"\";\n\n let returnValue: string = \"\";\n let first: boolean = true;\n\n if (args) {\n Object.keys(args).forEach((key: string) => {\n let value: any = args[key];\n\n const isForeignKey = model.skipField(key);\n const skipFieldDueId = (key === \"id\" || isForeignKey) && !allowIdFields;\n\n let schemaField: GraphQLField | undefined = this.findSchemaFieldForArgument(\n key,\n field,\n model,\n filter\n );\n\n const isConnectionField =\n schemaField && Schema.getTypeNameOfField(schemaField).endsWith(\"TypeConnection\");\n\n // Ignore null fields, ids and connections\n if (value && !skipFieldDueId && !isConnectionField) {\n let typeOrValue: any = \"\";\n\n if (signature) {\n if (isPlainObject(value) && value.__type) {\n // Case 2 (User!)\n typeOrValue = context.adapter.getInputTypeName(context.getModel(value.__type)) + \"!\";\n } else if (value instanceof Array && field) {\n const arg = QueryBuilder.findSchemaFieldForArgument(key, field, model, filter);\n\n /* istanbul ignore next */\n if (!arg) {\n throw new Error(\n `The argument ${key} is of type array but it's not possible to determine the type, because it's not in the field ${\n field.name\n }`\n );\n }\n\n typeOrValue = Schema.getTypeNameOfField(arg) + \"!\";\n } else if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n // Case 1, 3 and 4\n typeOrValue = Schema.getTypeNameOfField(schemaField) + \"!\";\n } else if (key === \"id\" || isForeignKey) {\n // Case 1 (ID!)\n typeOrValue = \"ID!\";\n } else {\n // Case 1 (String!)\n typeOrValue = this.determineAttributeType(model, key, value, field || undefined);\n typeOrValue = typeOrValue + \"!\";\n }\n } else {\n // Case 3 or 4\n typeOrValue = `$${key}`;\n }\n\n returnValue = `${returnValue}${first ? \"\" : \", \"}${(signature ? \"$\" : \"\") +\n key}: ${typeOrValue}`;\n\n first = false;\n }\n });\n\n if (!first) {\n if (!signature && filter) returnValue = `filter: { ${returnValue} }`;\n returnValue = `(${returnValue})`;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Determines the GraphQL primitive type of a field in the variables hash by the field type or (when\n * the field type is generic attribute) by the variable type.\n * @param {Model} model\n * @param {string} key\n * @param {string} value\n * @param {GraphQLField} query Pass when we have to detect the type of an argument\n * @returns {string}\n */\n public static determineAttributeType(\n model: Model,\n key: string,\n value: any,\n query?: GraphQLField\n ): string {\n const context: Context = Context.getInstance();\n const field: undefined | Field = model.fields.get(key);\n let schemaField: undefined | GraphQLField;\n\n if (query) {\n schemaField = query.args.find(f => f.name === key);\n\n if (!schemaField) {\n const filterField = query.args.find(f => f.name === \"filter\");\n\n if (filterField) {\n schemaField = this.findSchemaFieldForArgument(key, null, model, true);\n }\n }\n } else {\n schemaField = context.schema!.getType(model.singularName)!.fields!.find(f => f.name === key);\n }\n\n if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n return Schema.getTypeNameOfField(schemaField);\n } else {\n if (field instanceof context.components.String) {\n return \"String\";\n } else if (field && field instanceof context.components.Number) {\n return \"Int\";\n } else if (field && field instanceof context.components.Boolean) {\n return \"Boolean\";\n } else {\n if (typeof value === \"number\") return \"Int\";\n if (typeof value === \"string\") return \"String\";\n if (typeof value === \"boolean\") return \"Boolean\";\n\n throw new Error(\n `Can't find suitable graphql type for field '${model.singularName}.${key}'.`\n );\n }\n }\n }\n\n private static findSchemaFieldForArgument(\n name: String,\n field: GraphQLField | null,\n model: Model,\n isFilter: boolean\n ): GraphQLField | undefined {\n const context = Context.getInstance();\n const schema = context.schema!;\n let schemaField: GraphQLField | undefined;\n\n if (field) {\n schemaField = field.args.find(f => f.name === name);\n if (schemaField) return schemaField;\n }\n\n // We try to find the FilterType or at least the Type this query belongs to.\n const type: GraphQLType | null = schema.getType(\n isFilter ? context.adapter.getFilterTypeName(model) : model.singularName,\n true\n );\n\n // Next we try to find the field from the type\n schemaField = type\n ? (isFilter ? type.inputFields! : type.fields!).find(f => f.name === name)\n : undefined;\n\n // Warn before we return null\n if (!schemaField) {\n Context.getInstance().logger.warn(\n `Couldn't find the argument with name ${name} for the mutation/query ${\n field ? field.name : \"(?)\"\n }`\n );\n }\n\n return schemaField;\n }\n\n /**\n * Generates the fields for all related models.\n *\n * @param {Model} model\n * @param {Array} path\n * @returns {string}\n */\n static buildRelationsQuery(model: null | Model, path: Array = []): string {\n if (model === null) return \"\";\n\n const context = Context.getInstance();\n const relationQueries: Array = [];\n\n model.getRelations().forEach((field: Relation, name: string) => {\n let relatedModel: Model = Model.getRelatedModel(field)!;\n\n // We will ignore the field, when it's already in the path. Means: When it's already queried. However there are\n // cases where the model will have a relationship to itself. For example a nested category strucure where the\n // category model has a parent: belongsTo(Category). So we also check if the model references itself. If this is\n // the case, we allow the nesting up to 5 times.\n const referencesItSelf = takeWhile(\n path.slice(0).reverse(),\n (p: string) => p === relatedModel.singularName\n ).length;\n const ignore = referencesItSelf\n ? referencesItSelf > 5\n : path.includes(relatedModel.singularName);\n\n // console.log(`-----> Will ${ignore ? '' : 'not'} ignore ${model.singularName}.${name}, path: ${path.join('.')}`);\n\n if (model.shouldEagerLoadRelation(name, field, relatedModel) && !ignore) {\n const newPath = path.slice(0);\n newPath.push(relatedModel.singularName);\n\n relationQueries.push(\n this.buildField(\n relatedModel,\n Model.isConnection(field as Field),\n undefined,\n newPath,\n name,\n false\n )\n );\n }\n });\n\n return relationQueries.join(\"\\n\");\n }\n\n private static prepareArguments(args?: Arguments): Arguments {\n args = (args ? clone(args) : {}) as Arguments;\n\n Object.keys(args).forEach((key: string) => {\n const value = args![key];\n\n if (value && isPlainObject(value)) {\n if (Context.getInstance().adapter.getArgumentMode() === ArgumentMode.LIST) {\n Object.keys(value).forEach((k: string) => {\n args![k] = value[k];\n });\n delete args![key];\n } else {\n args![key] = { __type: upcaseFirstLetter(key) };\n }\n }\n });\n\n return args;\n }\n}\n","import { Data, DispatchFunction } from \"../support/interfaces\";\nimport Context from \"../common/context\";\n\n/**\n * Provides some helper methods to interact with the Vuex-ORM store\n */\nexport class Store {\n /**\n * Inserts incoming data into the store. Existing data will be updated.\n *\n * @param {Data} data New data to insert/update\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @return {Promise} Inserted data as hash\n */\n public static async insertData(data: Data, dispatch: DispatchFunction): Promise {\n let insertedData: Data = {} as Data;\n\n await Promise.all(\n Object.keys(data).map(async key => {\n const value = data[key];\n Context.getInstance().logger.log(\"Inserting records\", value);\n const newData = await dispatch(\"insertOrUpdate\", ({ data: value } as unknown) as Data);\n\n Object.keys(newData).forEach(dataKey => {\n if (!insertedData[dataKey]) insertedData[dataKey] = [];\n insertedData[dataKey] = insertedData[dataKey].concat(newData[dataKey]);\n });\n })\n );\n\n return insertedData;\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport { Arguments, Data, DispatchFunction } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport RootState from \"@vuex-orm/core/lib/modules/contracts/RootState\";\nimport Transformer from \"../graphql/transformer\";\nimport Schema from \"../graphql/schema\";\nimport { singularize } from \"../support/utils\";\n\n/**\n * Base class for all Vuex actions. Contains some utility and convenience methods.\n */\nexport default class Action {\n /**\n * Sends a mutation.\n *\n * @param {string} name Name of the mutation like 'createUser'\n * @param {Data | undefined} variables Variables to send with the mutation\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @param {Model} model The model this mutation affects.\n * @param {boolean} multiple Tells if we're requesting a single record or multiple.\n * @returns {Promise}\n */\n protected static async mutation(\n name: string,\n variables: Data | undefined,\n dispatch: DispatchFunction,\n model: Model\n ): Promise {\n if (variables) {\n const context: Context = Context.getInstance();\n const schema: Schema = await context.loadSchema();\n\n const multiple: boolean = Schema.returnsConnection(schema.getMutation(name)!);\n const query = QueryBuilder.buildQuery(\"mutation\", model, name, variables, multiple);\n\n // Send GraphQL Mutation\n let newData = await context.apollo.request(model, query, variables, true);\n\n // When this was not a destroy action, we get new data, which we should insert in the store\n if (name !== context.adapter.getNameForDestroy(model)) {\n newData = newData[Object.keys(newData)[0]];\n\n // IDs as String cause terrible issues, so we convert them to integers.\n newData.id = parseInt(newData.id, 10);\n\n const insertedData: Data = await Store.insertData(\n { [model.pluralName]: newData } as Data,\n dispatch\n );\n\n // Try to find the record to return\n const records = insertedData[model.pluralName];\n const newRecord = records[records.length - 1];\n if (newRecord) {\n return newRecord;\n } else {\n Context.getInstance().logger.log(\n \"Couldn't find the record of type '\",\n model.pluralName,\n \"' within\",\n insertedData,\n \". Falling back to find()\"\n );\n return model.baseModel.query().last();\n }\n }\n\n return true;\n }\n }\n\n /**\n * Convenience method to get the model from the state.\n * @param {RootState} state Vuex state\n * @returns {Model}\n */\n static getModelFromState(state: RootState): Model {\n return Context.getInstance().getModel(state.$name);\n }\n\n /**\n * Makes sure args is a hash.\n *\n * @param {Arguments|undefined} args\n * @param {any} id When not undefined, it's added to the args\n * @returns {Arguments}\n */\n static prepareArgs(args?: Arguments, id?: any): Arguments {\n args = args || {};\n if (id) args[\"id\"] = id;\n\n return args;\n }\n\n /**\n * Adds the record itself to the args and sends it through transformOutgoingData. Key is named by the singular name\n * of the model.\n *\n * @param {Arguments} args\n * @param {Model} model\n * @param {Data} data\n * @returns {Arguments}\n */\n static addRecordToArgs(args: Arguments, model: Model, data: Data): Arguments {\n args[model.singularName] = Transformer.transformOutgoingData(model, data, false);\n return args;\n }\n\n /**\n * Transforms each field of the args which contains a model.\n * @param {Arguments} args\n * @returns {Arguments}\n */\n protected static transformArgs(args: Arguments): Arguments {\n const context = Context.getInstance();\n\n Object.keys(args).forEach((key: string) => {\n const value: Data = args[key];\n\n if (value instanceof context.components.Model) {\n const model = context.getModel(singularize(value.$self().entity));\n const transformedValue = Transformer.transformOutgoingData(model, value, false);\n context.logger.log(\n \"A\",\n key,\n \"model was found within the variables and will be transformed from\",\n value,\n \"to\",\n transformedValue\n );\n args[key] = transformedValue;\n }\n });\n\n return args;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Destroy action for sending a delete mutation. Will be used for record.$destroy().\n */\nexport default class Destroy extends Action {\n /**\n * @param {State} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to delete\n * @returns {Promise} true\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForDestroy(model);\n\n const mockReturnValue = model.$mockHook(\"destroy\", { id });\n\n if (mockReturnValue) {\n await Store.insertData(mockReturnValue, dispatch!);\n return true;\n }\n\n args = this.prepareArgs(args, id);\n\n await Action.mutation(mutationName, args as Data, dispatch!, model);\n return true;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The destroy action requires the 'id' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\n\n/**\n * Fetch action for sending a query. Will be used for Model.fetch().\n */\nexport default class Fetch extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {ActionParams} params Optional params to send with the query\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n params?: ActionParams\n ): Promise {\n const context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"fetch\", {\n filter: params ? params.filter || {} : {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n await context.loadSchema();\n\n // Filter\n let filter = {};\n\n if (params && params.filter) {\n filter = Transformer.transformOutgoingData(\n model,\n params.filter as Data,\n true,\n Object.keys(params.filter)\n );\n }\n\n const bypassCache = params && params.bypassCache;\n\n // When the filter contains an id, we query in singular mode\n const multiple: boolean = !filter[\"id\"];\n const name: string = context.adapter.getNameForFetch(model, multiple);\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, multiple);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(model, query, filter, false, bypassCache as boolean);\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n }\n}\n","import { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport Schema from \"../graphql/schema\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Mutate action for sending a custom mutation. Will be used for Model.mutate() and record.$mutate().\n */\nexport default class Mutate extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {Arguments} args Arguments for the mutation. Must contain a 'mutation' field.\n * @returns {Promise} The new record if any\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { args, name }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"mutate\", {\n name,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n args = this.prepareArgs(args);\n\n // There could be anything in the args, but we have to be sure that all records are gone through\n // transformOutgoingData()\n this.transformArgs(args);\n\n // Send the mutation\n return Action.mutation(name, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The mutate action requires the mutation name ('mutation') to be set\");\n }\n }\n}\n","import Context from \"../common/context\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Model from \"../orm/model\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Persist action for sending a create mutation. Will be used for record.$persist().\n */\nexport default class Persist extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to persist\n * @returns {Promise} The saved record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPersist(model);\n const oldRecord = model.getRecordWithId(id)!;\n\n const mockReturnValue = model.$mockHook(\"persist\", {\n id,\n args: args || {}\n });\n\n if (mockReturnValue) {\n const newRecord = await Store.insertData(mockReturnValue, dispatch!);\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n return newRecord;\n }\n\n // Arguments\n args = this.prepareArgs(args);\n this.addRecordToArgs(args, model, oldRecord);\n\n // Send mutation\n const newRecord = await Action.mutation(mutationName, args as Data, dispatch!, model);\n\n // Delete the old record if necessary\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n\n return newRecord;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'id' to be set\");\n }\n }\n\n /**\n * It's very likely that the server generated different ID for this record.\n * In this case Action.mutation has inserted a new record instead of updating the existing one.\n *\n * @param {Model} model\n * @param {Data} record\n * @returns {Promise}\n */\n private static async deleteObsoleteRecord(model: Model, newRecord: Data, oldRecord: Data) {\n if (newRecord && oldRecord && newRecord.id !== oldRecord.id) {\n Context.getInstance().logger.log(\"Dropping deprecated record\", oldRecord);\n return oldRecord.$delete();\n }\n\n return null;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Push action for sending a update mutation. Will be used for record.$push().\n */\nexport default class Push extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {Arguments} data New data to save\n * @param {Arguments} args Additional arguments\n * @returns {Promise} The updated record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { data, args }: ActionParams\n ): Promise {\n if (data) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPush(model);\n\n const mockReturnValue = model.$mockHook(\"push\", {\n data,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n // Arguments\n args = this.prepareArgs(args, data.id);\n this.addRecordToArgs(args, model, data);\n\n // Send the mutation\n return Action.mutation(mutationName, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'data' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Schema from \"../graphql/schema\";\n\n/**\n * Query action for sending a custom query. Will be used for Model.customQuery() and record.$customQuery.\n */\nexport default class Query extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {object} filter Filter object (arguments)\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { name, filter, bypassCache }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"query\", {\n name,\n filter: filter || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n\n // Filter\n filter = filter ? Transformer.transformOutgoingData(model, filter as Data, true) : {};\n\n // Multiple?\n const multiple: boolean = Schema.returnsConnection(schema.getQuery(name)!);\n\n // Build query\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, false);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(\n model,\n query,\n filter,\n false,\n bypassCache as boolean\n );\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The customQuery action requires the query name ('name') to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery, removeSymbols } from \"../support/utils\";\n\n/**\n * SimpleQuery action for sending a model unrelated simple query.\n */\nexport default class SimpleQuery extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, bypassCache, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleQuery\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n\n const result = await context.apollo.simpleQuery(\n graphQlDocumentToString(parsedQuery),\n variables,\n bypassCache\n );\n\n // remove the symbols\n return removeSymbols(clone(result.data));\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleQuery action requires the 'query' to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery } from \"../support/utils\";\n\n/**\n * SimpleMutation action for sending a model unrelated simple mutation.\n */\nexport default class SimpleMutation extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleMutation\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n const result = await context.apollo.simpleMutation(\n graphQlDocumentToString(parsedQuery),\n variables\n );\n\n // remove the symbols\n return clone(result.data);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleMutation action requires the 'query' to be set\");\n }\n }\n}\n","import { PatchedModel, Options, ActionParams } from \"./support/interfaces\";\nimport Context from \"./common/context\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { Destroy, Fetch, Mutate, Persist, Push } from \"./actions\";\nimport Query from \"./actions/query\";\nimport SimpleQuery from \"./actions/simple-query\";\nimport SimpleMutation from \"./actions/simple-mutation\";\nimport { isPlainObject } from \"./support/utils\";\n\n/**\n * Main class of the plugin. Setups the internal context, Vuex actions and model methods\n */\nexport default class VuexORMGraphQL {\n /**\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n public constructor(components: Components, options: Options) {\n Context.setup(components, options);\n VuexORMGraphQL.setupActions();\n VuexORMGraphQL.setupModelMethods();\n }\n\n /**\n * Allow everything to read the context.\n */\n public getContext(): Context {\n return Context.getInstance();\n }\n\n /**\n * This method will setup following Vuex actions: fetch, persist, push, destroy, mutate\n */\n private static setupActions() {\n const context = Context.getInstance();\n\n context.components.RootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);\n context.components.RootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);\n\n context.components.Actions.fetch = Fetch.call.bind(Fetch);\n context.components.Actions.persist = Persist.call.bind(Persist);\n context.components.Actions.push = Push.call.bind(Push);\n context.components.Actions.destroy = Destroy.call.bind(Destroy);\n context.components.Actions.mutate = Mutate.call.bind(Mutate);\n context.components.Actions.query = Query.call.bind(Query);\n }\n\n /**\n * This method will setup following model methods: Model.fetch, Model.mutate, Model.customQuery, record.$mutate,\n * record.$persist, record.$push, record.$destroy and record.$deleteAndDestroy, record.$customQuery\n */\n private static setupModelMethods() {\n const context = Context.getInstance();\n\n // Register static model convenience methods\n (context.components.Model as typeof PatchedModel).fetch = async function(\n filter: any,\n bypassCache = false\n ) {\n let filterObj = filter;\n if (!isPlainObject(filterObj)) {\n filterObj = { id: filter };\n }\n return this.dispatch(\"fetch\", { filter: filterObj, bypassCache });\n };\n\n (context.components.Model as typeof PatchedModel).mutate = async function(\n params: ActionParams\n ) {\n return this.dispatch(\"mutate\", params);\n };\n\n (context.components.Model as typeof PatchedModel).customQuery = async function({\n name,\n filter,\n multiple,\n bypassCache\n }: ActionParams) {\n return this.dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n // Register model convenience methods\n const model: PatchedModel = context.components.Model.prototype as PatchedModel;\n\n model.$mutate = async function({ name, args, multiple }: ActionParams) {\n args = args || {};\n if (!args[\"id\"]) args[\"id\"] = this.$id;\n return this.$dispatch(\"mutate\", { name, args, multiple });\n };\n\n model.$customQuery = async function({ name, filter, multiple, bypassCache }: ActionParams) {\n filter = filter || {};\n if (!filter[\"id\"]) filter[\"id\"] = this.$id;\n return this.$dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n model.$persist = async function(args: any) {\n return this.$dispatch(\"persist\", { id: this.$id, args });\n };\n\n model.$push = async function(args: any) {\n return this.$dispatch(\"push\", { data: this, args });\n };\n\n model.$destroy = async function() {\n return this.$dispatch(\"destroy\", { id: this.$id });\n };\n\n model.$deleteAndDestroy = async function() {\n await this.$delete();\n return this.$destroy();\n };\n }\n}\n","import VuexORMGraphQL from './vuex-orm-graphql';\nimport { Components, Plugin } from '@vuex-orm/core/lib/plugins/use';\nimport { Options } from './support/interfaces';\n\n/**\n * Plugin class. This just provides a static install method for Vuex-ORM and stores the instance of the model\n * within this.instance.\n */\nexport default class VuexORMGraphQLPlugin implements Plugin {\n /**\n * Contains the instance of VuexORMGraphQL\n */\n public static instance: VuexORMGraphQL;\n\n /**\n * This is called, when VuexORM.install(VuexOrmGraphQL, options) is called.\n *\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {VuexORMGraphQL}\n */\n public static install (components: Components, options: Options): VuexORMGraphQL {\n VuexORMGraphQLPlugin.instance = new VuexORMGraphQL(components, options);\n return VuexORMGraphQLPlugin.instance;\n }\n}\n","import { Model as ORMModel } from \"@vuex-orm/core\";\nimport Context from \"./common/context\";\nimport Model from \"./orm/model\";\nimport VuexORMGraphQLPlugin from \"./index\";\n\nlet context: Context | null = null;\n\nexport function setupTestUtils(plugin: typeof VuexORMGraphQLPlugin): void {\n /* istanbul ignore next */\n if (!plugin.instance) {\n throw new Error(\"Please call this function after setting up the store!\");\n }\n\n context = plugin.instance.getContext();\n}\n\nexport interface MockOptions {\n [key: string]: any;\n}\n\ntype ReturnObject = { [key: string]: any };\n\nexport type ReturnValue =\n | (() => ReturnObject | Array)\n | ReturnObject\n | Array;\n\nexport class Mock {\n public readonly action: string;\n public readonly options?: MockOptions;\n public modelClass?: typeof ORMModel;\n public returnValue?: ReturnValue;\n\n constructor(action: string, options?: MockOptions) {\n this.action = action;\n this.options = options;\n }\n\n public for(modelClass: typeof ORMModel): Mock {\n this.modelClass = modelClass;\n return this;\n }\n\n public andReturn(returnValue: ReturnValue): Mock {\n this.returnValue = returnValue;\n this.installMock();\n return this;\n }\n\n private installMock(): void {\n if (this.action === \"simpleQuery\" || this.action === \"simpleMutation\") {\n context!.addGlobalMock(this);\n } else {\n const model: Model = context!.getModel(this.modelClass!.entity);\n model.$addMock(this);\n }\n }\n}\n\nexport async function clearORMStore() {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n await context.database.store.dispatch(\"entities/deleteAll\");\n}\n\nexport function mock(action: string, options?: MockOptions): Mock {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n return new Mock(action, options);\n}\n"],"names":["Object","defineProperty","exports","value","condition","message","Error","undefined","obj","_invariant2","_invariant","__esModule","default","Source","body","name","locationOffset","instance","Constructor","TypeError","_classCallCheck","this","line","column","source","position","lineRegexp","match","exec","index","length","highlightSourceAtLocation","location","lineOffset","columnOffset","getColumnOffset","contextLine","contextColumn","prevLineNum","toString","lineNum","nextLineNum","padLen","lines","split","whitespace","lpad","filter","Boolean","join","len","Array","str","error","printedLocations","nodes","forEach","node","loc","push","_location","getLocation","start","locations","concat","GraphQLError","positions","path","originalError","extensions","_nodes","isArray","_source","_positions","reduce","list","_locations","providedSource","map","pos","defineProperties","enumerable","writable","stack","configurable","captureStackTrace","prototype","create","constructor","_printError","printError","description","_GraphQLError","_extends","assign","target","i","arguments","key","hasOwnProperty","call","get","_syntaxError","syntaxError","_locatedError","locatedError","_formatError","formatError","leadingWhitespace","isBlank","rawString","commonIndent","indent","_i","slice","shift","pop","options","startOfFileToken","Tok","SOF","lastToken","token","lineStart","advance","advanceLexer","lookahead","kind","_blockStringValue2","_blockStringValue","EOF","next","readToken","COMMENT","BANG","DOLLAR","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","NAME","INT","FLOAT","STRING","BLOCK_STRING","charCodeAt","String","end","prev","printCharCode","code","isNaN","JSON","stringify","fromCharCode","toUpperCase","lexer","bodyLength","startPosition","positionAfterWhitespace","col","_error","readComment","readName","firstCode","isFloat","readDigits","readNumber","chunkStart","rawValue","readBlockString","charCode","a","b","c","d","char2hex","readString","unexpectedCharacterMessage","toJSON","inspect","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","parseName","expect","_lexer","TokenKind","_kinds","parseDefinition","peek","parseExecutableDefinition","parseTypeSystemDefinition","peekDescription","unexpected","parseOperationDefinition","expectKeyword","experimentalFragmentVariables","parseFragmentName","variableDefinitions","parseVariableDefinitions","typeCondition","parseNamedType","directives","parseDirectives","selectionSet","parseSelectionSet","parseFragmentDefinition","OPERATION_DEFINITION","operation","parseOperationType","operationToken","many","parseVariableDefinition","VARIABLE_DEFINITION","variable","parseVariable","type","parseTypeReference","defaultValue","skip","parseValueLiteral","VARIABLE","SELECTION_SET","selections","parseSelection","parseFragment","nameOrAlias","alias","parseArguments","parseField","isConst","item","parseConstArgument","parseArgument","ARGUMENT","parseConstValue","parseValueValue","LIST","values","openKind","parseFn","closeKind","any","parseList","fields","parseObjectField","parseObject","parseStringLiteral","BOOLEAN","NULL","block","OBJECT_FIELD","parseDirective","DIRECTIVE","LIST_TYPE","NON_NULL_TYPE","NAMED_TYPE","keywordToken","operationTypes","parseOperationTypeDefinition","SCHEMA_DEFINITION","parseSchemaDefinition","parseDescription","SCALAR_TYPE_DEFINITION","parseScalarTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","OBJECT_TYPE_DEFINITION","parseObjectTypeDefinition","INTERFACE_TYPE_DEFINITION","parseInterfaceTypeDefinition","types","parseMemberTypesDefinition","UNION_TYPE_DEFINITION","parseUnionTypeDefinition","parseEnumValuesDefinition","ENUM_TYPE_DEFINITION","parseEnumTypeDefinition","parseInputFieldsDefinition","INPUT_OBJECT_TYPE_DEFINITION","parseInputObjectTypeDefinition","SCALAR_TYPE_EXTENSION","parseScalarTypeExtension","OBJECT_TYPE_EXTENSION","parseObjectTypeExtension","INTERFACE_TYPE_EXTENSION","parseInterfaceTypeExtension","UNION_TYPE_EXTENSION","parseUnionTypeExtension","ENUM_TYPE_EXTENSION","parseEnumTypeExtension","INPUT_OBJECT_TYPE_EXTENSION","parseInputObjectTypeExtension","parseTypeExtension","args","parseArgumentDefs","parseDirectiveLocation","parseDirectiveLocations","DIRECTIVE_DEFINITION","parseDirectiveDefinition","OPERATION_TYPE_DEFINITION","parseFieldDefinition","parseInputValueDef","INPUT_VALUE_DEFINITION","parseEnumValueDefinition","ENUM_VALUE_DEFINITION","_directiveLocation","DirectiveLocation","startToken","noLocation","Loc","endToken","getTokenDesc","atToken","sourceObj","definitions","DOCUMENT","parseDocument","createLexer","root","visitor","visitorKeys","QueryDocumentKeys","inArray","keys","edits","parent","ancestors","newRoot","isLeaving","isEdited","clone","k","editOffset","ii","editKey","editValue","splice","result","isNode","visitFn","getVisitFn","BREAK","visitors","skipping","enter","fn","apply","leave","typeInfo","Name","Document","OperationDefinition","VariableDefinition","Variable","SelectionSet","Field","Argument","FragmentSpread","InlineFragment","FragmentDefinition","IntValue","FloatValue","StringValue","BooleanValue","NullValue","EnumValue","ListValue","ObjectValue","ObjectField","Directive","NamedType","ListType","NonNullType","SchemaDefinition","OperationTypeDefinition","ScalarTypeDefinition","ObjectTypeDefinition","FieldDefinition","InputValueDefinition","InterfaceTypeDefinition","UnionTypeDefinition","EnumTypeDefinition","EnumValueDefinition","InputObjectTypeDefinition","ScalarTypeExtension","ObjectTypeExtension","InterfaceTypeExtension","UnionTypeExtension","EnumTypeExtension","InputObjectTypeExtension","DirectiveDefinition","maybeNode","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","ast","_visitor","visit","printDocASTReducer","op","varDefs","wrap","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","isDescription","indexOf","replace","printBlockString","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","maybeArray","separator","x","array","maybeString","LARGE_ARRAY_SIZE","HASH_UNDEFINED","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","MAX_SAFE_INTEGER","argsTag","arrayTag","asyncTag","boolTag","dateTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","arrayBufferTag","dataViewTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","freeSelf","self","Function","freeExports","nodeType","freeModule","module","moduleExports","freeProcess","process","nodeUtil","binding","e","nodeIsTypedArray","isTypedArray","arraySome","predicate","mapToArray","size","setToArray","set","uid","func","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","IE_PROTO","nativeObjectToString","reIsNative","RegExp","Buffer","Symbol","Uint8Array","propertyIsEnumerable","symToStringTag","toStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","arg","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","SetCache","__data__","add","Stack","data","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","n","iteratee","baseTimes","isIndex","assocIndexOf","eq","baseGetTag","isOwn","tag","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","object","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","byteLength","byteOffset","buffer","convert","isPartial","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isObject","isFunction","test","baseKeys","Ctor","proto","arrLength","seen","arrValue","othIndex","has","keysFunc","symbolsFunc","offset","arrayPush","baseGetAllKeys","getSymbols","getMapData","getValue","hash","string","pairs","resIndex","arrayFilter","symbol","ArrayBuffer","resolve","ctorString","isLength","baseUnary","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","cloneableTags","addMapEntry","pair","addSetEntry","arrayReduce","accumulator","initAccum","isHostObject","overArg","getPrototype","getPrototypeOf","objectCreate","isArrayLike","isArrayLikeObject","assignValue","baseClone","isDeep","isFull","input","initCloneArray","copyArray","isFunc","copy","cloneBuffer","isPrototype","initCloneObject","copyObject","copySymbols","baseAssign","cloneFunc","cloneArrayBuffer","dataView","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneSet","initCloneByTag","props","arrayEach","subValue","arrayBuffer","newValue","cache","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","charAt","substr","toLowerCase","sanitizeWord","rules","replaceWord","replaceMap","keepMap","checkWord","bool","count","inclusive","pluralized","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","pluralizeLib","singularize","upcaseFirstLetter","downcaseFirstLetter","prettify","query","print","parseQuery","parse","graphQlDocumentToString","isPlainObject","pick","prop","isEqual","lodashIsEqual","lodashClone","enabled","log","console","groupCollapsed","PREFIX","messages","groupEnd","warn","variables","fetchPolicy","prettified","group","trim","baseModel","singularName","entity","pluralName","field","context","Context","getInstance","components","Number","Increment","Attr","BelongsTo","HasOne","MorphTo","MorphOne","model","originalFieldGenerator","bind","originalFields","boolean","relation","BelongsToMany","HasMany","HasManyThrough","MorphedByMany","MorphMany","MorphToMany","getModel","related","HasManyBy","Model","isFieldAttribute","_this","skipField","startsWith","skipFields","shouldSkipField","getRelations","foreignKey","relations","found","models","id","withAllRecursive","where","first","fieldName","relatedModel","eagerLoadList","eagerLoad","eagerSync","find","eagerSaveList","eagerSave","mock","$findMock","action","mocks","m","returnValue","r","$isPersisted","opts","cmp","f","cycles","aobj","bobj","isFinite","out","seenIndex","sort","getDirectiveNames","doc","definition","flattenSelections","selection","selectionNode","selected","directive","sources","checkDocument","operations","getOperationDefinition","getOperationName","getQueryDefinition","queryDef","getDefaultValues","defaultValues","_a","defaultValueObj","valueToObjectRepresentation","argObj","isIntValue","isFloatValue","isBooleanValue","isStringValue","isObjectValue","nestedArgObj_1","isVariable","variableValue","isListValue","listValue","nestedArgArrayObj","isEnumValue","isNullValue","cloneDeep","cloneDeepHelper","val","copy_1","child","copy_2","removeDirectivesFromDocument","docClone","removeDirectivesFromSelectionSet","agressiveRemove","some","dir","remove","directiveMatcher","getDirectiveMatcher","shouldKeep","isNotEmpty","fragments","document","def","getOperationDefinitionOrDie","symTable","fragment","createFragmentMap","getFragmentDefinitions","NetworkStatus","connectionRemoveConfig","willRemove","isEnv","env","NODE_ENV","isProduction","tryFunctionOrLogError","graphQLResultHasError","errors","Date","getTime","isNetworkRequestInFlight","networkStatus","_createClass","descriptor","protoProps","staticProps","hasSymbols","hasSymbol","getSymbol","observable","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","Observable","isObservable","hostReportError","setTimeout","enqueue","then","cleanupSubscription","subscription","cleanup","_cleanup","unsubscribe","closeSubscription","_observer","_queue","_state","notifySubscription","observer","onNotify","queue","flushSubscription","Subscription","subscriber","subscriptionObserver","SubscriptionObserver","_subscription","_subscriber","complete","reject","subscribe","done","_this2","_this3","_this4","C","hasSeed","hasValue","acc","_this5","_len","_key","startNext","v","from","_this6","subscriptions","outer","inner","completeIfDone","closed","s","method","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","err","return","_len2","items","_key2","require$$0","link","_super","__extends","isTerminating","request","fromError","errorValue","createOperation","starting","operationName","getKey","passthrough","forward","of","toLink","handler","ApolloLink","empty","links","y","left","right","leftLink","rightLink","second","firstLink","LinkError","nextLink","execute","transformedOperation","transformOperation","OPERATION_FIELDS","validateOperation","ponyfill","window","$$observable","LinkObservable","FetchType","generateErrorMessage","graphQLErrors","graphQLError","errorMessage","networkError","extraInfo","__proto__","ApolloError","scheduler","_b","shouldSubscribe","onSubscribe","isCurrentlyPolling","isTornDown","queryId","queryManager","generateQueryId","observers","subscriptionHandles","ObservableQuery","that","obs","removeQuery","lastError","lastResult","loading","storeValue","policy","queryStoreValue","queryStore","errorPolicy","partial","queryLoading","ready","stale","lastResultSnapshot","__assign","newResult","snapshot","isNetworkFetchPolicy","combinedOptions","fetchQuery","refetch","fetchMoreOptions","updateQuery","qid","normal","fetchMoreResult","previousResult","startGraphQLSubscription","subscriptionData","previous","onError","oldOptions","pollInterval","startPolling","stopPolling","tryFetch","setVariables","fetchResults","newVariables","mapFn","dataStore","markUpdateQueryResult","broadcastQueries","stopPollingQuery","startPollingQuery","setUpQuery","tearDownQuery","addObservableQuery","startQuery","queryListenerForObserver","sub","removeObservableQuery","stopQuery","DedupLink","getContext","forceFetch","toKey","operationKey","inFlightRequestObservables","delete","subscribers","subscription_1","singleObserver_1","sharedObserver","ssrMode","QueryScheduler","fetchType","catch","listener","registeredQueries","addQueryListener","addQueryOnInterval","interval","intervalQueries","checkInFlight","queryOptions","pollingOptions","poll","clearInterval","pollingTimers","setInterval","fetchQueriesOnInterval","MutationStore","store","mutationId","mutationString","mutation","QueryStore","previousQuery","isSetVariables","previousVariables","storePreviousVariables","isPoll","isRefetch","metadata","fetchMoreForQueryId","fetchMore","markQueryResultClient","observableQueryIds","res","queryDeduplication","_c","onBroadcast","_d","deduplicator","Deduplicator","QueryManager","optimisticResponse","updateQueriesByName","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","getCache","transformDocument","mutationDef","getMutationDefinition","setQuery","generateUpdateQueriesInfo","ret","queryName","queryIdsByName","updater","mutationStore","initMutation","markMutationInit","updateQueries","update","storeResult","buildOperationForLink","markMutationResult","markMutationError","markMutationComplete","refetchQueryPromises","refetchQueries_1","refetchQuery","promise","refetchQueryByName","all","needToFetch","names","shouldFetch","requestId","generateRequestId","cancel","updateQueryWatch","lastRequestId","invalidated","invalidate","initQuery","networkResult","fetchRequest","markQueryError","removeFetchQueryPromise","previouslyHadError","newData","observableQuery","getLastResult","getLastError","shouldNotifyIfLoading","networkStatusChanged","errorStatusChanged","notifyOnNetworkStatusChange","apolloError_1","info","isMissing","document_1","readResult","diff","optimistic","resultFromStore","isDifferentFromLastResult","queryDefinition","transformedOptions","returnPartialData","idCounter","addFetchQueryPromise","watchQuery","listeners","watch","callback","fetchQueryPromises","resetIds","queries","reset","clearStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getObservableQueryPromises","isCacheEnabled","transformedDoc","markSubscriptionResult","stopQueryInStore","read","queryIdOrObservable","foundObserveableQuery","resetLastResults","errorsFromStore","markQueryResult","refetchedQueries","getQuery","newInfo","extraContext","transformForLink","getCacheKey","config","dataIdFromObject","initialCache","DataStore","ignoreErrors","writeWithErrors","write","dataId","optimistic_1","recordOptimisticTransaction","orig","cacheWrites_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","performTransaction","update_1","removeOptimistic","hasSuggestedDevtools","ssrForceFetchDelay","connectToDevTools","defaultOptions","supportedCache","supportedDirectives","disableNetworkFetches","mutate","resetStore","defaultConnectToDevTools","__APOLLO_CLIENT__","top","__APOLLO_DEVTOOLS_GLOBAL_HOOK__","navigator","userAgent","debug","version","ApolloClient","initQueryManager","initProxy","readQuery","readFragment","writeQuery","writeFragment","writeData","cb","devToolsHookCb","payload","state","getStore","mutations","dataWithOptimisticResults","extract","resetStoreCallbacks","serializedState","restore","proxy","genericMessage","setPrototypeOf","InvariantError","framesToPop","invariant","KNOWN_DIRECTIVES","getStoreKeyName","filterKeys","queryArgs_1","filteredArgs_1","completeFieldName","stringifiedArgs","argumentsObjectFromField","argObj_1","resultKeyNameFromField","isField","isInlineFragment","isIdValue","idObject","generated","toIdValue","idConfig","typename","shouldInclude","directiveArguments","directiveName","ifArgument","ifValue","evaledValue","getFragmentQueryDocument","fragmentName","actualFragmentName","TYPENAME_FIELD","mergeHelper","pastCopies","isExtensible","shallowCopyForMerge","sourceKey","sourceValue","targetValue","selectionSetFromObj","justTypenameQuery","ApolloCache","rootId","typenameResult","__typename","dataToWrite","queryFromPojo","Cache","newest","oldest","max","dispose","Cp","getEntry","older","newer","clean","useSymbol","for","brand","globalKey","freeze","isObjRef","UniversalWeakMap","_weakMap","_strongMap","_getMap","canCreate","lookup","lookupArray","tuple","arguments$1","t","argc","isTuple","toArray","mustConvertThisToArray","desc","getOwnPropertyDescriptor","forEachArrayMethod","fakeNullFiber","getCurrentFiber","Fiber","reverse","current","fiber","getLocal","UNKNOWN_VALUE","emptySetPool","entryPool","assert","optionalMessage","Entry","parents","childValues","dirtyChildren","dirty","recomputing","reportOrphan","acquire","Ep","maybeReportOrphan","report","reportDirty","reportDirtyChild","reportClean","reportCleanChild","mightBeDirty","cv","childValue","setDirty","removeDirtyChild","dc","POOL_TARGET_SIZE","reallyRecompute","originalChildren","forgetChildren","local","currentParentEntry","threw","setClean","recompute","rememberParent","recomputeIfDirty","forgetChild","release","reusableEmptyArray","children","unsub","require$$1","require$$2","require$$3","disposable","makeCacheKey","Math","pow","normalizeOptions","testMap","set_1","testSet","add_1","frozen","seal","preventExtensions","haveWarned","shouldWarn","answer","HeuristicFragmentMatcher","idValue","CacheKeyNode","getOrCreate","hasOwn","depend","DepTrackingCache","defaultNormalizedCacheFactory","seed","cacheKeyRoot","reader","executeStoreQuery","executeSelectionSet","rootValue","contextValue","variableValues","fragmentMatcher","execContext","StoreReader","diffQueryAgainstStore","fragmentMatcherFunction","cacheRedirects","execResult","hasMissingFields","missing","tolerable","mainDefinition","queryDoc","fragmentDefinition","getMainDefinition","fragmentMap","finalResult","objectsToMerge","handleMissing","fieldResult","executeField","fragmentExecResult","mergeDeepArray","readStoreResult","storeKeyName","fieldValue","resolver","storeObj","jsonObject","json","readStoreResolver","resultKey","directiveObj_1","getDirectiveInfoFromField","combineExecResults","executeSubSelectedArray","assertSelectionSetForIdValue","execResults","childResult","defaultFragmentMatcher","ObjectCache","tslib_1.__extends","StoreWriter","writeResultToStore","operationDefinition","writeSelectionSetToStore","processedData","enhancedError","WriteError","enhanceErrorWithDocument","resultFieldKey","writeFieldToStore","isDefered","isClient","matches","fakeContext","storeObject","storeFieldName","directivesObj","storeKeyNameFromField","generatedId","processArrayValue","valueDataId","isGeneratedId","semanticId","isDataProcessed","escapedId","hadTypename","hasTypename","typenameChanged","mergeWithGenerated","generatedKey","realKey","real","madeChanges","realValue","newRealValue","itemDataId","defaultConfig","_id","addTypename","resultCaching","optimisticId","transaction","OptimisticCacheLayer","toObject","customResolvers","cacheResolvers","optimisticData","storeReader","storeWriter","maybeBroadcastWatch","InMemoryCache","readQueryFromStore","broadcastWatches","watches","idToRemove","toReapply","removedCount","layer","layer_1","silenceBroadcast","typenameDocumentCache","lastIndexOf","fallbackHttpConfig","http","includeQuery","includeExtensions","headers","accept","content-type","throwServerError","response","statusCode","status","serializeFetchParameter","p","label","serialized","parseError","createHttpLink","linkOptions","uri","fetcher","useGETForQueries","requestOptions","fetch","library","checkFetcher","linkConfig","fetchOptions","credentials","controller","chosenURI","fallbackURI","contextURI","selectURI","contextConfig","fallbackConfig","configs","signal","AbortController","_controller","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","queryParamsPrefix","newURI","setContext","text","bodyText","abort","ConnectionMode","ArgumentMode","whitelist","outgoingRecords","recursiveCall","isRelation","isRecursion","shouldIncludeOutgoingField","getRelatedModel","arrayModel_1","addRecordForRecursionDetection","transformOutgoingData","$id","$self","logger","transformIncomingData","localModel","connectionMode","NODES","edges","EDGES","newKey","isFieldNumber","parseFloat","endsWith","isTypeFieldOfPolymorphicRelation","forFilter","includes","shouldEagerSaveRelation","records","record","ids","parser","normalize","docCache","fragmentSourceMap","printFragmentWarnings","cacheKey","parsed","stripLoc","removeLocAtThisLevel","docType","valueType","astFragmentMap","substring","processFragments","gql","literals","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","apolloClient","httpLink","HttpLink","url","debugMode","bypassCache","logQuery","Apollo","getHeaders","Transformer","schema","getType","adapter","getRootQueryName","getRootMutationName","connection","typeName","Schema","getTypeNameOfField","PLAIN","allowNull","prepareSchemaTypeName","getRealType","ofType","TYPE","AUTO","database","Logger","DefaultAdapter","apollo","collectModels","schemaWillBeLoaded","getConnectionMode","X-GraphQL-Introspection-Query","simpleQuery","__schema","processSchema","determineQueryMode","name_1","findGlobalMock","globalMocks","entities","augment","multiple","allowIdFields","getMutation","params","buildArguments","getQueryFields","buildRelationsQuery","header","prepareArguments","buildField","signature","isForeignKey","skipFieldDueId","schemaField","findSchemaFieldForArgument","isConnectionField","typeOrValue","__type","getInputTypeName","QueryBuilder","determineAttributeType","isFilter","getFilterTypeName","inputFields","relationQueries","referencesItSelf","takeWhile","ignore","shouldEagerLoadRelation","newPath","isConnection","getArgumentMode","dispatch","dataKey","insertedData","loadSchema","returnsConnection","buildQuery","getNameForDestroy","parseInt","Store","insertData","newRecord","last","$name","transformedValue","getModelFromState","$mockHook","mockReturnValue","prepareArgs","Action","mutationName","getNameForFetch","transformArgs","getNameForPersist","getRecordWithId","deleteObsoleteRecord","newRecord_1","oldRecord","addRecordToArgs","$delete","getNameForPush","globalMockHook","parsedQuery","simpleMutation","setup","setupActions","setupModelMethods","RootActions","SimpleQuery","SimpleMutation","Actions","Fetch","persist","Persist","Push","destroy","Destroy","Mutate","Query","filterObj","customQuery","$mutate","$dispatch","$customQuery","$persist","$push","$destroy","$deleteAndDestroy","VuexORMGraphQL","VuexORMGraphQLPlugin","modelClass","installMock","addGlobalMock","$addMock","pl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hxB,MAAM,+CAGX,IAAI0yD,GAAKt+B,EAAQrtB,2HAbnBiqB,SACG,IAAIhxB,MAAM,iDAGZgxB,GAAQy6B,SAAShkB,MAAMinB,SAAS"} \ No newline at end of file +{"version":3,"file":"vuex-orm-graphql.umd.js","sources":["../node_modules/graphql/jsutils/invariant.js","../node_modules/graphql/language/source.js","../node_modules/graphql/language/location.js","../node_modules/graphql/error/printError.js","../node_modules/graphql/error/GraphQLError.js","../node_modules/graphql/error/syntaxError.js","../node_modules/graphql/error/locatedError.js","../node_modules/graphql/error/formatError.js","../node_modules/graphql/error/index.js","../node_modules/graphql/language/blockStringValue.js","../node_modules/graphql/language/lexer.js","../node_modules/graphql/language/kinds.js","../node_modules/graphql/language/directiveLocation.js","../node_modules/graphql/language/parser.js","../node_modules/graphql/language/visitor.js","../node_modules/graphql/language/printer.js","../node_modules/lodash.isequal/index.js","../node_modules/lodash.clone/index.js","../node_modules/pluralize/pluralize.js","../src/support/utils.ts","../src/common/logger.ts","../src/orm/model.ts","../node_modules/fast-json-stable-stringify/index.js","../node_modules/apollo-client/node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/cloneDeep.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/transform.ts","../node_modules/src/core/networkStatus.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/errorHandling.ts","../node_modules/apollo-client/node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/zen-observable/lib/Observable.js","../node_modules/zen-observable-ts/src/zenObservable.ts","../node_modules/zen-observable/index.js","../node_modules/apollo-link/src/linkUtils.ts","../node_modules/apollo-link/src/link.ts","../node_modules/apollo-link/node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/symbol-observable/es/index.js","../node_modules/symbol-observable/es/ponyfill.js","../node_modules/src/util/Observable.ts","../node_modules/src/errors/ApolloError.ts","../node_modules/src/core/types.ts","../node_modules/src/core/ObservableQuery.ts","../node_modules/apollo-link-dedup/src/dedupLink.ts","../node_modules/src/scheduler/scheduler.ts","../node_modules/src/data/mutations.ts","../node_modules/src/data/queries.ts","../node_modules/src/core/QueryManager.ts","../node_modules/src/data/store.ts","../node_modules/apollo-client/version.js","../node_modules/src/ApolloClient.ts","../node_modules/ts-invariant/lib/invariant.esm.js","../node_modules/apollo-utilities/src/storeUtils.ts","../node_modules/apollo-utilities/src/directives.ts","../node_modules/apollo-utilities/src/fragments.ts","../node_modules/apollo-utilities/src/util/assign.ts","../node_modules/apollo-utilities/src/getFromAST.ts","../node_modules/apollo-utilities/src/transform.ts","../node_modules/apollo-utilities/src/util/environment.ts","../node_modules/apollo-utilities/src/util/isEqual.ts","../node_modules/apollo-utilities/src/util/mergeDeep.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/utils.ts","../node_modules/apollo-cache-inmemory/node_modules/apollo-cache/src/cache.ts","../node_modules/optimism/lib/cache.js","../node_modules/immutable-tuple/dist/tuple.js","../node_modules/optimism/lib/local.js","../node_modules/optimism/lib/entry.js","../node_modules/optimism/lib/index.js","../node_modules/apollo-cache-inmemory/src/fixPolyfills.ts","../node_modules/apollo-cache-inmemory/src/fragmentMatcher.ts","../node_modules/apollo-cache-inmemory/src/cacheKeys.ts","../node_modules/apollo-cache-inmemory/src/depTrackingCache.ts","../node_modules/apollo-cache-inmemory/src/readFromStore.ts","../node_modules/apollo-cache-inmemory/src/objectCache.ts","../node_modules/apollo-cache-inmemory/src/writeToStore.ts","../node_modules/apollo-cache-inmemory/src/inMemoryCache.ts","../node_modules/apollo-link-http-common/src/index.ts","../node_modules/apollo-link-http/src/httpLink.ts","../src/adapters/adapter.ts","../src/graphql/transformer.ts","../node_modules/graphql-tag/src/index.js","../src/graphql/apollo.ts","../src/graphql/schema.ts","../src/adapters/builtin/default-adapter.ts","../src/common/context.ts","../src/graphql/introspection-query.ts","../src/graphql/query-builder.ts","../src/orm/store.ts","../src/actions/action.ts","../src/actions/destroy.ts","../src/actions/fetch.ts","../src/actions/mutate.ts","../src/actions/persist.ts","../src/actions/push.ts","../src/actions/query.ts","../src/actions/simple-query.ts","../src/actions/simple-mutation.ts","../src/vuex-orm-graphql.ts","../src/plugin.ts","../src/test-utils.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = invariant;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Source = undefined;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } } /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * A representation of source input to GraphQL.\n * `name` and `locationOffset` are optional. They are useful for clients who\n * store GraphQL documents in source files; for example, if the GraphQL input\n * starts at line 40 in a file named Foo.graphql, it might be useful for name to\n * be \"Foo.graphql\" and location to be `{ line: 40, column: 0 }`.\n * line and column in locationOffset are 1-indexed\n */\nvar Source = exports.Source = function Source(body, name, locationOffset) {\n _classCallCheck(this, Source);\n\n this.body = body;\n this.name = name || 'GraphQL request';\n this.locationOffset = locationOffset || { line: 1, column: 1 };\n !(this.locationOffset.line > 0) ? (0, _invariant2.default)(0, 'line in locationOffset is 1-indexed and must be positive') : void 0;\n !(this.locationOffset.column > 0) ? (0, _invariant2.default)(0, 'column in locationOffset is 1-indexed and must be positive') : void 0;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLocation = getLocation;\n\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}\n\n/**\n * Represents a location in a Source.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.printError = printError;\n\nvar _location = require('../language/location');\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nfunction printError(error) {\n var printedLocations = [];\n if (error.nodes) {\n error.nodes.forEach(function (node) {\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, (0, _location.getLocation)(node.loc.source, node.loc.start)));\n }\n });\n } else if (error.source && error.locations) {\n var source = error.source;\n error.locations.forEach(function (location) {\n printedLocations.push(highlightSourceAtLocation(source, location));\n });\n }\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction highlightSourceAtLocation(source, location) {\n var line = location.line;\n var lineOffset = source.locationOffset.line - 1;\n var columnOffset = getColumnOffset(source, location);\n var contextLine = line + lineOffset;\n var contextColumn = location.column + columnOffset;\n var prevLineNum = (contextLine - 1).toString();\n var lineNum = contextLine.toString();\n var nextLineNum = (contextLine + 1).toString();\n var padLen = nextLineNum.length;\n var lines = source.body.split(/\\r\\n|[\\n\\r]/g);\n lines[0] = whitespace(source.locationOffset.column - 1) + lines[0];\n var outputLines = [source.name + ' (' + contextLine + ':' + contextColumn + ')', line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];\n return outputLines.filter(Boolean).join('\\n');\n}\n\nfunction getColumnOffset(source, location) {\n return location.line === 1 ? source.locationOffset.column - 1 : 0;\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GraphQLError = GraphQLError;\n\nvar _printError = require('./printError');\n\nvar _location = require('../language/location');\n\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined;\n\n // Compute locations in the source for the given nodes/positions.\n var _source = source;\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n return list;\n }, []);\n }\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations = void 0;\n if (positions && source) {\n var providedSource = source;\n _locations = positions.map(function (pos) {\n return (0, _location.getLocation)(providedSource, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push((0, _location.getLocation)(node.loc.source, node.loc.start));\n }\n return list;\n }, []);\n }\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n value: extensions || originalError && originalError.extensions\n }\n });\n\n // Include (non-enumerable) stack trace.\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\n\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: { value: GraphQLError },\n name: { value: 'GraphQLError' },\n toString: {\n value: function toString() {\n return (0, _printError.printError)(this);\n }\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.syntaxError = syntaxError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction syntaxError(source, position, description) {\n return new _GraphQLError.GraphQLError('Syntax Error: ' + description, undefined, source, [position]);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.locatedError = locatedError;\n\nvar _GraphQLError = require('./GraphQLError');\n\n/**\n * Given an arbitrary Error, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\nfunction locatedError(originalError, nodes, path) {\n // Note: this uses a brand-check to support GraphQL errors originating from\n // other contexts.\n if (originalError && Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError);\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nexports.formatError = formatError;\n\nvar _invariant = require('../jsutils/invariant');\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nfunction formatError(error) {\n !error ? (0, _invariant2.default)(0, 'Received null or undefined error.') : void 0;\n return _extends({}, error.extensions, {\n message: error.message || 'An unknown error occurred.',\n locations: error.locations,\n path: error.path\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _GraphQLError = require('./GraphQLError');\n\nObject.defineProperty(exports, 'GraphQLError', {\n enumerable: true,\n get: function get() {\n return _GraphQLError.GraphQLError;\n }\n});\n\nvar _syntaxError = require('./syntaxError');\n\nObject.defineProperty(exports, 'syntaxError', {\n enumerable: true,\n get: function get() {\n return _syntaxError.syntaxError;\n }\n});\n\nvar _locatedError = require('./locatedError');\n\nObject.defineProperty(exports, 'locatedError', {\n enumerable: true,\n get: function get() {\n return _locatedError.locatedError;\n }\n});\n\nvar _printError = require('./printError');\n\nObject.defineProperty(exports, 'printError', {\n enumerable: true,\n get: function get() {\n return _printError.printError;\n }\n});\n\nvar _formatError = require('./formatError');\n\nObject.defineProperty(exports, 'formatError', {\n enumerable: true,\n get: function get() {\n return _formatError.formatError;\n }\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = blockStringValue;\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n */\nfunction blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g);\n\n // Remove common indentation from all lines but first.\n var commonIndent = null;\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n var indent = leadingWhitespace(line);\n if (indent < line.length && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n if (commonIndent === 0) {\n break;\n }\n }\n }\n\n if (commonIndent) {\n for (var _i = 1; _i < lines.length; _i++) {\n lines[_i] = lines[_i].slice(commonIndent);\n }\n }\n\n // Remove leading and trailing blank lines.\n while (lines.length > 0 && isBlank(lines[0])) {\n lines.shift();\n }\n while (lines.length > 0 && isBlank(lines[lines.length - 1])) {\n lines.pop();\n }\n\n // Return a string of the lines joined with U+000A.\n return lines.join('\\n');\n}\n\nfunction leadingWhitespace(str) {\n var i = 0;\n while (i < str.length && (str[i] === ' ' || str[i] === '\\t')) {\n i++;\n }\n return i;\n}\n\nfunction isBlank(str) {\n return leadingWhitespace(str) === str.length;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TokenKind = undefined;\nexports.createLexer = createLexer;\nexports.getTokenDesc = getTokenDesc;\n\nvar _error = require('../error');\n\nvar _blockStringValue = require('./blockStringValue');\n\nvar _blockStringValue2 = _interopRequireDefault(_blockStringValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Given a Source object, this returns a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction createLexer(source, options) {\n var startOfFileToken = new Tok(SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}\n\nfunction advanceLexer() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n}\n\nfunction lookahead() {\n var token = this.token;\n if (token.kind !== EOF) {\n do {\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = token.next || (token.next = readToken(this, token));\n } while (token.kind === COMMENT);\n }\n return token;\n}\n\n/**\n * The return type of createLexer.\n */\n\n\n// Each kind of token.\nvar SOF = '';\nvar EOF = '';\nvar BANG = '!';\nvar DOLLAR = '$';\nvar PAREN_L = '(';\nvar PAREN_R = ')';\nvar SPREAD = '...';\nvar COLON = ':';\nvar EQUALS = '=';\nvar AT = '@';\nvar BRACKET_L = '[';\nvar BRACKET_R = ']';\nvar BRACE_L = '{';\nvar PIPE = '|';\nvar BRACE_R = '}';\nvar NAME = 'Name';\nvar INT = 'Int';\nvar FLOAT = 'Float';\nvar STRING = 'String';\nvar BLOCK_STRING = 'BlockString';\nvar COMMENT = 'Comment';\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind = exports.TokenKind = {\n SOF: SOF,\n EOF: EOF,\n BANG: BANG,\n DOLLAR: DOLLAR,\n PAREN_L: PAREN_L,\n PAREN_R: PAREN_R,\n SPREAD: SPREAD,\n COLON: COLON,\n EQUALS: EQUALS,\n AT: AT,\n BRACKET_L: BRACKET_L,\n BRACKET_R: BRACKET_R,\n BRACE_L: BRACE_L,\n PIPE: PIPE,\n BRACE_R: BRACE_R,\n NAME: NAME,\n INT: INT,\n FLOAT: FLOAT,\n STRING: STRING,\n BLOCK_STRING: BLOCK_STRING,\n COMMENT: COMMENT\n};\n\n/**\n * A helper function to describe a token as a string for debugging\n */\nfunction getTokenDesc(token) {\n var value = token.value;\n return value ? token.kind + ' \"' + value + '\"' : token.kind;\n}\n\nvar charCodeAt = String.prototype.charCodeAt;\nvar slice = String.prototype.slice;\n\n/**\n * Helper function for constructing the Token object.\n */\nfunction Tok(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nTok.prototype.toJSON = Tok.prototype.inspect = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n};\n\nfunction printCharCode(code) {\n return (\n // NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n '\"\\\\u' + ('00' + code.toString(16).toUpperCase()).slice(-4) + '\"'\n );\n}\n\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace and comments until it finds the next lexable\n * token, then lexes punctuators immediately or calls the appropriate helper\n * function for more complicated tokens.\n */\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n\n var position = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + position - lexer.lineStart;\n\n if (position >= bodyLength) {\n return new Tok(EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, position);\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Cannot contain the invalid character ' + printCharCode(code) + '.');\n }\n\n switch (code) {\n // !\n case 33:\n return new Tok(BANG, position, position + 1, line, col, prev);\n // #\n case 35:\n return readComment(source, position, line, col, prev);\n // $\n case 36:\n return new Tok(DOLLAR, position, position + 1, line, col, prev);\n // (\n case 40:\n return new Tok(PAREN_L, position, position + 1, line, col, prev);\n // )\n case 41:\n return new Tok(PAREN_R, position, position + 1, line, col, prev);\n // .\n case 46:\n if (charCodeAt.call(body, position + 1) === 46 && charCodeAt.call(body, position + 2) === 46) {\n return new Tok(SPREAD, position, position + 3, line, col, prev);\n }\n break;\n // :\n case 58:\n return new Tok(COLON, position, position + 1, line, col, prev);\n // =\n case 61:\n return new Tok(EQUALS, position, position + 1, line, col, prev);\n // @\n case 64:\n return new Tok(AT, position, position + 1, line, col, prev);\n // [\n case 91:\n return new Tok(BRACKET_L, position, position + 1, line, col, prev);\n // ]\n case 93:\n return new Tok(BRACKET_R, position, position + 1, line, col, prev);\n // {\n case 123:\n return new Tok(BRACE_L, position, position + 1, line, col, prev);\n // |\n case 124:\n return new Tok(PIPE, position, position + 1, line, col, prev);\n // }\n case 125:\n return new Tok(BRACE_R, position, position + 1, line, col, prev);\n // A-Z _ a-z\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, position, line, col, prev);\n // - 0-9\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 return readNumber(source, position, code, line, col, prev);\n // \"\n case 34:\n if (charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n return readBlockString(source, position, line, col, prev);\n }\n return readString(source, position, line, col, prev);\n }\n\n throw (0, _error.syntaxError)(source, position, unexpectedCharacterMessage(code));\n}\n\n/**\n * Report a message that an unexpected character was encountered.\n */\nfunction unexpectedCharacterMessage(code) {\n if (code === 39) {\n // '\n return \"Unexpected single quote character ('), did you mean to use \" + 'a double quote (\")?';\n }\n\n return 'Cannot parse the unexpected character ' + printCharCode(code) + '.';\n}\n\n/**\n * Reads from body starting at startPosition until it finds a non-whitespace\n * or commented character, then returns the position of that character for\n * lexing.\n */\nfunction positionAfterWhitespace(body, startPosition, lexer) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // tab | space | comma | BOM\n if (code === 9 || code === 32 || code === 44 || code === 0xfeff) {\n ++position;\n } else if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (charCodeAt.call(body, position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n ++lexer.line;\n lexer.lineStart = position;\n } else {\n break;\n }\n }\n return position;\n}\n\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code = void 0;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && (\n // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n}\n\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = charCodeAt.call(body, ++position);\n }\n\n if (code === 48) {\n // 0\n code = charCodeAt.call(body, ++position);\n if (code >= 48 && code <= 57) {\n throw (0, _error.syntaxError)(source, position, 'Invalid number, unexpected digit after 0: ' + printCharCode(code) + '.');\n }\n } else {\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n\n code = charCodeAt.call(body, ++position);\n if (code === 43 || code === 45) {\n // + -\n code = charCodeAt.call(body, ++position);\n }\n position = readDigits(source, position, code);\n }\n\n return new Tok(isFloat ? FLOAT : INT, start, position, line, col, prev, slice.call(body, start, position));\n}\n\n/**\n * Returns the new position in the source after reading digits.\n */\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = charCodeAt.call(body, ++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n return position;\n }\n throw (0, _error.syntaxError)(source, position, 'Invalid number, expected digit but got: ' + printCharCode(code) + '.');\n}\n\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null &&\n // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += slice.call(body, chunkStart, position);\n return new Tok(STRING, start, position + 1, line, col, prev, value);\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n ++position;\n if (code === 92) {\n // \\\n value += slice.call(body, chunkStart, position - 1);\n code = charCodeAt.call(body, position);\n switch (code) {\n case 34:\n value += '\"';\n break;\n case 47:\n value += '/';\n break;\n case 92:\n value += '\\\\';\n break;\n case 98:\n value += '\\b';\n break;\n case 102:\n value += '\\f';\n break;\n case 110:\n value += '\\n';\n break;\n case 114:\n value += '\\r';\n break;\n case 116:\n value += '\\t';\n break;\n case 117:\n // u\n var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));\n if (charCode < 0) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: ' + ('\\\\u' + body.slice(position + 1, position + 5) + '.'));\n }\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n default:\n throw (0, _error.syntaxError)(source, position, 'Invalid character escape sequence: \\\\' + String.fromCharCode(code) + '.');\n }\n ++position;\n chunkStart = position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\nfunction readBlockString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n rawValue += slice.call(body, chunkStart, position);\n return new Tok(BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockStringValue2.default)(rawValue));\n }\n\n // SourceCharacter\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw (0, _error.syntaxError)(source, position, 'Invalid character within String: ' + printCharCode(code) + '.');\n }\n\n // Escape Triple-Quote (\\\"\"\")\n if (code === 92 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34 && charCodeAt.call(body, position + 3) === 34) {\n rawValue += slice.call(body, chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw (0, _error.syntaxError)(source, position, 'Unterminated string.');\n}\n\n/**\n * Converts four hexidecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\nfunction readName(source, position, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var end = position + 1;\n var code = 0;\n while (end !== bodyLength && (code = charCodeAt.call(body, end)) !== null && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++end;\n }\n return new Tok(NAME, position, end, line, col, prev, slice.call(body, position, end));\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n// Name\n\nvar NAME = exports.NAME = 'Name';\n\n// Document\n\nvar DOCUMENT = exports.DOCUMENT = 'Document';\nvar OPERATION_DEFINITION = exports.OPERATION_DEFINITION = 'OperationDefinition';\nvar VARIABLE_DEFINITION = exports.VARIABLE_DEFINITION = 'VariableDefinition';\nvar VARIABLE = exports.VARIABLE = 'Variable';\nvar SELECTION_SET = exports.SELECTION_SET = 'SelectionSet';\nvar FIELD = exports.FIELD = 'Field';\nvar ARGUMENT = exports.ARGUMENT = 'Argument';\n\n// Fragments\n\nvar FRAGMENT_SPREAD = exports.FRAGMENT_SPREAD = 'FragmentSpread';\nvar INLINE_FRAGMENT = exports.INLINE_FRAGMENT = 'InlineFragment';\nvar FRAGMENT_DEFINITION = exports.FRAGMENT_DEFINITION = 'FragmentDefinition';\n\n// Values\n\nvar INT = exports.INT = 'IntValue';\nvar FLOAT = exports.FLOAT = 'FloatValue';\nvar STRING = exports.STRING = 'StringValue';\nvar BOOLEAN = exports.BOOLEAN = 'BooleanValue';\nvar NULL = exports.NULL = 'NullValue';\nvar ENUM = exports.ENUM = 'EnumValue';\nvar LIST = exports.LIST = 'ListValue';\nvar OBJECT = exports.OBJECT = 'ObjectValue';\nvar OBJECT_FIELD = exports.OBJECT_FIELD = 'ObjectField';\n\n// Directives\n\nvar DIRECTIVE = exports.DIRECTIVE = 'Directive';\n\n// Types\n\nvar NAMED_TYPE = exports.NAMED_TYPE = 'NamedType';\nvar LIST_TYPE = exports.LIST_TYPE = 'ListType';\nvar NON_NULL_TYPE = exports.NON_NULL_TYPE = 'NonNullType';\n\n// Type System Definitions\n\nvar SCHEMA_DEFINITION = exports.SCHEMA_DEFINITION = 'SchemaDefinition';\nvar OPERATION_TYPE_DEFINITION = exports.OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';\n\n// Type Definitions\n\nvar SCALAR_TYPE_DEFINITION = exports.SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';\nvar OBJECT_TYPE_DEFINITION = exports.OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';\nvar FIELD_DEFINITION = exports.FIELD_DEFINITION = 'FieldDefinition';\nvar INPUT_VALUE_DEFINITION = exports.INPUT_VALUE_DEFINITION = 'InputValueDefinition';\nvar INTERFACE_TYPE_DEFINITION = exports.INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';\nvar UNION_TYPE_DEFINITION = exports.UNION_TYPE_DEFINITION = 'UnionTypeDefinition';\nvar ENUM_TYPE_DEFINITION = exports.ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';\nvar ENUM_VALUE_DEFINITION = exports.ENUM_VALUE_DEFINITION = 'EnumValueDefinition';\nvar INPUT_OBJECT_TYPE_DEFINITION = exports.INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';\n\n// Type Extensions\n\nvar SCALAR_TYPE_EXTENSION = exports.SCALAR_TYPE_EXTENSION = 'ScalarTypeExtension';\nvar OBJECT_TYPE_EXTENSION = exports.OBJECT_TYPE_EXTENSION = 'ObjectTypeExtension';\nvar INTERFACE_TYPE_EXTENSION = exports.INTERFACE_TYPE_EXTENSION = 'InterfaceTypeExtension';\nvar UNION_TYPE_EXTENSION = exports.UNION_TYPE_EXTENSION = 'UnionTypeExtension';\nvar ENUM_TYPE_EXTENSION = exports.ENUM_TYPE_EXTENSION = 'EnumTypeExtension';\nvar INPUT_OBJECT_TYPE_EXTENSION = exports.INPUT_OBJECT_TYPE_EXTENSION = 'InputObjectTypeExtension';\n\n// Directive Definitions\n\nvar DIRECTIVE_DEFINITION = exports.DIRECTIVE_DEFINITION = 'DirectiveDefinition';","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation = exports.DirectiveLocation = {\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n};\n\n/**\n * The enum type representing the directive location values.\n */","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.parse = parse;\nexports.parseValue = parseValue;\nexports.parseType = parseType;\nexports.parseConstValue = parseConstValue;\nexports.parseTypeReference = parseTypeReference;\nexports.parseNamedType = parseNamedType;\n\nvar _source = require('./source');\n\nvar _error = require('../error');\n\nvar _lexer = require('./lexer');\n\nvar _kinds = require('./kinds');\n\nvar _directiveLocation = require('./directiveLocation');\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\n\n\n/**\n * Configuration options to control parser behavior\n */\nfunction parse(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n if (!(sourceObj instanceof _source.Source)) {\n throw new TypeError('Must provide Source. Received: ' + String(sourceObj));\n }\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n return parseDocument(lexer);\n}\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction parseValue(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var value = parseValueLiteral(lexer, false);\n expect(lexer, _lexer.TokenKind.EOF);\n return value;\n}\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\nfunction parseType(source, options) {\n var sourceObj = typeof source === 'string' ? new _source.Source(source) : source;\n var lexer = (0, _lexer.createLexer)(sourceObj, options || {});\n expect(lexer, _lexer.TokenKind.SOF);\n var type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.EOF);\n return type;\n}\n\n/**\n * Converts a name lex token into a name parse node.\n */\nfunction parseName(lexer) {\n var token = expect(lexer, _lexer.TokenKind.NAME);\n return {\n kind: _kinds.NAME,\n value: token.value,\n loc: loc(lexer, token)\n };\n}\n\n// Implements the parsing rules in the Document section.\n\n/**\n * Document : Definition+\n */\nfunction parseDocument(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SOF);\n var definitions = [];\n do {\n definitions.push(parseDefinition(lexer));\n } while (!skip(lexer, _lexer.TokenKind.EOF));\n\n return {\n kind: _kinds.DOCUMENT,\n definitions: definitions,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n */\nfunction parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n/**\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\nfunction parseExecutableDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseOperationDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n\n// Implements the parsing rules in the Operations section.\n\n/**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\nfunction parseOperationDefinition(lexer) {\n var start = lexer.token;\n if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n var operation = parseOperationType(lexer);\n var name = void 0;\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n name = parseName(lexer);\n }\n return {\n kind: _kinds.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: parseVariableDefinitions(lexer),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationType : one of query mutation subscription\n */\nfunction parseOperationType(lexer) {\n var operationToken = expect(lexer, _lexer.TokenKind.NAME);\n switch (operationToken.value) {\n case 'query':\n return 'query';\n case 'mutation':\n return 'mutation';\n case 'subscription':\n return 'subscription';\n }\n\n throw unexpected(lexer, operationToken);\n}\n\n/**\n * VariableDefinitions : ( VariableDefinition+ )\n */\nfunction parseVariableDefinitions(lexer) {\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, parseVariableDefinition, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * VariableDefinition : Variable : Type DefaultValue?\n */\nfunction parseVariableDefinition(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, _lexer.TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, _lexer.TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Variable : $ Name\n */\nfunction parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.DOLLAR);\n return {\n kind: _kinds.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * SelectionSet : { Selection+ }\n */\nfunction parseSelectionSet(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.SELECTION_SET,\n selections: many(lexer, _lexer.TokenKind.BRACE_L, parseSelection, _lexer.TokenKind.BRACE_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\nfunction parseSelection(lexer) {\n return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}\n\n/**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\nfunction parseField(lexer) {\n var start = lexer.token;\n\n var nameOrAlias = parseName(lexer);\n var alias = void 0;\n var name = void 0;\n if (skip(lexer, _lexer.TokenKind.COLON)) {\n alias = nameOrAlias;\n name = parseName(lexer);\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: _kinds.FIELD,\n alias: alias,\n name: name,\n arguments: parseArguments(lexer, false),\n directives: parseDirectives(lexer, false),\n selectionSet: peek(lexer, _lexer.TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\nfunction parseArguments(lexer, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, item, _lexer.TokenKind.PAREN_R) : [];\n}\n\n/**\n * Argument[Const] : Name : Value[?Const]\n */\nfunction parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}\n\nfunction parseConstArgument(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseConstValue(lexer)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Fragments section.\n\n/**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\nfunction parseFragment(lexer) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.SPREAD);\n if (peek(lexer, _lexer.TokenKind.NAME) && lexer.token.value !== 'on') {\n return {\n kind: _kinds.FRAGMENT_SPREAD,\n name: parseFragmentName(lexer),\n directives: parseDirectives(lexer, false),\n loc: loc(lexer, start)\n };\n }\n var typeCondition = void 0;\n if (lexer.token.value === 'on') {\n lexer.advance();\n typeCondition = parseNamedType(lexer);\n }\n return {\n kind: _kinds.INLINE_FRAGMENT,\n typeCondition: typeCondition,\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\nfunction parseFragmentDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'fragment');\n // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n if (lexer.options.experimentalFragmentVariables) {\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n variableDefinitions: parseVariableDefinitions(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n return {\n kind: _kinds.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * FragmentName : Name but not `on`\n */\nfunction parseFragmentName(lexer) {\n if (lexer.token.value === 'on') {\n throw unexpected(lexer);\n }\n return parseName(lexer);\n}\n\n// Implements the parsing rules in the Values section.\n\n/**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\nfunction parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}\n\nfunction parseStringLiteral(lexer) {\n var token = lexer.token;\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n block: token.kind === _lexer.TokenKind.BLOCK_STRING,\n loc: loc(lexer, token)\n };\n}\n\nfunction parseConstValue(lexer) {\n return parseValueLiteral(lexer, true);\n}\n\nfunction parseValueValue(lexer) {\n return parseValueLiteral(lexer, false);\n}\n\n/**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\nfunction parseList(lexer, isConst) {\n var start = lexer.token;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: _kinds.LIST,\n values: any(lexer, _lexer.TokenKind.BRACKET_L, item, _lexer.TokenKind.BRACKET_R),\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\nfunction parseObject(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.BRACE_L);\n var fields = [];\n while (!skip(lexer, _lexer.TokenKind.BRACE_R)) {\n fields.push(parseObjectField(lexer, isConst));\n }\n return {\n kind: _kinds.OBJECT,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectField[Const] : Name : Value[?Const]\n */\nfunction parseObjectField(lexer, isConst) {\n var start = lexer.token;\n return {\n kind: _kinds.OBJECT_FIELD,\n name: parseName(lexer),\n value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, isConst)),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Directives section.\n\n/**\n * Directives[Const] : Directive[?Const]+\n */\nfunction parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}\n\n/**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\nfunction parseDirective(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, _lexer.TokenKind.AT);\n return {\n kind: _kinds.DIRECTIVE,\n name: parseName(lexer),\n arguments: parseArguments(lexer, isConst),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Types section.\n\n/**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\nfunction parseTypeReference(lexer) {\n var start = lexer.token;\n var type = void 0;\n if (skip(lexer, _lexer.TokenKind.BRACKET_L)) {\n type = parseTypeReference(lexer);\n expect(lexer, _lexer.TokenKind.BRACKET_R);\n type = {\n kind: _kinds.LIST_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n } else {\n type = parseNamedType(lexer);\n }\n if (skip(lexer, _lexer.TokenKind.BANG)) {\n return {\n kind: _kinds.NON_NULL_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n }\n return type;\n}\n\n/**\n * NamedType : Name\n */\nfunction parseNamedType(lexer) {\n var start = lexer.token;\n return {\n kind: _kinds.NAMED_TYPE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n\n// Implements the parsing rules in the Type Definition section.\n\n/**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - TypeExtension\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\nfunction parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeDefinition(lexer);\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n case 'union':\n return parseUnionTypeDefinition(lexer);\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n case 'extend':\n return parseTypeExtension(lexer);\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\nfunction peekDescription(lexer) {\n return peek(lexer, _lexer.TokenKind.STRING) || peek(lexer, _lexer.TokenKind.BLOCK_STRING);\n}\n\n/**\n * Description : StringValue\n */\nfunction parseDescription(lexer) {\n if (peekDescription(lexer)) {\n return parseStringLiteral(lexer);\n }\n}\n\n/**\n * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ }\n */\nfunction parseSchemaDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = many(lexer, _lexer.TokenKind.BRACE_L, parseOperationTypeDefinition, _lexer.TokenKind.BRACE_R);\n return {\n kind: _kinds.SCHEMA_DEFINITION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * OperationTypeDefinition : OperationType : NamedType\n */\nfunction parseOperationTypeDefinition(lexer) {\n var start = lexer.token;\n var operation = parseOperationType(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseNamedType(lexer);\n return {\n kind: _kinds.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\nfunction parseScalarTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\nfunction parseObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ImplementsInterfaces : implements NamedType+\n */\nfunction parseImplementsInterfaces(lexer) {\n var types = [];\n if (lexer.token.value === 'implements') {\n lexer.advance();\n do {\n types.push(parseNamedType(lexer));\n } while (peek(lexer, _lexer.TokenKind.NAME));\n }\n return types;\n}\n\n/**\n * FieldsDefinition : { FieldDefinition+ }\n */\nfunction parseFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseFieldDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\nfunction parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\nfunction parseArgumentDefs(lexer) {\n if (!peek(lexer, _lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer, _lexer.TokenKind.PAREN_L, parseInputValueDef, _lexer.TokenKind.PAREN_R);\n}\n\n/**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\nfunction parseInputValueDef(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var defaultValue = void 0;\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n defaultValue = parseConstValue(lexer);\n }\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\nfunction parseInterfaceTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: _kinds.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? MemberTypesDefinition?\n */\nfunction parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n return {\n kind: _kinds.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * MemberTypesDefinition : = MemberTypes\n *\n * MemberTypes :\n * - `|`? NamedType\n * - MemberTypes | NamedType\n */\nfunction parseMemberTypesDefinition(lexer) {\n var types = [];\n if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n }\n return types;\n}\n\n/**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\nfunction parseEnumTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n return {\n kind: _kinds.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\nfunction parseEnumValuesDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseEnumValueDefinition, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\nfunction parseEnumValueDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\nfunction parseInputObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\nfunction parseInputFieldsDefinition(lexer) {\n return peek(lexer, _lexer.TokenKind.BRACE_L) ? many(lexer, _lexer.TokenKind.BRACE_L, parseInputValueDef, _lexer.TokenKind.BRACE_R) : [];\n}\n\n/**\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\nfunction parseTypeExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n case 'type':\n return parseObjectTypeExtension(lexer);\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n case 'union':\n return parseUnionTypeExtension(lexer);\n case 'enum':\n return parseEnumTypeExtension(lexer);\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\n/**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\nfunction parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\nfunction parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InterfaceTypeExtension :\n * - extend interface Name Directives[Const]? FieldsDefinition\n * - extend interface Name Directives[Const]\n */\nfunction parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? MemberTypesDefinition\n * - extend union Name Directives[Const]\n */\nfunction parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseMemberTypesDefinition(lexer);\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\nfunction parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\nfunction parseInputObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n return {\n kind: _kinds.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? on DirectiveLocations\n */\nfunction parseDirectiveDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'directive');\n expect(lexer, _lexer.TokenKind.AT);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expectKeyword(lexer, 'on');\n var locations = parseDirectiveLocations(lexer);\n return {\n kind: _kinds.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n locations: locations,\n loc: loc(lexer, start)\n };\n}\n\n/**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\nfunction parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}\n\n/*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\nfunction parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n if (_directiveLocation.DirectiveLocation.hasOwnProperty(name.value)) {\n return name;\n }\n throw unexpected(lexer, start);\n}\n\n// Core parsing utility functions\n\n/**\n * Returns a location object, used to identify the place in\n * the source that created a given parsed object.\n */\nfunction loc(lexer, startToken) {\n if (!lexer.options.noLocation) {\n return new Loc(startToken, lexer.lastToken, lexer.source);\n }\n}\n\nfunction Loc(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n}\n\n// Print a simplified form when appearing in JSON/util.inspect.\nLoc.prototype.toJSON = Loc.prototype.inspect = function toJSON() {\n return { start: this.start, end: this.end };\n};\n\n/**\n * Determines if the next token is of a given kind\n */\nfunction peek(lexer, kind) {\n return lexer.token.kind === kind;\n}\n\n/**\n * If the next token is of the given kind, return true after advancing\n * the lexer. Otherwise, do not change the parser state and return false.\n */\nfunction skip(lexer, kind) {\n var match = lexer.token.kind === kind;\n if (match) {\n lexer.advance();\n }\n return match;\n}\n\n/**\n * If the next token is of the given kind, return that token after advancing\n * the lexer. Otherwise, do not change the parser state and throw an error.\n */\nfunction expect(lexer, kind) {\n var token = lexer.token;\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * If the next token is a keyword with the given value, return that token after\n * advancing the lexer. Otherwise, do not change the parser state and return\n * false.\n */\nfunction expectKeyword(lexer, value) {\n var token = lexer.token;\n if (token.kind === _lexer.TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected \"' + value + '\", found ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Helper function for creating an error when an unexpected lexed token\n * is encountered.\n */\nfunction unexpected(lexer, atToken) {\n var token = atToken || lexer.token;\n return (0, _error.syntaxError)(lexer.source, token.start, 'Unexpected ' + (0, _lexer.getTokenDesc)(token));\n}\n\n/**\n * Returns a possibly empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction any(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}\n\n/**\n * Returns a non-empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\nfunction many(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [parseFn(lexer)];\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n return nodes;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.visit = visit;\nexports.visitInParallel = visitInParallel;\nexports.visitWithTypeInfo = visitWithTypeInfo;\nexports.getVisitFn = getVisitFn;\n\n\n/**\n * A visitor is comprised of visit functions, which are called on each node\n * during the visitor's traversal.\n */\n\n\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar QueryDocumentKeys = exports.QueryDocumentKeys = {\n Name: [],\n\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name',\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n\n Directive: ['name', 'arguments'],\n\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations']\n};\n\n/**\n * A KeyMap describes each the traversable properties of each kind of node.\n */\nvar BREAK = exports.BREAK = {};\n\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\nfunction visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n node = clone;\n }\n var editOffset = 0;\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n if (inArray) {\n editKey -= editOffset;\n }\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n if (node === null || node === undefined) {\n continue;\n }\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + JSON.stringify(node));\n }\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = { inArray: inArray, index: index, keys: keys, edits: edits, prev: stack };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n if (parent) {\n ancestors.push(parent);\n }\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\nfunction visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\nfunction visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}\n\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\nfunction getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n var specificKindVisitor = specificVisitor[kind];\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.print = print;\n\nvar _visitor = require('./visitor');\n\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\nfunction print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n} /**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n\n // Document\n\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet;\n // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n\n\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue;\n return variable + ': ' + type + wrap(' = ', defaultValue);\n },\n\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n\n // Fragments\n\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (\n // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'fragment ' + name + wrap('(', join(variableDefinitions, ', '), ')') + ' ' + ('on ' + typeCondition + ' ' + wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n\n // Value\n\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return JSON.stringify(value);\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n\n // Directive\n\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n\n // Type\n\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n\n // Type System Definitions\n\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n\n ScalarTypeDefinition: function ScalarTypeDefinition(_ref22) {\n var description = _ref22.description,\n name = _ref22.name,\n directives = _ref22.directives;\n return join([description, join(['scalar', name, join(directives, ' ')], ' ')], '\\n');\n },\n\n ObjectTypeDefinition: function ObjectTypeDefinition(_ref23) {\n var description = _ref23.description,\n name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join([description, join(['type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n FieldDefinition: function FieldDefinition(_ref24) {\n var description = _ref24.description,\n name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return join([description, name + wrap('(', join(args, ', '), ')') + ': ' + type + wrap(' ', join(directives, ' '))], '\\n');\n },\n\n InputValueDefinition: function InputValueDefinition(_ref25) {\n var description = _ref25.description,\n name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([description, join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ')], '\\n');\n },\n\n InterfaceTypeDefinition: function InterfaceTypeDefinition(_ref26) {\n var description = _ref26.description,\n name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join([description, join(['interface', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n UnionTypeDefinition: function UnionTypeDefinition(_ref27) {\n var description = _ref27.description,\n name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join([description, join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ')], '\\n');\n },\n\n EnumTypeDefinition: function EnumTypeDefinition(_ref28) {\n var description = _ref28.description,\n name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join([description, join(['enum', name, join(directives, ' '), block(values)], ' ')], '\\n');\n },\n\n EnumValueDefinition: function EnumValueDefinition(_ref29) {\n var description = _ref29.description,\n name = _ref29.name,\n directives = _ref29.directives;\n return join([description, join([name, join(directives, ' ')], ' ')], '\\n');\n },\n\n InputObjectTypeDefinition: function InputObjectTypeDefinition(_ref30) {\n var description = _ref30.description,\n name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join([description, join(['input', name, join(directives, ' '), block(fields)], ' ')], '\\n');\n },\n\n ScalarTypeExtension: function ScalarTypeExtension(_ref31) {\n var name = _ref31.name,\n directives = _ref31.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n\n ObjectTypeExtension: function ObjectTypeExtension(_ref32) {\n var name = _ref32.name,\n interfaces = _ref32.interfaces,\n directives = _ref32.directives,\n fields = _ref32.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ', ')), join(directives, ' '), block(fields)], ' ');\n },\n\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives,\n fields = _ref33.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n\n UnionTypeExtension: function UnionTypeExtension(_ref34) {\n var name = _ref34.name,\n directives = _ref34.directives,\n types = _ref34.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n\n EnumTypeExtension: function EnumTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n values = _ref35.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n fields = _ref36.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n },\n\n DirectiveDefinition: function DirectiveDefinition(_ref37) {\n var description = _ref37.description,\n name = _ref37.name,\n args = _ref37.arguments,\n locations = _ref37.locations;\n return join([description, 'directive @' + name + wrap('(', join(args, ', '), ')') + ' on ' + join(locations, ' | ')], '\\n');\n }\n};\n\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\nfunction block(array) {\n return array && array.length !== 0 ? indent('{\\n' + join(array, '\\n')) + '\\n}' : '';\n}\n\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && maybeString.replace(/\\n/g, '\\n ');\n}\n\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\nfunction printBlockString(value, isDescription) {\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? '\"\"\"' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"' : isDescription ? '\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"') + '\\n\"\"\"' : indent('\"\"\"\\n' + value.replace(/\"\"\"/g, '\\\\\"\"\"')) + '\\n\"\"\"';\n}","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, false, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = clone;\n","/* global define */\n\n(function (root, pluralize) {\n /* istanbul ignore else */\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\n // Node.\n module.exports = pluralize();\n } else if (typeof define === 'function' && define.amd) {\n // AMD, registers as an anonymous module.\n define(function () {\n return pluralize();\n });\n } else {\n // Browser global.\n root.pluralize = pluralize();\n }\n})(this, function () {\n // Rule storage - pluralize and singularize need to be run sequentially,\n // while other rules can be optimized using an object for instant lookups.\n var pluralRules = [];\n var singularRules = [];\n var uncountables = {};\n var irregularPlurals = {};\n var irregularSingles = {};\n\n /**\n * Sanitize a pluralization rule to a usable regular expression.\n *\n * @param {(RegExp|string)} rule\n * @return {RegExp}\n */\n function sanitizeRule (rule) {\n if (typeof rule === 'string') {\n return new RegExp('^' + rule + '$', 'i');\n }\n\n return rule;\n }\n\n /**\n * Pass in a word token to produce a function that can replicate the case on\n * another word.\n *\n * @param {string} word\n * @param {string} token\n * @return {Function}\n */\n function restoreCase (word, token) {\n // Tokens are an exact match.\n if (word === token) return token;\n\n // Upper cased words. E.g. \"HELLO\".\n if (word === word.toUpperCase()) return token.toUpperCase();\n\n // Title cased words. E.g. \"Title\".\n if (word[0] === word[0].toUpperCase()) {\n return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();\n }\n\n // Lower cased words. E.g. \"test\".\n return token.toLowerCase();\n }\n\n /**\n * Interpolate a regexp string.\n *\n * @param {string} str\n * @param {Array} args\n * @return {string}\n */\n function interpolate (str, args) {\n return str.replace(/\\$(\\d{1,2})/g, function (match, index) {\n return args[index] || '';\n });\n }\n\n /**\n * Replace a word using a rule.\n *\n * @param {string} word\n * @param {Array} rule\n * @return {string}\n */\n function replace (word, rule) {\n return word.replace(rule[0], function (match, index) {\n var result = interpolate(rule[1], arguments);\n\n if (match === '') {\n return restoreCase(word[index - 1], result);\n }\n\n return restoreCase(match, result);\n });\n }\n\n /**\n * Sanitize a word by passing in the word and sanitization rules.\n *\n * @param {string} token\n * @param {string} word\n * @param {Array} rules\n * @return {string}\n */\n function sanitizeWord (token, word, rules) {\n // Empty string or doesn't need fixing.\n if (!token.length || uncountables.hasOwnProperty(token)) {\n return word;\n }\n\n var len = rules.length;\n\n // Iterate over the sanitization rules and use the first one to match.\n while (len--) {\n var rule = rules[len];\n\n if (rule[0].test(word)) return replace(word, rule);\n }\n\n return word;\n }\n\n /**\n * Replace a word with the updated word.\n *\n * @param {Object} replaceMap\n * @param {Object} keepMap\n * @param {Array} rules\n * @return {Function}\n */\n function replaceWord (replaceMap, keepMap, rules) {\n return function (word) {\n // Get the correct token and case restoration functions.\n var token = word.toLowerCase();\n\n // Check against the keep object map.\n if (keepMap.hasOwnProperty(token)) {\n return restoreCase(word, token);\n }\n\n // Check against the replacement map for a direct word replacement.\n if (replaceMap.hasOwnProperty(token)) {\n return restoreCase(word, replaceMap[token]);\n }\n\n // Run all the rules against the word.\n return sanitizeWord(token, word, rules);\n };\n }\n\n /**\n * Check if a word is part of the map.\n */\n function checkWord (replaceMap, keepMap, rules, bool) {\n return function (word) {\n var token = word.toLowerCase();\n\n if (keepMap.hasOwnProperty(token)) return true;\n if (replaceMap.hasOwnProperty(token)) return false;\n\n return sanitizeWord(token, token, rules) === token;\n };\n }\n\n /**\n * Pluralize or singularize a word based on the passed in count.\n *\n * @param {string} word\n * @param {number} count\n * @param {boolean} inclusive\n * @return {string}\n */\n function pluralize (word, count, inclusive) {\n var pluralized = count === 1\n ? pluralize.singular(word) : pluralize.plural(word);\n\n return (inclusive ? count + ' ' : '') + pluralized;\n }\n\n /**\n * Pluralize a word.\n *\n * @type {Function}\n */\n pluralize.plural = replaceWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Check if a word is plural.\n *\n * @type {Function}\n */\n pluralize.isPlural = checkWord(\n irregularSingles, irregularPlurals, pluralRules\n );\n\n /**\n * Singularize a word.\n *\n * @type {Function}\n */\n pluralize.singular = replaceWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Check if a word is singular.\n *\n * @type {Function}\n */\n pluralize.isSingular = checkWord(\n irregularPlurals, irregularSingles, singularRules\n );\n\n /**\n * Add a pluralization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addPluralRule = function (rule, replacement) {\n pluralRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add a singularization rule to the collection.\n *\n * @param {(string|RegExp)} rule\n * @param {string} replacement\n */\n pluralize.addSingularRule = function (rule, replacement) {\n singularRules.push([sanitizeRule(rule), replacement]);\n };\n\n /**\n * Add an uncountable word rule.\n *\n * @param {(string|RegExp)} word\n */\n pluralize.addUncountableRule = function (word) {\n if (typeof word === 'string') {\n uncountables[word.toLowerCase()] = true;\n return;\n }\n\n // Set singular and plural references for the word.\n pluralize.addPluralRule(word, '$0');\n pluralize.addSingularRule(word, '$0');\n };\n\n /**\n * Add an irregular word definition.\n *\n * @param {string} single\n * @param {string} plural\n */\n pluralize.addIrregularRule = function (single, plural) {\n plural = plural.toLowerCase();\n single = single.toLowerCase();\n\n irregularSingles[single] = plural;\n irregularPlurals[plural] = single;\n };\n\n /**\n * Irregular rules.\n */\n [\n // Pronouns.\n ['I', 'we'],\n ['me', 'us'],\n ['he', 'they'],\n ['she', 'they'],\n ['them', 'them'],\n ['myself', 'ourselves'],\n ['yourself', 'yourselves'],\n ['itself', 'themselves'],\n ['herself', 'themselves'],\n ['himself', 'themselves'],\n ['themself', 'themselves'],\n ['is', 'are'],\n ['was', 'were'],\n ['has', 'have'],\n ['this', 'these'],\n ['that', 'those'],\n // Words ending in with a consonant and `o`.\n ['echo', 'echoes'],\n ['dingo', 'dingoes'],\n ['volcano', 'volcanoes'],\n ['tornado', 'tornadoes'],\n ['torpedo', 'torpedoes'],\n // Ends with `us`.\n ['genus', 'genera'],\n ['viscus', 'viscera'],\n // Ends with `ma`.\n ['stigma', 'stigmata'],\n ['stoma', 'stomata'],\n ['dogma', 'dogmata'],\n ['lemma', 'lemmata'],\n ['schema', 'schemata'],\n ['anathema', 'anathemata'],\n // Other irregular rules.\n ['ox', 'oxen'],\n ['axe', 'axes'],\n ['die', 'dice'],\n ['yes', 'yeses'],\n ['foot', 'feet'],\n ['eave', 'eaves'],\n ['goose', 'geese'],\n ['tooth', 'teeth'],\n ['quiz', 'quizzes'],\n ['human', 'humans'],\n ['proof', 'proofs'],\n ['carve', 'carves'],\n ['valve', 'valves'],\n ['looey', 'looies'],\n ['thief', 'thieves'],\n ['groove', 'grooves'],\n ['pickaxe', 'pickaxes'],\n ['whiskey', 'whiskies']\n ].forEach(function (rule) {\n return pluralize.addIrregularRule(rule[0], rule[1]);\n });\n\n /**\n * Pluralization rules.\n */\n [\n [/s?$/i, 's'],\n [/[^\\u0000-\\u007F]$/i, '$0'],\n [/([^aeiou]ese)$/i, '$1'],\n [/(ax|test)is$/i, '$1es'],\n [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],\n [/(e[mn]u)s?$/i, '$1s'],\n [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],\n [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],\n [/(seraph|cherub)(?:im)?$/i, '$1im'],\n [/(her|at|gr)o$/i, '$1oes'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],\n [/sis$/i, 'ses'],\n [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],\n [/([^aeiouy]|qu)y$/i, '$1ies'],\n [/([^ch][ieo][ln])ey$/i, '$1ies'],\n [/(x|ch|ss|sh|zz)$/i, '$1es'],\n [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],\n [/(m|l)(?:ice|ouse)$/i, '$1ice'],\n [/(pe)(?:rson|ople)$/i, '$1ople'],\n [/(child)(?:ren)?$/i, '$1ren'],\n [/eaux$/i, '$0'],\n [/m[ae]n$/i, 'men'],\n ['thou', 'you']\n ].forEach(function (rule) {\n return pluralize.addPluralRule(rule[0], rule[1]);\n });\n\n /**\n * Singularization rules.\n */\n [\n [/s$/i, ''],\n [/(ss)$/i, '$1'],\n [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\\w]|^)li)ves$/i, '$1fe'],\n [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],\n [/ies$/i, 'y'],\n [/\\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],\n [/\\b(mon|smil)ies$/i, '$1ey'],\n [/(m|l)ice$/i, '$1ouse'],\n [/(seraph|cherub)im$/i, '$1'],\n [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'],\n [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, '$1sis'],\n [/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],\n [/(test)(?:is|es)$/i, '$1is'],\n [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],\n [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],\n [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],\n [/(alumn|alg|vertebr)ae$/i, '$1a'],\n [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],\n [/(matr|append)ices$/i, '$1ix'],\n [/(pe)(rson|ople)$/i, '$1rson'],\n [/(child)ren$/i, '$1'],\n [/(eau)x?$/i, '$1'],\n [/men$/i, 'man']\n ].forEach(function (rule) {\n return pluralize.addSingularRule(rule[0], rule[1]);\n });\n\n /**\n * Uncountable rules.\n */\n [\n // Singular words with no plurals.\n 'adulthood',\n 'advice',\n 'agenda',\n 'aid',\n 'alcohol',\n 'ammo',\n 'anime',\n 'athletics',\n 'audio',\n 'bison',\n 'blood',\n 'bream',\n 'buffalo',\n 'butter',\n 'carp',\n 'cash',\n 'chassis',\n 'chess',\n 'clothing',\n 'cod',\n 'commerce',\n 'cooperation',\n 'corps',\n 'debris',\n 'diabetes',\n 'digestion',\n 'elk',\n 'energy',\n 'equipment',\n 'excretion',\n 'expertise',\n 'flounder',\n 'fun',\n 'gallows',\n 'garbage',\n 'graffiti',\n 'headquarters',\n 'health',\n 'herpes',\n 'highjinks',\n 'homework',\n 'housework',\n 'information',\n 'jeans',\n 'justice',\n 'kudos',\n 'labour',\n 'literature',\n 'machinery',\n 'mackerel',\n 'mail',\n 'media',\n 'mews',\n 'moose',\n 'music',\n 'manga',\n 'news',\n 'pike',\n 'plankton',\n 'pliers',\n 'pollution',\n 'premises',\n 'rain',\n 'research',\n 'rice',\n 'salmon',\n 'scissors',\n 'series',\n 'sewage',\n 'shambles',\n 'shrimp',\n 'species',\n 'staff',\n 'swine',\n 'tennis',\n 'traffic',\n 'transporation',\n 'trout',\n 'tuna',\n 'wealth',\n 'welfare',\n 'whiting',\n 'wildebeest',\n 'wildlife',\n 'you',\n // Regexes.\n /[^aeiou]ese$/i, // \"chinese\", \"japanese\"\n /deer$/i, // \"deer\", \"reindeer\"\n /fish$/i, // \"fish\", \"blowfish\", \"angelfish\"\n /measles$/i,\n /o[iu]s$/i, // \"carnivorous\"\n /pox$/i, // \"chickpox\", \"smallpox\"\n /sheep$/i\n ].forEach(pluralize.addUncountableRule);\n\n return pluralize;\n});\n","import { parse } from \"graphql/language/parser\";\nimport { print } from \"graphql/language/printer\";\nimport { DocumentNode } from \"graphql/language/ast\";\n\n// @ts-ignore\nimport lodashIsEqual from \"lodash.isequal\";\n\n// @ts-ignore\nimport lodashClone from \"lodash.clone\";\n\n// @ts-ignore\nimport pluralizeLib from \"pluralize\";\nexport const pluralize = pluralizeLib.plural;\nexport const singularize = pluralizeLib.singular;\n\n/**\n * Capitalizes the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function upcaseFirstLetter(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n\n/**\n * Down cases the first letter of the given string.\n *\n * @param {string} input\n * @returns {string}\n */\nexport function downcaseFirstLetter(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n\n/**\n * Takes a string with a graphql query and formats it. Useful for debug output and the tests.\n * @param {string} query\n * @returns {string}\n */\nexport function prettify(query: string | DocumentNode): string {\n return print(parseQuery(query));\n}\n\n/**\n * Returns a parsed query as GraphQL AST DocumentNode.\n *\n * @param {string | DocumentNode} query - Query as string or GraphQL AST DocumentNode.\n *\n * @returns {DocumentNode} Query as GraphQL AST DocumentNode.\n */\nexport function parseQuery(query: string | DocumentNode): DocumentNode {\n return typeof query === \"string\" ? parse(query) : query;\n}\n\n/**\n * @param {DocumentNode} query - The GraphQL AST DocumentNode.\n *\n * @returns {string} the GraphQL query within a DocumentNode as a plain string.\n */\nexport function graphQlDocumentToString(query: DocumentNode): string {\n return query.loc!.source.body;\n}\n\n/**\n * Tells if a object is just a simple object.\n *\n * @param {any} obj - Value to check.\n */\nexport function isPlainObject(obj: any): boolean {\n // Basic check for Type object that's not null\n return obj !== null && !(obj instanceof Array) && typeof obj === \"object\";\n}\n\n/**\n * Creates an object composed of the picked `object` properties.\n * @param {object} object - Object.\n * @param {array} props - Properties to pick.\n */\nexport function pick(object: any, props: Array) {\n if (!object) {\n return {};\n }\n\n let index = -1;\n const length = props.length;\n const result = {};\n\n while (++index < length) {\n const prop = props[index];\n result[prop] = object[prop];\n }\n\n return result;\n}\n\nexport function isEqual(a: object, b: object): boolean {\n // Couldn' find a simpler working implementation yet.\n return lodashIsEqual(a, b);\n}\n\nexport function clone(input: any): any {\n // Couldn' find a simpler working implementation yet.\n return lodashClone(input);\n}\n\nexport function takeWhile(\n array: Array,\n predicate: (x: any, idx: number, array: Array) => any\n) {\n let index = -1;\n\n while (++index < array.length && predicate(array[index], index, array)) {\n // just increase index\n }\n\n return array.slice(0, index);\n}\n\nexport function matches(source: any) {\n source = clone(source);\n\n return (object: any) => isEqual(object, source);\n}\n\nexport function removeSymbols(input: any) {\n return JSON.parse(JSON.stringify(input));\n}\n","import { DocumentNode } from \"graphql/language/ast\";\nimport { Arguments } from \"../support/interfaces\";\nimport { FetchPolicy } from \"apollo-client\";\nimport { isPlainObject, prettify } from \"../support/utils\";\n\n/**\n * Vuex-ORM-Apollo Debug Logger.\n * Wraps console and only logs if enabled.\n *\n * Also contains some methods to format graphql queries for the output\n */\nexport default class Logger {\n /**\n * Tells if any logging should happen\n * @type {boolean}\n */\n private readonly enabled: boolean;\n\n /**\n * Fancy Vuex-ORM-Apollo prefix for all log messages.\n * @type {string[]}\n */\n private readonly PREFIX = [\n \"%c Vuex-ORM: GraphQL Plugin %c\",\n \"background: #35495e; padding: 1px 0; border-radius: 3px; color: #eee;\",\n \"background: transparent;\"\n ];\n\n /**\n * @constructor\n * @param {boolean} enabled Tells if any logging should happen\n */\n public constructor(enabled: boolean) {\n this.enabled = enabled;\n this.log(\"Logging is enabled.\");\n }\n\n /**\n * Wraps console.group. In TEST env console.log is used instead because console.group doesn't work on CLI.\n * If available console.groupCollapsed will be used instead.\n * @param {Array} messages\n */\n public group(...messages: Array): void {\n if (this.enabled) {\n if (console.groupCollapsed) {\n console.groupCollapsed(...this.PREFIX, ...messages);\n } else {\n console.log(...this.PREFIX, ...messages);\n }\n }\n }\n\n /**\n * Wrapper for console.groupEnd. In TEST env nothing happens because console.groupEnd doesn't work on CLI.\n */\n public groupEnd(): void {\n if (this.enabled && console.groupEnd) console.groupEnd();\n }\n\n /**\n * Wrapper for console.log.\n * @param {Array} messages\n */\n public log(...messages: Array): void {\n if (this.enabled) {\n console.log(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Wrapper for console.warn.\n * @param {Array} messages\n */\n public warn(...messages: Array): void {\n if (this.enabled) {\n console.warn(...this.PREFIX, ...messages);\n }\n }\n\n /**\n * Logs a graphql query in a readable format and with all information like fetch policy and variables.\n * @param {string | DocumentNode} query\n * @param {Arguments} variables\n * @param {FetchPolicy} fetchPolicy\n */\n public logQuery(query: string | DocumentNode, variables?: Arguments, fetchPolicy?: FetchPolicy) {\n if (this.enabled) {\n try {\n let prettified = \"\";\n if (isPlainObject(query) && (query as DocumentNode).loc) {\n prettified = prettify((query as DocumentNode).loc!.source.body);\n } else {\n prettified = prettify(query as string);\n }\n\n this.group(\n \"Sending query:\",\n prettified\n .split(\"\\n\")[1]\n .replace(\"{\", \"\")\n .trim()\n );\n console.log(prettified);\n\n if (variables) console.log(\"VARIABLES:\", variables);\n if (fetchPolicy) console.log(\"FETCH POLICY:\", fetchPolicy);\n\n this.groupEnd();\n } catch (e) {\n console.error(\"[Vuex-ORM-Apollo] There is a syntax error in the query!\", e, query);\n }\n }\n }\n}\n","import { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport { Field, PatchedModel } from \"../support/interfaces\";\nimport Context from \"../common/context\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport { pluralize, singularize, pick, isEqual } from \"../support/utils\";\n\n/**\n * Wrapper around a Vuex-ORM model with some useful methods.\n *\n * Also provides a mock system, to define mocking responses for actions.\n */\nexport default class Model {\n /**\n * The singular name of a model like `blogPost`\n * @type {string}\n */\n public readonly singularName: string;\n\n /**\n * The plural name of a model like `blogPosts`\n * @type {string}\n */\n public readonly pluralName: string;\n\n /**\n * The original Vuex-ORM model\n */\n public readonly baseModel: typeof PatchedModel;\n\n /**\n * The fields of the model\n * @type {Map}\n */\n public readonly fields: Map = new Map();\n\n /**\n * Container for the mocks.\n * @type {Object}\n */\n private mocks: { [key: string]: Array } = {};\n\n /**\n * @constructor\n * @param {Model} baseModel The original Vuex-ORM model\n */\n public constructor(baseModel: typeof ORMModel) {\n this.baseModel = baseModel as typeof PatchedModel;\n\n // Generate name variants\n this.singularName = singularize(this.baseModel.entity);\n this.pluralName = pluralize(this.baseModel.entity);\n\n // Cache the fields of the model in this.fields\n const fields = this.baseModel.fields();\n Object.keys(fields).forEach((name: string) => {\n this.fields.set(name, fields[name] as Field);\n });\n }\n\n /**\n * Tells if a field is a numeric field.\n *\n * @param {Field | undefined} field\n * @returns {boolean}\n */\n public static isFieldNumber(field: Field | undefined): boolean {\n if (!field) return false;\n\n const context = Context.getInstance();\n return (\n field instanceof context.components.Number || field instanceof context.components.Increment\n );\n }\n\n /**\n * Tells if a field is a attribute (and thus not a relation)\n * @param {Field} field\n * @returns {boolean}\n */\n public static isFieldAttribute(field: Field): boolean {\n const context = Context.getInstance();\n\n return (\n field instanceof context.components.Increment ||\n field instanceof context.components.Attr ||\n field instanceof context.components.String ||\n field instanceof context.components.Number ||\n field instanceof context.components.Boolean\n );\n }\n\n /**\n * Tells if a field which represents a relation is a connection (multiple).\n * @param {Field} field\n * @returns {boolean}\n */\n public static isConnection(field: Field): boolean {\n const context = Context.getInstance();\n\n return !(\n field instanceof context.components.BelongsTo ||\n field instanceof context.components.HasOne ||\n field instanceof context.components.MorphTo ||\n field instanceof context.components.MorphOne\n );\n }\n\n /**\n * Adds $isPersisted and other meta fields to the model by overwriting the fields() method.\n * @todo is this a good way to add fields?\n * @param {Model} model\n */\n public static augment(model: Model) {\n const originalFieldGenerator = model.baseModel.fields.bind(model.baseModel);\n\n model.baseModel.fields = () => {\n const originalFields = originalFieldGenerator();\n\n originalFields[\"$isPersisted\"] = model.baseModel.boolean(false);\n\n return originalFields;\n };\n }\n\n /**\n * Returns the related model for a relation.\n * @param {Field|undefined} relation Relation field.\n * @returns {Model|null}\n */\n public static getRelatedModel(relation?: Relation) {\n if (relation === undefined) return null;\n\n const context: Context = Context.getInstance();\n\n if (\n relation instanceof context.components.BelongsToMany ||\n relation instanceof context.components.HasMany ||\n relation instanceof context.components.HasManyThrough ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphToMany ||\n relation instanceof context.components.HasOne\n ) {\n return context.getModel(relation.related.entity, true);\n } else if (\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasManyBy\n ) {\n return context.getModel(relation.parent.entity, true);\n } else if (relation instanceof context.components.MorphTo) {\n return context.getModel(relation.type, true);\n } else {\n console.warn(\"Failed relation\", typeof relation, relation);\n throw new Error(`Can't find related model for relation of type ${typeof relation}!`);\n }\n }\n\n /**\n * Returns all fields which should be included in a graphql query: All attributes which are not included in the\n * skipFields array or start with $.\n * @returns {Array} field names which should be queried\n */\n public getQueryFields(): Array {\n const fields: Array = [];\n\n this.fields.forEach((field: Field, name: string) => {\n if (Model.isFieldAttribute(field) && !this.skipField(name)) {\n fields.push(name);\n }\n });\n\n return fields;\n }\n\n /**\n * Tells if a field should be ignored. This is true for fields that start with a `$` or is it is within the skipField\n * property or is the foreignKey of a belongsTo/hasOne relation.\n *\n * @param {string} field\n * @returns {boolean}\n */\n public skipField(field: string) {\n if (field.startsWith(\"$\")) return true;\n if (this.baseModel.skipFields && this.baseModel.skipFields.indexOf(field) >= 0) return true;\n\n const context = Context.getInstance();\n\n let shouldSkipField: boolean = false;\n\n this.getRelations().forEach((relation: Relation) => {\n if (\n (relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.HasOne) &&\n relation.foreignKey === field\n ) {\n shouldSkipField = true;\n return false;\n }\n return true;\n });\n\n return shouldSkipField;\n }\n\n /**\n * @returns {Map} all relations of the model.\n */\n public getRelations(): Map {\n const relations = new Map();\n\n this.fields.forEach((field: Field, name: string) => {\n if (!Model.isFieldAttribute(field)) {\n relations.set(name, field as Relation);\n }\n });\n\n return relations;\n }\n\n /**\n * This accepts a field like `subjectType` and checks if this is just randomly named `...Type` or it is part\n * of a polymorphic relation.\n * @param {string} name\n * @returns {boolean}\n */\n public isTypeFieldOfPolymorphicRelation(name: string): boolean {\n const context = Context.getInstance();\n let found: boolean = false;\n\n context.models.forEach(model => {\n if (found) return false;\n\n model.getRelations().forEach(relation => {\n if (\n relation instanceof context.components.MorphMany ||\n relation instanceof context.components.MorphedByMany ||\n relation instanceof context.components.MorphOne ||\n relation instanceof context.components.MorphTo ||\n relation instanceof context.components.MorphToMany\n ) {\n const related = (relation as Field).related;\n\n if (relation.type === name && related && related.entity === this.baseModel.entity) {\n found = true;\n return false; // break\n }\n }\n\n return true;\n });\n\n return true;\n });\n\n return found;\n }\n\n /**\n * Returns a record of this model with the given ID.\n * @param {number} id\n * @returns {any}\n */\n public getRecordWithId(id: number) {\n return this.baseModel\n .query()\n .withAllRecursive()\n .where(\"id\", id)\n .first();\n }\n\n /**\n * Determines if we should eager load (means: add as a field in the graphql query) a related entity. belongsTo,\n * hasOne and morphOne related entities are always eager loaded. Others can be added to the `eagerLoad` array\n * or `eagerSync` of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerLoadRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // HasOne, BelongsTo and MorphOne are always eager loaded\n if (\n relation instanceof context.components.HasOne ||\n relation instanceof context.components.BelongsTo ||\n relation instanceof context.components.MorphOne\n ) {\n return true;\n }\n\n // Create a list of all relations that have to be eager loaded\n const eagerLoadList: Array = this.baseModel.eagerLoad || [];\n Array.prototype.push.apply(eagerLoadList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerLoadList.\n return (\n eagerLoadList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Determines if we should eager save (means: add as a field in the graphql mutation) a related entity. belongsTo\n * related entities are always eager saved. Others can be added to the `eagerSave` or `eagerSync` array of the model.\n *\n * @param {string} fieldName Name of the field\n * @param {Relation} relation Relation field\n * @param {Model} relatedModel Related model\n * @returns {boolean}\n */\n public shouldEagerSaveRelation(\n fieldName: string,\n relation: Relation,\n relatedModel: Model\n ): boolean {\n const context = Context.getInstance();\n\n // BelongsTo is always eager saved\n if (relation instanceof context.components.BelongsTo) {\n return true;\n }\n\n // Create a list of all relations that have to be eager saved\n const eagerSaveList: Array = this.baseModel.eagerSave || [];\n Array.prototype.push.apply(eagerSaveList, this.baseModel.eagerSync || []);\n\n // Check if the name of the related model or the fieldName is included in the eagerSaveList.\n return (\n eagerSaveList.find(n => {\n return n === relatedModel.singularName || n === relatedModel.pluralName || n === fieldName;\n }) !== undefined\n );\n }\n\n /**\n * Adds a mock.\n *\n * @param {Mock} mock - Mock config.\n * @returns {boolean}\n */\n public $addMock(mock: Mock): boolean {\n if (this.$findMock(mock.action, mock.options)) return false;\n if (!this.mocks[mock.action]) this.mocks[mock.action] = [];\n\n this.mocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions like { variables: { id: 42 } }.\n * @returns {Mock | null} null when no mock was found.\n */\n public $findMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.mocks[action]) {\n return (\n this.mocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by all actions in order to get the mock returnValue.\n *\n * @param {string} action - Name of the action like 'fetch'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public $mockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.$findMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n if (returnValue) {\n if (returnValue instanceof Array) {\n returnValue.forEach(r => (r.$isPersisted = true));\n } else {\n returnValue.$isPersisted = true;\n }\n\n return { [this.pluralName]: returnValue };\n }\n\n return null;\n }\n}\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","// Provides the methods that allow QueryManager to handle\r\n// the `skip` and `include` directives within GraphQL.\r\nimport {\r\n FieldNode,\r\n OperationDefinitionNode,\r\n SelectionNode,\r\n VariableNode,\r\n BooleanValueNode,\r\n DirectiveNode,\r\n DocumentNode,\r\n} from 'graphql';\r\n\r\nimport { argumentsObjectFromField } from './storeUtils';\r\n\r\nexport type DirectiveInfo = {\r\n [fieldName: string]: { [argName: string]: any };\r\n};\r\n\r\nexport function getDirectiveInfoFromField(\r\n field: FieldNode,\r\n variables: Object,\r\n): DirectiveInfo {\r\n if (field.directives && field.directives.length) {\r\n const directiveObj: DirectiveInfo = {};\r\n field.directives.forEach((directive: DirectiveNode) => {\r\n directiveObj[directive.name.value] = argumentsObjectFromField(\r\n directive,\r\n variables,\r\n );\r\n });\r\n return directiveObj;\r\n }\r\n return null;\r\n}\r\n\r\nexport function shouldInclude(\r\n selection: SelectionNode,\r\n variables: { [name: string]: any } = {},\r\n): boolean {\r\n if (!selection.directives) {\r\n return true;\r\n }\r\n\r\n let res: boolean = true;\r\n selection.directives.forEach(directive => {\r\n // TODO should move this validation to GraphQL validation once that's implemented.\r\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\r\n // Just don't worry about directives we don't understand\r\n return;\r\n }\r\n\r\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\r\n const directiveArguments = directive.arguments || [];\r\n const directiveName = directive.name.value;\r\n if (directiveArguments.length !== 1) {\r\n throw new Error(\r\n `Incorrect number of arguments for the @${directiveName} directive.`,\r\n );\r\n }\r\n\r\n const ifArgument = directiveArguments[0];\r\n if (!ifArgument.name || ifArgument.name.value !== 'if') {\r\n throw new Error(`Invalid argument for the @${directiveName} directive.`);\r\n }\r\n\r\n const ifValue = directiveArguments[0].value;\r\n let evaledValue: boolean = false;\r\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\r\n // means it has to be a variable value if this is a valid @skip or @include directive\r\n if (ifValue.kind !== 'Variable') {\r\n throw new Error(\r\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\r\n );\r\n } else {\r\n evaledValue = variables[(ifValue as VariableNode).name.value];\r\n if (evaledValue === undefined) {\r\n throw new Error(\r\n `Invalid variable referenced in @${directiveName} directive.`,\r\n );\r\n }\r\n }\r\n } else {\r\n evaledValue = (ifValue as BooleanValueNode).value;\r\n }\r\n\r\n if (directiveName === 'skip') {\r\n evaledValue = !evaledValue;\r\n }\r\n\r\n if (!evaledValue) {\r\n res = false;\r\n }\r\n });\r\n\r\n return res;\r\n}\r\n\r\nexport function flattenSelections(selection: SelectionNode): SelectionNode[] {\r\n if (\r\n !(selection as FieldNode).selectionSet ||\r\n !((selection as FieldNode).selectionSet.selections.length > 0)\r\n )\r\n return [selection];\r\n\r\n return [selection].concat(\r\n (selection as FieldNode).selectionSet.selections\r\n .map(selectionNode =>\r\n [selectionNode].concat(flattenSelections(selectionNode)),\r\n )\r\n .reduce((selections, selected) => selections.concat(selected), []),\r\n );\r\n}\r\n\r\nexport function getDirectiveNames(doc: DocumentNode) {\r\n // operation => [names of directives];\r\n const directiveNames = doc.definitions\r\n .filter(\r\n (definition: OperationDefinitionNode) =>\r\n definition.selectionSet && definition.selectionSet.selections,\r\n )\r\n // operation => [[Selection]]\r\n .map(x => flattenSelections(x as any))\r\n // [[Selection]] => [Selection]\r\n .reduce((selections, selected) => selections.concat(selected), [])\r\n // [Selection] => [Selection with Directives]\r\n .filter(\r\n (selection: SelectionNode) =>\r\n selection.directives && selection.directives.length > 0,\r\n )\r\n // [Selection with Directives] => [[Directives]]\r\n .map((selection: SelectionNode) => selection.directives)\r\n // [[Directives]] => [Directives]\r\n .reduce((directives, directive) => directives.concat(directive), [])\r\n // [Directives] => [Name]\r\n .map((directive: DirectiveNode) => directive.name.value);\r\n return directiveNames;\r\n}\r\n\r\nexport function hasDirectives(names: string[], doc: DocumentNode) {\r\n return getDirectiveNames(doc).some(\r\n (name: string) => names.indexOf(name) > -1,\r\n );\r\n}\r\n","/**\r\n * Adds the properties of one or more source objects to a target object. Works exactly like\r\n * `Object.assign`, but as a utility to maintain support for IE 11.\r\n *\r\n * @see https://github.com/apollostack/apollo-client/pull/1009\r\n */\r\nexport function assign(a: A, b: B): A & B;\r\nexport function assign(a: A, b: B, c: C): A & B & C;\r\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\r\nexport function assign(\r\n a: A,\r\n b: B,\r\n c: C,\r\n d: D,\r\n e: E,\r\n): A & B & C & D & E;\r\nexport function assign(target: any, ...sources: Array): any;\r\nexport function assign(\r\n target: { [key: string]: any },\r\n ...sources: Array<{ [key: string]: any }>\r\n): { [key: string]: any } {\r\n sources.forEach(source => {\r\n if (typeof source === 'undefined' || source === null) {\r\n return;\r\n }\r\n Object.keys(source).forEach(key => {\r\n target[key] = source[key];\r\n });\r\n });\r\n return target;\r\n}\r\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new Error(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new Error(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n DefinitionNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { cloneDeep } from './util/cloneDeep';\n\nimport {\n checkDocument,\n getOperationDefinitionOrDie,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n} from './getFromAST';\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isNotEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): Boolean {\n // keep selections that are still valid\n return (\n op.selectionSet.selections.filter(\n selectionSet =>\n // anything that doesn't match the compound filter is okay\n !// not an empty array\n (\n selectionSet &&\n // look into fragments to verify they should stay\n selectionSet.kind === 'FragmentSpread' &&\n // see if the fragment in the map is valid (recursively)\n !isNotEmpty(fragments[selectionSet.name.value], fragments)\n ),\n ).length > 0\n );\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode): Boolean {\n return directives.some(\n (dir: RemoveDirectiveConfig | GetDirectiveConfig) => {\n if (dir.name && dir.name === directive.name.value) return true;\n if (dir.test && dir.test(directive)) return true;\n return false;\n },\n );\n };\n}\n\nfunction addTypenameToSelectionSet(\n selectionSet: SelectionSetNode,\n isRoot = false,\n) {\n if (selectionSet.selections) {\n if (!isRoot) {\n const alreadyHasThisField = selectionSet.selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n });\n\n if (!alreadyHasThisField) {\n selectionSet.selections.push(TYPENAME_FIELD);\n }\n }\n\n selectionSet.selections.forEach(selection => {\n // Must not add __typename if we're inside an introspection query\n if (selection.kind === 'Field') {\n if (\n selection.name.value.lastIndexOf('__', 0) !== 0 &&\n selection.selectionSet\n ) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n } else if (selection.kind === 'InlineFragment') {\n if (selection.selectionSet) {\n addTypenameToSelectionSet(selection.selectionSet);\n }\n }\n });\n }\n}\n\nexport type RemoveDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n remove?: boolean;\n};\n\nfunction removeDirectivesFromSelectionSet(\n directives: RemoveDirectiveConfig[],\n selectionSet: SelectionSetNode,\n): SelectionSetNode {\n if (!selectionSet.selections) return selectionSet;\n // if any of the directives are set to remove this selectionSet, remove it\n const agressiveRemove = directives.some(\n (dir: RemoveDirectiveConfig) => dir.remove,\n );\n\n selectionSet.selections = selectionSet.selections\n .map(selection => {\n if (\n selection.kind !== 'Field' ||\n !(selection as FieldNode) ||\n !selection.directives\n )\n return selection;\n const directiveMatcher = getDirectiveMatcher(directives);\n let remove: boolean;\n selection.directives = selection.directives.filter(directive => {\n const shouldKeep = !directiveMatcher(directive);\n\n if (!remove && !shouldKeep && agressiveRemove) remove = true;\n\n return shouldKeep;\n });\n\n return remove ? null : selection;\n })\n .filter(x => !!x);\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n removeDirectivesFromSelectionSet(directives, selection.selectionSet);\n }\n });\n\n return selectionSet;\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n removeDirectivesFromSelectionSet(\n directives,\n (definition as OperationDefinitionNode).selectionSet,\n );\n });\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode) {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n\n docClone.definitions.forEach((definition: DefinitionNode) => {\n const isRoot = definition.kind === 'OperationDefinition';\n addTypenameToSelectionSet(\n (definition as OperationDefinitionNode).selectionSet,\n isRoot,\n );\n });\n return docClone;\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n checkDocument(doc);\n return removeDirectivesFromDocument([connectionRemoveConfig], doc);\n}\n\nexport type GetDirectiveConfig = {\n name?: string;\n test?: (directive: DirectiveNode) => boolean;\n};\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n if (!(selectionSet && selectionSet.selections)) {\n return false;\n }\n const matchedSelections = selectionSet.selections.filter(selection => {\n return hasDirectivesInSelection(directives, selection, nestedCheck);\n });\n return matchedSelections.length > 0;\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n const directiveMatcher = getDirectiveMatcher(directives);\n const matchedDirectives = selection.directives.filter(directiveMatcher);\n return (\n matchedDirectives.length > 0 ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nfunction getDirectivesFromSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n) {\n selectionSet.selections = selectionSet.selections\n .filter(selection => {\n return hasDirectivesInSelection(directives, selection, true);\n })\n .map(selection => {\n if (hasDirectivesInSelection(directives, selection, false)) {\n return selection;\n }\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n selection.selectionSet = getDirectivesFromSelectionSet(\n directives,\n selection.selectionSet,\n );\n }\n return selection;\n });\n return selectionSet;\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n includeAllFragments = false,\n): DocumentNode | null {\n checkDocument(doc);\n const docClone = cloneDeep(doc);\n docClone.definitions = docClone.definitions.map(definition => {\n if (\n (definition.kind === 'OperationDefinition' ||\n (definition.kind === 'FragmentDefinition' && !includeAllFragments)) &&\n definition.selectionSet\n ) {\n definition.selectionSet = getDirectivesFromSelectionSet(\n directives,\n definition.selectionSet,\n );\n }\n return definition;\n });\n\n const operation = getOperationDefinitionOrDie(docClone);\n const fragments = createFragmentMap(getFragmentDefinitions(docClone));\n return isNotEmpty(operation, fragments) ? docClone : null;\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/networkStatus.ts"},"export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// === Symbol Support ===\n\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species');\n\n// === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n\n if (value == null) return undefined;\n\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n if (ctor === null) {\n ctor = undefined;\n }\n }\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n if (!queue) {\n return;\n }\n subscription._queue = undefined;\n subscription._state = 'ready';\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({ type: type, value: value });\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{ type: type, value: value }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = function () {\n function Subscription(observer, subscriber) {\n _classCallCheck(this, Subscription);\n\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n _createClass(Subscription, [{\n key: 'unsubscribe',\n value: function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n }, {\n key: 'closed',\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = function () {\n function SubscriptionObserver(subscription) {\n _classCallCheck(this, SubscriptionObserver);\n\n this._subscription = subscription;\n }\n\n _createClass(SubscriptionObserver, [{\n key: 'next',\n value: function next(value) {\n onNotify(this._subscription, 'next', value);\n }\n }, {\n key: 'error',\n value: function error(value) {\n onNotify(this._subscription, 'error', value);\n }\n }, {\n key: 'complete',\n value: function complete() {\n onNotify(this._subscription, 'complete');\n }\n }, {\n key: 'closed',\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = exports.Observable = function () {\n function Observable(subscriber) {\n _classCallCheck(this, Observable);\n\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n\n this._subscriber = subscriber;\n }\n\n _createClass(Observable, [{\n key: 'subscribe',\n value: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n return new Subscription(observer, this._subscriber);\n }\n }, {\n key: 'forEach',\n value: function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n\n error: reject,\n complete: resolve\n });\n });\n }\n }, {\n key: 'map',\n value: function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'filter',\n value: function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'reduce',\n value: function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n\n observer.next(acc);\n observer.complete();\n }\n });\n });\n }\n }, {\n key: 'concat',\n value: function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscription = void 0;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n }, {\n key: 'flatMap',\n value: function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n\n var C = getSpecies(this);\n\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n }\n }, {\n key: SymbolObservable,\n value: function () {\n return this;\n }\n }], [{\n key: 'from',\n value: function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n\n if (x == null) throw new TypeError(x + ' is not an object');\n\n var method = getMethod(x, SymbolObservable);\n if (method) {\n var observable = method.call(x);\n\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n\n if (isObservable(observable) && observable.constructor === C) return observable;\n\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n\n observer.next(item);\n if (observer.closed) return;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n }\n }, {\n key: 'of',\n value: function of() {\n for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n observer.complete();\n });\n });\n }\n }, {\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n","module.exports = require('./lib/Observable.js').Observable;\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n if (!mutationDef) {\n throw new Error('Must contain a mutation definition.');\n }\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new Error(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n if (operations.length > 1) {\n throw new Error(\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n }\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n if (!def) {\n throw new Error(`GraphQL document is missing an operation`);\n }\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n if (!queryDef || queryDef.operation !== 'query') {\n throw new Error('Must contain a query definition.');\n }\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n if (doc.kind !== 'Document') {\n throw new Error(`Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`);\n }\n\n if (doc.definitions.length > 1) {\n throw new Error('Fragment must have exactly one definition.');\n }\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n if (fragmentDef.kind !== 'FragmentDefinition') {\n throw new Error('Must be a fragment definition.');\n }\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new Error(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/util/Observable.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/errors/ApolloError.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/types.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/ObservableQuery.ts"},"import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n Observable,\n} from 'apollo-link';\n\n/*\n * Expects context to contain the forceFetch field if no dedup\n */\nexport class DedupLink extends ApolloLink {\n private inFlightRequestObservables: Map<\n string,\n Observable\n > = new Map();\n private subscribers: Map = new Map();\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable {\n // sometimes we might not want to deduplicate a request, for example when we want to force fetch it.\n if (operation.getContext().forceFetch) {\n return forward(operation);\n }\n\n const key = operation.toKey();\n\n const cleanup = operationKey => {\n this.inFlightRequestObservables.delete(operationKey);\n const prev = this.subscribers.get(operationKey);\n return prev;\n };\n\n if (!this.inFlightRequestObservables.get(key)) {\n // this is a new request, i.e. we haven't deduplicated it yet\n // call the next link\n const singleObserver = forward(operation);\n let subscription;\n\n const sharedObserver = new Observable(observer => {\n // this will still be called by each subscriber regardless of\n // deduplication status\n let prev = this.subscribers.get(key);\n if (!prev) prev = { next: [], error: [], complete: [] };\n\n this.subscribers.set(key, {\n next: prev.next.concat([observer.next.bind(observer)]),\n error: prev.error.concat([observer.error.bind(observer)]),\n complete: prev.complete.concat([observer.complete.bind(observer)]),\n });\n\n if (!subscription) {\n subscription = singleObserver.subscribe({\n next: result => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) {\n previous.next.forEach(next => next(result));\n previous.complete.forEach(complete => complete());\n }\n },\n error: error => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) previous.error.forEach(err => err(error));\n },\n });\n }\n\n return () => {\n if (subscription) subscription.unsubscribe();\n this.inFlightRequestObservables.delete(key);\n };\n });\n\n this.inFlightRequestObservables.set(key, sharedObserver);\n }\n\n // return shared Observable\n return this.inFlightRequestObservables.get(key);\n }\n}\n",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/scheduler/scheduler.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/mutations.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/queries.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/core/QueryManager.ts"},{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/data/store.ts"},"exports.version = \"2.4.6\"",{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/benjamin.klein/workspaces/benny/vuex-orm-graphql/node_modules/src/ApolloClient.ts"},"import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\n(function (invariant) {\r\n function warn() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.warn.apply(console, args);\r\n }\r\n invariant.warn = warn;\r\n function error() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return console.error.apply(console, args);\r\n }\r\n invariant.error = error;\r\n})(invariant || (invariant = {}));\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant };\n","import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n if (!selection.directives) {\n return true;\n }\n\n let res: boolean = true;\n selection.directives.forEach(directive => {\n // TODO should move this validation to GraphQL validation once that's implemented.\n if (directive.name.value !== 'skip' && directive.name.value !== 'include') {\n // Just don't worry about directives we don't understand\n return;\n }\n\n //evaluate the \"if\" argument and skip (i.e. return undefined) if it evaluates to true.\n const directiveArguments = directive.arguments || [];\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue = directiveArguments[0].value;\n let evaledValue: boolean = false;\n if (!ifValue || ifValue.kind !== 'BooleanValue') {\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue.kind === 'Variable',\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n evaledValue = variables[(ifValue as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directiveName} directive.`,\n );\n } else {\n evaledValue = (ifValue as BooleanValueNode).value;\n }\n\n if (directiveName === 'skip') {\n evaledValue = !evaledValue;\n }\n\n if (!evaledValue) {\n res = false;\n }\n });\n\n return res;\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more then one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n selection.kind === 'Field' &&\n ((selection as FieldNode).name.value === '__typename' ||\n (selection as FieldNode).name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n console.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (selection.kind !== 'Field' || !(selection as FieldNode)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (selection.kind === 'Field' || selection.kind === 'InlineFragment') &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection => {\n return (\n selection.kind === 'Field' &&\n (selection as FieldNode).name.value === '__typename'\n );\n },\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","/**\n * Performs a deep equality check on two JavaScript values.\n */\nexport function isEqual(a: any, b: any): boolean {\n // If the two values are strictly equal, we are good.\n if (a === b) {\n return true;\n }\n // Dates are equivalent if their time values are equal.\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n // If a and b are both objects, we will compare their properties. This will compare arrays as\n // well.\n if (\n a != null &&\n typeof a === 'object' &&\n b != null &&\n typeof b === 'object'\n ) {\n // Compare all of the keys in `a`. If one of the keys has a different value, or that key does\n // not exist in `b` return false immediately.\n for (const key in a) {\n if (Object.prototype.hasOwnProperty.call(a, key)) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) {\n return false;\n }\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n // Look through all the keys in `b`. If `b` has a key that `a` does not, return false.\n for (const key in b) {\n if (\n Object.prototype.hasOwnProperty.call(b, key) &&\n !Object.prototype.hasOwnProperty.call(a, key)\n ) {\n return false;\n }\n }\n // If we made it this far the objects are equal!\n return true;\n }\n // Otherwise the values are not equal.\n return false;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","\"use strict\";\n\nfunction Cache(options) {\n this.map = new Map;\n this.newest = null;\n this.oldest = null;\n this.max = options && options.max;\n this.dispose = options && options.dispose;\n}\n\nexports.Cache = Cache;\n\nvar Cp = Cache.prototype;\n\nCp.has = function (key) {\n return this.map.has(key);\n};\n\nCp.get = function (key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n};\n\nfunction getEntry(cache, key) {\n var entry = cache.map.get(key);\n if (entry &&\n entry !== cache.newest) {\n var older = entry.older;\n var newer = entry.newer;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = cache.newest;\n entry.older.newer = entry;\n\n entry.newer = null;\n cache.newest = entry;\n\n if (entry === cache.oldest) {\n cache.oldest = newer;\n }\n }\n\n return entry;\n}\n\nCp.set = function (key, value) {\n var entry = getEntry(this, key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n};\n\nCp.clean = function () {\n if (typeof this.max === \"number\") {\n while (this.oldest &&\n this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n};\n\nCp.delete = function (key) {\n var entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n\n if (typeof this.dispose === \"function\") {\n this.dispose(key, entry.value);\n }\n\n return true;\n }\n\n return false;\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Although `Symbol` is widely supported these days, we can safely fall\n// back to using a non-enumerable string property without violating any\n// assumptions elsewhere in the implementation.\nvar useSymbol =\n typeof Symbol === \"function\" &&\n typeof Symbol.for === \"function\";\n\n// Used to mark `tuple.prototype` so that all objects that inherit from\n// any `tuple.prototype` object (there could be more than one) will test\n// positive according to `tuple.isTuple`.\nvar brand = useSymbol\n ? Symbol.for(\"immutable-tuple\")\n : \"@@__IMMUTABLE_TUPLE__@@\";\n\n// Used to save a reference to the globally shared `UniversalWeakMap` that\n// stores all known `tuple` objects.\nvar globalKey = useSymbol\n ? Symbol.for(\"immutable-tuple-root\")\n : \"@@__IMMUTABLE_TUPLE_ROOT__@@\";\n\n// Convenient helper for defining hidden immutable properties.\nfunction def(obj, name, value, enumerable) {\n Object.defineProperty(obj, name, {\n value: value,\n enumerable: !! enumerable,\n writable: false,\n configurable: false\n });\n return value;\n}\n\nvar freeze = Object.freeze || function (obj) {\n return obj;\n};\n\nfunction isObjRef(value) {\n switch (typeof value) {\n case \"object\":\n if (value === null) {\n return false;\n }\n case \"function\":\n return true;\n default:\n return false;\n }\n}\n\n// The `mustConvertThisToArray` value is true when the corresponding\n// `Array` method does not attempt to modify `this`, which means we can\n// pass a `tuple` object as `this` without first converting it to an\n// `Array`.\nfunction forEachArrayMethod(fn) {\n function call(name, mustConvertThisToArray) {\n var desc = Object.getOwnPropertyDescriptor(Array.prototype, name);\n fn(name, desc, !! mustConvertThisToArray);\n }\n\n call(\"every\");\n call(\"filter\");\n call(\"find\");\n call(\"findIndex\");\n call(\"forEach\");\n call(\"includes\");\n call(\"indexOf\");\n call(\"join\");\n call(\"lastIndexOf\");\n call(\"map\");\n call(\"reduce\");\n call(\"reduceRight\");\n call(\"slice\");\n call(\"some\");\n call(\"toLocaleString\");\n call(\"toString\");\n\n // The `reverse` and `sort` methods are usually destructive, but for\n // `tuple` objects they return a new `tuple` object that has been\n // appropriately reversed/sorted.\n call(\"reverse\", true);\n call(\"sort\", true);\n\n // Make `[...someTuple]` work.\n call(useSymbol && Symbol.iterator || \"@@iterator\");\n}\n\n// A map data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nvar UniversalWeakMap = function UniversalWeakMap() {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n this._weakMap = null;\n this._strongMap = null;\n this.data = null;\n};\n\n// Since `get` and `set` are the only methods used, that's all I've\n// implemented here.\n\nUniversalWeakMap.prototype.get = function get (key) {\n var map = this._getMap(key, false);\n if (map) {\n return map.get(key);\n }\n};\n\nUniversalWeakMap.prototype.set = function set (key, value) {\n this._getMap(key, true).set(key, value);\n // An actual `Map` or `WeakMap` would return `this` here, but\n // returning the `value` is more convenient for the `tuple`\n // implementation.\n return value;\n};\n\nUniversalWeakMap.prototype._getMap = function _getMap (key, canCreate) {\n if (! canCreate) {\n return isObjRef(key) ? this._weakMap : this._strongMap;\n }\n if (isObjRef(key)) {\n return this._weakMap || (this._weakMap = new WeakMap);\n }\n return this._strongMap || (this._strongMap = new Map);\n};\n\n// See [`universal-weak-map.js`](universal-weak-map.html).\n// See [`util.js`](util.html).\n// If this package is installed multiple times, there could be mutiple\n// implementations of the `tuple` function with distinct `tuple.prototype`\n// objects, but the shared pool of `tuple` objects must be the same across\n// all implementations. While it would be ideal to use the `global`\n// object, there's no reliable way to get the global object across all JS\n// environments without using the `Function` constructor, so instead we\n// use the global `Array` constructor as a shared namespace.\nvar root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);\n\nfunction lookup() {\n return lookupArray(arguments);\n}\n\nfunction lookupArray(array) {\n var node = root;\n\n // Because we are building a tree of *weak* maps, the tree will not\n // prevent objects in tuples from being garbage collected, since the\n // tree itself will be pruned over time when the corresponding `tuple`\n // objects become unreachable. In addition to internalization, this\n // property is a key advantage of the `immutable-tuple` package.\n var len = array.length;\n for (var i = 0; i < len; ++i) {\n var item = array[i];\n node = node.get(item) || node.set(item, new UniversalWeakMap);\n }\n\n // Return node.data rather than node itself to prevent tampering with\n // the UniversalWeakMap tree.\n return node.data || (node.data = Object.create(null));\n}\n\n// See [`lookup.js`](lookup.html).\n// See [`util.js`](util.html).\n// When called with any number of arguments, this function returns an\n// object that inherits from `tuple.prototype` and is guaranteed to be\n// `===` any other `tuple` object that has exactly the same items. In\n// computer science jargon, `tuple` instances are \"internalized\" or just\n// \"interned,\" which allows for constant-time equality checking, and makes\n// it possible for tuple objects to be used as `Map` or `WeakMap` keys, or\n// stored in a `Set`.\nfunction tuple() {\n var arguments$1 = arguments;\n\n var node = lookup.apply(null, arguments);\n\n if (node.tuple) {\n return node.tuple;\n }\n\n var t = Object.create(tuple.prototype);\n\n // Define immutable items with numeric indexes, and permanently fix the\n // `.length` property.\n var argc = arguments.length;\n for (var i = 0; i < argc; ++i) {\n t[i] = arguments$1[i];\n }\n\n def(t, \"length\", argc, false);\n\n // Remember this new `tuple` object so that we can return the same object\n // earlier next time.\n return freeze(node.tuple = t);\n}\n\n// Since the `immutable-tuple` package could be installed multiple times\n// in an application, there is no guarantee that the `tuple` constructor\n// or `tuple.prototype` will be unique, so `value instanceof tuple` is\n// unreliable. Instead, to test if a value is a tuple, you should use\n// `tuple.isTuple(value)`.\ndef(tuple.prototype, brand, true, false);\nfunction isTuple(that) {\n return !! (that && that[brand] === true);\n}\n\ntuple.isTuple = isTuple;\n\nfunction toArray(tuple) {\n var array = [];\n var i = tuple.length;\n while (i--) { array[i] = tuple[i]; }\n return array;\n}\n\n// Copy all generic non-destructive Array methods to `tuple.prototype`.\n// This works because (for example) `Array.prototype.slice` can be invoked\n// against any `Array`-like object.\nforEachArrayMethod(function (name, desc, mustConvertThisToArray) {\n var method = desc && desc.value;\n if (typeof method === \"function\") {\n desc.value = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = method.apply(\n mustConvertThisToArray ? toArray(this) : this,\n args\n );\n // Of course, `tuple.prototype.slice` should return a `tuple` object,\n // not a new `Array`.\n return Array.isArray(result) ? tuple.apply(void 0, result) : result;\n };\n Object.defineProperty(tuple.prototype, name, desc);\n }\n});\n\n// Like `Array.prototype.concat`, except for the extra effort required to\n// convert any tuple arguments to arrays, so that\n// ```\n// tuple(1).concat(tuple(2), 3) === tuple(1, 2, 3)\n// ```\nvar ref = Array.prototype;\nvar concat = ref.concat;\ntuple.prototype.concat = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return tuple.apply(void 0, concat.apply(toArray(this), args.map(\n function (item) { return isTuple(item) ? toArray(item) : item; }\n )));\n};\n\nexports.default = tuple;\nexports.tuple = tuple;\nexports.lookup = lookup;\nexports.lookupArray = lookupArray;\n","\"use strict\";\n\nvar fakeNullFiber = new (function Fiber(){});\nvar localKey = \"_optimism_local\";\n\nfunction getCurrentFiber() {\n return fakeNullFiber;\n}\n\nif (typeof module === \"object\") {\n try {\n var Fiber = module[\"eriuqer\".split(\"\").reverse().join(\"\")](\"fibers\");\n // If we were able to require fibers, redefine the getCurrentFiber\n // function so that it has a chance to return Fiber.current.\n getCurrentFiber = function () {\n return Fiber.current || fakeNullFiber;\n };\n } catch (e) {}\n}\n\n// Returns an object unique to Fiber.current, if fibers are enabled.\n// This object is used for Fiber-local storage in ./entry.js.\nexports.get = function () {\n var fiber = getCurrentFiber();\n return fiber[localKey] || (fiber[localKey] = Object.create(null));\n};\n","\"use strict\";\n\nvar getLocal = require(\"./local.js\").get;\nvar UNKNOWN_VALUE = Object.create(null);\nvar emptySetPool = [];\nvar entryPool = [];\n\n// Don't let the emptySetPool or entryPool grow larger than this size,\n// since unconstrained pool growth could lead to memory leaks.\nexports.POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition, optionalMessage) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nfunction Entry(fn, key, args) {\n this.parents = new Set;\n this.childValues = new Map;\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n this.dirtyChildren = null;\n\n reset(this, fn, key, args);\n\n ++Entry.count;\n}\n\nEntry.count = 0;\n\nfunction reset(entry, fn, key, args) {\n entry.fn = fn;\n entry.key = key;\n entry.args = args;\n entry.value = UNKNOWN_VALUE;\n entry.dirty = true;\n entry.subscribe = null;\n entry.unsubscribe = null;\n entry.recomputing = false;\n // Optional callback that will be invoked when entry.parents becomes\n // empty. The Entry object is given as the first parameter. If the\n // callback returns true, then this entry can be removed from the graph\n // and safely recycled into the entryPool.\n entry.reportOrphan = null;\n}\n\nEntry.acquire = function (fn, key, args) {\n var entry = entryPool.pop();\n if (entry) {\n reset(entry, fn, key, args);\n return entry;\n }\n return new Entry(fn, key, args);\n};\n\nfunction release(entry) {\n assert(entry.parents.size === 0);\n assert(entry.childValues.size === 0);\n assert(entry.dirtyChildren === null);\n if (entryPool.length < exports.POOL_TARGET_SIZE) {\n entryPool.push(entry);\n }\n}\n\nexports.Entry = Entry;\n\nvar Ep = Entry.prototype;\n\n// The public API of Entry objects consists of the Entry constructor,\n// along with the recompute, setDirty, and dispose methods.\n\nEp.recompute = function recompute() {\n if (! rememberParent(this) &&\n maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispos(), which recycles it\n // into the entryPool, so we don't need to (and should not) proceed\n // with the recomputation.\n return;\n }\n\n return recomputeIfDirty(this);\n};\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry) {\n var report = entry.reportOrphan;\n return typeof report === \"function\" &&\n entry.parents.size === 0 &&\n report(entry) === true;\n}\n\nEp.setDirty = function setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n unsubscribe(this);\n};\n\nEp.dispose = function dispose() {\n var entry = this;\n forgetChildren(entry).forEach(maybeReportOrphan);\n unsubscribe(entry);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n entry.parents.forEach(function (parent) {\n parent.setDirty();\n forgetChild(parent, entry);\n });\n\n // Since this entry has no parents and no children anymore, and the\n // caller of Entry#dispose has indicated that entry.value no longer\n // matters, we can safely recycle this Entry object for later use.\n release(entry);\n};\n\nfunction setClean(entry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(entry) {\n entry.parents.forEach(function (parent) {\n reportDirtyChild(parent, entry);\n });\n}\n\nfunction reportClean(entry) {\n entry.parents.forEach(function (parent) {\n reportCleanChild(parent, entry);\n });\n}\n\nfunction mightBeDirty(entry) {\n return entry.dirty ||\n (entry.dirtyChildren &&\n entry.dirtyChildren.size);\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(entry, child) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(entry.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! entry.dirtyChildren) {\n entry.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (entry.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n entry.dirtyChildren.add(child);\n reportDirty(entry);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(entry, child) {\n var cv = entry.childValues;\n\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(cv.has(child));\n assert(! mightBeDirty(child));\n\n var childValue = cv.get(child);\n if (childValue === UNKNOWN_VALUE) {\n cv.set(child, child.value);\n } else if (childValue !== child.value) {\n entry.setDirty();\n }\n\n removeDirtyChild(entry, child);\n\n if (mightBeDirty(entry)) {\n return;\n }\n\n reportClean(entry);\n}\n\nfunction removeDirtyChild(entry, child) {\n var dc = entry.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < exports.POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n entry.dirtyChildren = null;\n }\n }\n}\n\nfunction rememberParent(entry) {\n var local = getLocal();\n var parent = local.currentParentEntry;\n if (parent) {\n entry.parents.add(parent);\n\n if (! parent.childValues.has(entry)) {\n parent.childValues.set(entry, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(entry)) {\n reportDirtyChild(parent, entry);\n } else {\n reportCleanChild(parent, entry);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren.forEach(function (child) {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n var originalChildren = forgetChildren(entry);\n\n var local = getLocal();\n var parent = local.currentParentEntry;\n local.currentParentEntry = entry;\n\n var threw = true;\n try {\n entry.value = entry.fn.apply(null, entry.args);\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n assert(local.currentParentEntry === entry);\n local.currentParentEntry = parent;\n\n if (threw || ! subscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nvar reusableEmptyArray = [];\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(entry) {\n var children = reusableEmptyArray;\n\n if (entry.childValues.size > 0) {\n children = [];\n entry.childValues.forEach(function (value, child) {\n forgetChild(entry, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefor must have been reset to null.\n assert(entry.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(entry, child) {\n child.parents.delete(entry);\n entry.childValues.delete(child);\n removeDirtyChild(entry, child);\n}\n\nfunction subscribe(entry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n unsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction unsubscribe(entry) {\n var unsub = entry.unsubscribe;\n if (typeof unsub === \"function\") {\n entry.unsubscribe = null;\n unsub();\n }\n}\n","\"use strict\";\n\nvar Cache = require(\"./cache.js\").Cache;\nvar tuple = require(\"immutable-tuple\").tuple;\nvar Entry = require(\"./entry.js\").Entry;\nvar getLocal = require(\"./local.js\").get;\n\n// Exported so that custom makeCacheKey functions can easily reuse the\n// default implementation (with different arguments).\nexports.defaultMakeCacheKey = tuple;\n\nfunction normalizeOptions(options) {\n options = options || Object.create(null);\n\n if (typeof options.makeCacheKey !== \"function\") {\n options.makeCacheKey = tuple;\n }\n\n if (typeof options.max !== \"number\") {\n options.max = Math.pow(2, 16);\n }\n\n return options;\n}\n\nfunction wrap(fn, options) {\n options = normalizeOptions(options);\n\n // If this wrapped function is disposable, then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n var disposable = !! options.disposable;\n\n var cache = new Cache({\n max: options.max,\n dispose: function (key, entry) {\n entry.dispose();\n }\n });\n\n function reportOrphan(entry) {\n if (disposable) {\n // Triggers the entry.dispose() call above.\n cache.delete(entry.key);\n return true;\n }\n }\n\n function optimistic() {\n if (disposable && ! getLocal().currentParentEntry) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return;\n }\n\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return fn.apply(null, arguments);\n }\n\n var args = [], len = arguments.length;\n while (len--) args[len] = arguments[len];\n\n var entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n cache.set(key, entry = Entry.acquire(fn, key, args));\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = reportOrphan;\n }\n }\n\n var value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if this entry\n // has no parents, which means we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (entry.parents.size === 0) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n if (! disposable) {\n return value;\n }\n }\n\n optimistic.dirty = function () {\n var key = options.makeCacheKey.apply(null, arguments);\n if (! key) {\n return;\n }\n\n if (! cache.has(key)) {\n return;\n }\n\n cache.get(key).setDirty();\n };\n\n return optimistic;\n}\n\nexports.wrap = wrap;\n","// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n invariant(\n obj.__typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","export class CacheKeyNode {\n private children: Map> | null = null;\n private key: KeyType | null = null;\n\n lookup(...args: any[]): KeyType {\n return this.lookupArray(args);\n }\n\n lookupArray(array: any[]): KeyType {\n let node: CacheKeyNode = this;\n array.forEach(value => {\n node = node.getOrCreate(value);\n });\n return node.key || (node.key = Object.create(null));\n }\n\n getOrCreate(value: any): CacheKeyNode {\n const map = this.children || (this.children = new Map());\n let node = map.get(value);\n if (!node) {\n map.set(value, (node = new CacheKeyNode()));\n }\n return node;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<(dataId: string) => StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n assign,\n getDefaultValues,\n getQueryDefinition,\n isEqual,\n DirectiveInfo,\n FragmentMap,\n IdValue,\n StoreValue,\n argumentsObjectFromField,\n createFragmentMap,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getStoreKeyName,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n resultKeyNameFromField,\n shouldInclude,\n toIdValue,\n mergeDeepArray,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap } from 'optimism';\nimport { CacheKeyNode } from './cacheKeys';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\nexport class StoreReader {\n constructor(\n private cacheKeyRoot = new CacheKeyNode,\n ) {\n const reader = this;\n const {\n executeStoreQuery,\n executeSelectionSet,\n } = reader;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n query,\n contextValue.store,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n selectionSet,\n execContext.contextValue.store,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray(\n field,\n readStoreResult.result,\n execContext,\n ),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n result = result.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray(field, item, execContext));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n return { result, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const idValue = toIdValue({ id: 'self', typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ self: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { CacheKeyNode } from './cacheKeys';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new CacheKeyNode();\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeReader = new StoreReader(this.cacheKeyRoot);\n this.storeWriter = new StoreWriter();\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n","import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = Error & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new Error(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch is nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n","import Model from \"../orm/model\";\n\nexport enum ConnectionMode {\n AUTO,\n PLAIN,\n NODES,\n EDGES\n}\n\nexport enum ArgumentMode {\n TYPE,\n LIST\n}\n\nexport default interface Adapter {\n getRootQueryName(): string;\n getRootMutationName(): string;\n\n getNameForPersist(model: Model): string;\n getNameForPush(model: Model): string;\n getNameForDestroy(model: Model): string;\n getNameForFetch(model: Model, plural: boolean): string;\n\n getConnectionMode(): ConnectionMode;\n\n getArgumentMode(): ArgumentMode;\n\n getFilterTypeName(model: Model): string;\n getInputTypeName(model: Model, action?: string): string;\n\n prepareSchemaTypeName(name: string): string;\n}\n","import { Data, Field } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel, Relation } from \"@vuex-orm/core\";\nimport Context from \"../common/context\";\nimport {\n clone,\n downcaseFirstLetter,\n isPlainObject,\n pluralize,\n singularize\n} from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\n\n/**\n * This class provides methods to transform incoming data from GraphQL in to a format Vuex-ORM understands and\n * vice versa.\n */\nexport default class Transformer {\n /**\n * Transforms outgoing data. Use for variables param.\n *\n * @param {Model} model Base model of the mutation/query\n * @param {Data} data Data to transform\n * @param {boolean} read Tells if this is a write or a read action. read is fetch, write is push and persist.\n * @param {Array} whitelist of fields\n * @param {Map>} outgoingRecords List of record IDs that are already added to the\n * outgoing data in order to detect recursion.\n * @param {boolean} recursiveCall Tells if it's a recursive call.\n * @returns {Data}\n */\n public static transformOutgoingData(\n model: Model,\n data: Data,\n read: boolean,\n whitelist?: Array,\n outgoingRecords?: Map>,\n recursiveCall?: boolean\n ): Data {\n const context = Context.getInstance();\n const relations: Map = model.getRelations();\n const returnValue: Data = {} as Data;\n if (outgoingRecords === undefined) outgoingRecords = new Map>();\n if (recursiveCall === undefined) recursiveCall = false;\n\n Object.keys(data).forEach(key => {\n const value = data[key];\n\n const isRelation = model.getRelations().has(key);\n let isRecursion = false;\n\n if (value instanceof Array) {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value[0]);\n } else {\n isRecursion = isRelation && this.isRecursion(outgoingRecords!, value);\n }\n\n // shouldIncludeOutgoingField and the read param is tricky. In the initial call of this method\n // we want to include any relation, so we have to make sure it's false. In the recursive calls\n // it should be true when we transform the outgoing data for fetch (and false for the others)\n if (\n !isRecursion &&\n this.shouldIncludeOutgoingField(\n (recursiveCall as boolean) && read,\n key,\n value,\n model,\n whitelist\n )\n ) {\n let relatedModel = Model.getRelatedModel(relations.get(key)!);\n\n if (value instanceof Array) {\n // Either this is a hasMany field or a .attr() field which contains an array.\n const arrayModel = context.getModel(singularize(key), true);\n\n if (arrayModel) {\n this.addRecordForRecursionDetection(outgoingRecords!, value[0]);\n returnValue[key] = value.map(v => {\n return this.transformOutgoingData(\n arrayModel || model,\n v,\n read,\n undefined,\n outgoingRecords,\n true\n );\n });\n } else {\n // Simple field, not a relation\n returnValue[key] = value;\n }\n } else if (typeof value === \"object\" && value.$id !== undefined) {\n if (!relatedModel) {\n relatedModel = context.getModel((value as ORMModel).$self().entity);\n }\n\n this.addRecordForRecursionDetection(outgoingRecords!, value);\n\n // Value is a record, transform that too\n returnValue[key] = this.transformOutgoingData(\n relatedModel,\n value,\n read,\n undefined,\n outgoingRecords,\n true\n );\n } else {\n // In any other case just let the value be what ever it is\n returnValue[key] = value;\n }\n }\n });\n\n return returnValue;\n }\n\n /**\n * Transforms a set of incoming data to the format vuex-orm requires.\n *\n * @param {Data | Array} data\n * @param model\n * @param mutation required to transform something like `disableUserAddress` to the actual model name.\n * @param {boolean} recursiveCall\n * @returns {Data}\n */\n public static transformIncomingData(\n data: Data | Array,\n model: Model,\n mutation: boolean = false,\n recursiveCall: boolean = false\n ): Data {\n let result: Data | Array = {} as Data;\n const context = Context.getInstance();\n\n if (!recursiveCall) {\n context.logger.group(\"Transforming incoming data\");\n context.logger.log(\"Raw data:\", data);\n }\n\n if (Array.isArray(data)) {\n result = data.map((d: any) => this.transformIncomingData(d, model, mutation, true));\n } else {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined && data[key] !== null && key in data) {\n if (isPlainObject(data[key])) {\n const localModel: Model = context.getModel(key, true) || model;\n\n if (data[key].nodes && context.connectionMode === ConnectionMode.NODES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].nodes,\n localModel,\n mutation,\n true\n );\n } else if (data[key].edges && context.connectionMode === ConnectionMode.EDGES) {\n result[pluralize(key)] = this.transformIncomingData(\n data[key].edges,\n localModel,\n mutation,\n true\n );\n } else if (data[\"node\"] && context.connectionMode === ConnectionMode.EDGES) {\n result = this.transformIncomingData(data[\"node\"], localModel, mutation, true);\n } else {\n let newKey = key;\n\n if (mutation && !recursiveCall) {\n newKey = data[key].nodes ? localModel.pluralName : localModel.singularName;\n newKey = downcaseFirstLetter(newKey);\n }\n\n result[newKey] = this.transformIncomingData(data[key], localModel, mutation, true);\n }\n } else if (Model.isFieldNumber(model.fields.get(key))) {\n result[key] = parseFloat(data[key]);\n } else if (key.endsWith(\"Type\") && model.isTypeFieldOfPolymorphicRelation(key)) {\n result[key] = pluralize(downcaseFirstLetter(data[key]));\n } else {\n result[key] = data[key];\n }\n }\n });\n }\n\n if (!recursiveCall) {\n context.logger.log(\"Transformed data:\", result);\n context.logger.groupEnd();\n } else {\n result[\"$isPersisted\"] = true;\n }\n\n // Make sure this is really a plain JS object. We had some issues in testing here.\n return clone(result);\n }\n\n /**\n * Tells if a field should be included in the outgoing data.\n * @param {boolean} forFilter Tells whether a filter is constructed or not.\n * @param {string} fieldName Name of the field to check.\n * @param {any} value Value of the field.\n * @param {Model} model Model class which contains the field.\n * @param {Array|undefined} whitelist Contains a list of fields which should always be included.\n * @returns {boolean}\n */\n public static shouldIncludeOutgoingField(\n forFilter: boolean,\n fieldName: string,\n value: any,\n model: Model,\n whitelist?: Array\n ): boolean {\n // Always add fields on the whitelist.\n if (whitelist && whitelist.includes(fieldName)) return true;\n\n // Ignore internal fields\n if (fieldName.startsWith(\"$\")) return false;\n\n // Ignore empty fields\n if (value === null || value === undefined) return false;\n\n // Include all eager save connections\n if (model.getRelations().has(fieldName)) {\n // We never add relations to filters.\n if (forFilter) return false;\n\n const relation: Relation = model.getRelations().get(fieldName)!;\n const related: Model | null = Model.getRelatedModel(relation);\n if (related && model.shouldEagerSaveRelation(fieldName, relation, related)) return true;\n\n // All other relations are skipped\n return false;\n }\n\n // Everything else is ok\n return true;\n }\n\n /**\n * Registers a record for recursion detection.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to register.\n */\n private static addRecordForRecursionDetection(\n records: Map>,\n record: ORMModel\n ): void {\n const context: Context = Context.getInstance();\n\n if (!record) {\n context.logger.warn(\"Trying to add invalid record\", record, \"to recursion detection\");\n return;\n }\n\n if (!record.$self) {\n context.logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return;\n }\n\n const model: Model = context.getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n ids.push(record.$id!);\n records.set(model.singularName, ids);\n }\n\n /**\n * Detects recursions.\n * @param {Map>} records Map of IDs.\n * @param {ORMModel} record The record to check.\n * @return {boolean} true when the record is already included in the records.\n */\n private static isRecursion(records: Map>, record: ORMModel): boolean {\n if (!record) return false;\n\n if (!record.$self) {\n Context.getInstance().logger.warn(\n \"Seems like you're using non-model classes with plugin graphql. You shouldn't do that.\"\n );\n return false;\n }\n\n const model: Model = Context.getInstance().getModel(record.$self().entity);\n const ids = records.get(model.singularName) || [];\n return ids.includes(record.$id!);\n }\n}\n","var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\n\nmodule.exports = gql;\n","import { ApolloClient, FetchPolicy } from \"apollo-client\";\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\nimport { HttpLink } from \"apollo-link-http\";\nimport { ApolloLink } from \"apollo-link\";\nimport Context from \"../common/context\";\nimport { Arguments, Data } from \"../support/interfaces\";\nimport Transformer from \"./transformer\";\nimport Model from \"../orm/model\";\nimport gql from \"graphql-tag\";\n\n/**\n * This class takes care of the communication with the graphql endpoint by leveraging the awesome apollo-client lib.\n */\nexport default class Apollo {\n /**\n * The http link instance to use.\n * @type {HttpLink}\n */\n private readonly httpLink: ApolloLink;\n\n /**\n * The ApolloClient instance\n * @type {ApolloClient}\n */\n private readonly apolloClient: ApolloClient;\n\n /**\n * @constructor\n */\n public constructor() {\n const context = Context.getInstance();\n\n // This allows the test suite to pass a custom link\n if (!context.options.apolloClient && context.options.link) {\n this.httpLink = context.options.link;\n } else {\n /* istanbul ignore next */\n this.httpLink = new HttpLink({\n uri: context.options.url ? context.options.url : \"/graphql\",\n credentials: context.options.credentials ? context.options.credentials : \"same-origin\",\n useGETForQueries: Boolean(context.options.useGETForQueries)\n });\n }\n\n if (context.options.apolloClient) {\n this.apolloClient = (context => {\n return context.options.apolloClient;\n })(context);\n } else {\n this.apolloClient = new ApolloClient({\n link: this.httpLink,\n cache: new InMemoryCache(),\n connectToDevTools: context.debugMode\n });\n }\n }\n\n /**\n * Sends a request to the GraphQL API via apollo\n * @param model\n * @param {any} query The query to send (result from gql())\n * @param {Arguments} variables Optional. The variables to send with the query\n * @param {boolean} mutation Optional. If this is a mutation (true) or a query (false, default)\n * @param {boolean} bypassCache If true the query will be send to the server without using the cache. For queries only\n * @returns {Promise} The new records\n */\n public async request(\n model: Model,\n query: any,\n variables?: Arguments,\n mutation: boolean = false,\n bypassCache: boolean = false\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n Context.getInstance().logger.logQuery(query, variables, fetchPolicy);\n\n const context = { headers: Apollo.getHeaders() };\n\n let response;\n if (mutation) {\n response = await this.apolloClient.mutate({ mutation: query, variables, context });\n } else {\n response = await this.apolloClient.query({ query, variables, fetchPolicy, context });\n }\n\n // Transform incoming data into something useful\n return Transformer.transformIncomingData(response.data as Data, model, mutation);\n }\n\n public async simpleQuery(\n query: string,\n variables: Arguments,\n bypassCache: boolean = false,\n context?: Data\n ): Promise {\n const fetchPolicy: FetchPolicy = bypassCache ? \"network-only\" : \"cache-first\";\n return this.apolloClient.query({\n query: gql(query),\n variables,\n fetchPolicy,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n public async simpleMutation(query: string, variables: Arguments, context?: Data): Promise {\n return this.apolloClient.mutate({\n mutation: gql(query),\n variables,\n context: { headers: Apollo.getHeaders() }\n });\n }\n\n private static getHeaders() {\n const context = Context.getInstance();\n\n let headers: any = context.options.headers ? context.options.headers : {};\n\n if (typeof headers === \"function\") {\n headers = headers(context);\n }\n\n return headers;\n }\n}\n","import {\n GraphQLField,\n GraphQLSchema,\n GraphQLType,\n GraphQLTypeDefinition\n} from \"../support/interfaces\";\nimport { upcaseFirstLetter } from \"../support/utils\";\nimport { ConnectionMode } from \"../adapters/adapter\";\nimport Context from \"../common/context\";\n\nexport default class Schema {\n private schema: GraphQLSchema;\n private types: Map;\n private mutations: Map;\n private queries: Map;\n\n public constructor(schema: GraphQLSchema) {\n const context = Context.getInstance();\n\n this.schema = schema;\n this.types = new Map();\n this.mutations = new Map();\n this.queries = new Map();\n\n this.schema.types.forEach((t: GraphQLType) => this.types.set(t.name, t));\n\n this.getType(context.adapter.getRootQueryName())!.fields!.forEach(f =>\n this.queries.set(f.name, f)\n );\n this.getType(context.adapter.getRootMutationName())!.fields!.forEach(f =>\n this.mutations.set(f.name, f)\n );\n }\n\n public determineQueryMode(): ConnectionMode {\n let connection: GraphQLType | null = null;\n\n this.queries.forEach(query => {\n const typeName = Schema.getTypeNameOfField(query);\n if (typeName.endsWith(\"TypeConnection\")) {\n connection = this.getType(typeName);\n return false; // break\n }\n return true;\n });\n\n /* istanbul ignore next */\n if (!connection) {\n throw new Error(\n \"Can't determine the connection mode due to the fact that here are no connection types in the schema. Please set the connectionMode via Vuex-ORM-GraphQL options!\"\n );\n }\n\n if (connection!.fields!.find(f => f.name === \"nodes\")) {\n return ConnectionMode.NODES;\n } else if (connection!.fields!.find(f => f.name === \"edges\")) {\n return ConnectionMode.EDGES;\n } else {\n return ConnectionMode.PLAIN;\n }\n }\n\n public getType(name: string, allowNull: boolean = false): GraphQLType | null {\n name = Context.getInstance().adapter.prepareSchemaTypeName(name);\n const type = this.types.get(name);\n\n if (!allowNull && !type) {\n throw new Error(`Couldn't find Type of name ${name} in the GraphQL Schema.`);\n }\n\n return type || null;\n }\n\n public getMutation(name: string, allowNull: boolean = false): GraphQLField | null {\n const mutation = this.mutations.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !mutation) {\n throw new Error(`Couldn't find Mutation of name ${name} in the GraphQL Schema.`);\n }\n\n return mutation || null;\n }\n\n public getQuery(name: string, allowNull: boolean = false): GraphQLField | null {\n const query = this.queries.get(name);\n\n /* istanbul ignore next */\n if (!allowNull && !query) {\n throw new Error(`Couldn't find Query of name ${name} in the GraphQL Schema.`);\n }\n\n return query || null;\n }\n\n static returnsConnection(field: GraphQLField): boolean {\n return Schema.getTypeNameOfField(field).endsWith(\"TypeConnection\");\n }\n\n static getRealType(type: GraphQLTypeDefinition): GraphQLTypeDefinition {\n if (type.kind === \"NON_NULL\") {\n return this.getRealType(type.ofType);\n } else {\n return type;\n }\n }\n\n static getTypeNameOfField(field: GraphQLField): string {\n let type = this.getRealType(field.type);\n\n if (type.kind === \"LIST\") {\n while (!type.name) type = type.ofType;\n return `[${type.name}]`;\n } else {\n while (!type.name) type = type.ofType;\n\n /* istanbul ignore next */\n if (!type.name) throw new Error(`Can't find type name for field ${field.name}`);\n\n return type.name;\n }\n }\n}\n","import Adapter, { ConnectionMode, ArgumentMode } from \"../adapter\";\nimport Model from \"../../orm/model\";\nimport { upcaseFirstLetter } from \"../../support/utils\";\n\nexport default class DefaultAdapter implements Adapter {\n getRootMutationName(): string {\n return \"Mutation\";\n }\n\n getRootQueryName(): string {\n return \"Query\";\n }\n\n getConnectionMode(): ConnectionMode {\n return ConnectionMode.NODES;\n }\n\n getArgumentMode(): ArgumentMode {\n return ArgumentMode.TYPE;\n }\n\n getFilterTypeName(model: Model): string {\n return `${upcaseFirstLetter(model.singularName)}Filter`;\n }\n\n getInputTypeName(model: Model, action?: string): string {\n return `${upcaseFirstLetter(model.singularName)}Input`;\n }\n\n getNameForDestroy(model: Model): string {\n return `delete${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForFetch(model: Model, plural: boolean): string {\n return plural ? model.pluralName : model.singularName;\n }\n\n getNameForPersist(model: Model): string {\n return `create${upcaseFirstLetter(model.singularName)}`;\n }\n\n getNameForPush(model: Model): string {\n return `update${upcaseFirstLetter(model.singularName)}`;\n }\n\n prepareSchemaTypeName(name: string): string {\n return upcaseFirstLetter(name);\n }\n}\n","import Logger from \"./logger\";\nimport Model from \"../orm/model\";\nimport { Model as ORMModel } from \"@vuex-orm/core\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { downcaseFirstLetter, isEqual, pick, singularize } from \"../support/utils\";\nimport Apollo from \"../graphql/apollo\";\nimport Database from \"@vuex-orm/core/lib/database/Database\";\nimport { Data, Field, GraphQLType, Options } from \"../support/interfaces\";\nimport Schema from \"../graphql/schema\";\nimport { Mock, MockOptions } from \"../test-utils\";\nimport Adapter, { ConnectionMode } from \"../adapters/adapter\";\nimport DefaultAdapter from \"../adapters/builtin/default-adapter\";\nimport introspectionQuery from \"../graphql/introspection-query\";\n\n/**\n * Internal context of the plugin. This class contains all information, the models, database, logger and so on.\n *\n * It's a singleton class, so just call Context.getInstance() anywhere you need the context.\n */\nexport default class Context {\n /**\n * Contains the instance for the singleton pattern.\n * @type {Context}\n */\n public static instance: Context;\n\n /**\n * Components collection of Vuex-ORM\n * @type {Components}\n */\n public readonly components: Components;\n\n /**\n * The options which have been passed to VuexOrm.install\n * @type {Options}\n */\n public readonly options: Options;\n\n /**\n * GraphQL Adapter.\n * @type {Adapter}\n */\n public readonly adapter: Adapter;\n\n /**\n * The Vuex-ORM database\n * @type {Database}\n */\n public readonly database: Database;\n\n /**\n * Collection of all Vuex-ORM models wrapped in a Model instance.\n * @type {Map}\n */\n public readonly models: Map = new Map();\n\n /**\n * When true, the logging is enabled.\n * @type {boolean}\n */\n public readonly debugMode: boolean = false;\n\n /**\n * Our nice Vuex-ORM-GraphQL logger\n * @type {Logger}\n */\n public readonly logger: Logger;\n\n /**\n * Instance of Apollo which cares about the communication with the graphql endpoint.\n * @type {Apollo}\n */\n public apollo!: Apollo;\n\n /**\n * The graphql schema. Is null until the first request.\n * @type {Schema}\n */\n public schema: Schema | undefined;\n\n /**\n * Tells if the schema is already loaded or the loading is currently processed.\n * @type {boolean}\n */\n private schemaWillBeLoaded: Promise | undefined;\n\n /**\n * Defines how to query connections. 'auto' | 'nodes' | 'edges' | 'plain'\n */\n public connectionMode: ConnectionMode = ConnectionMode.AUTO;\n\n /**\n * Container for the global mocks.\n * @type {Object}\n */\n private globalMocks: { [key: string]: Array } = {};\n\n /**\n * Private constructor, called by the setup method\n *\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n private constructor(components: Components, options: Options) {\n this.components = components;\n this.options = options;\n\n this.database = options.database;\n this.debugMode = Boolean(options.debug);\n this.logger = new Logger(this.debugMode);\n this.adapter = options.adapter || new DefaultAdapter();\n\n /* istanbul ignore next */\n if (!options.database) {\n throw new Error(\"database param is required to initialize vuex-orm-graphql!\");\n }\n }\n\n /**\n * Get the singleton instance of the context.\n * @returns {Context}\n */\n public static getInstance(): Context {\n return this.instance;\n }\n\n /**\n * This is called only once and creates a new instance of the Context.\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {Context}\n */\n public static setup(components: Components, options: Options): Context {\n this.instance = new Context(components, options);\n\n this.instance.apollo = new Apollo();\n this.instance.collectModels();\n\n this.instance.logger.group(\"Context setup\");\n this.instance.logger.log(\"components\", this.instance.components);\n this.instance.logger.log(\"options\", this.instance.options);\n this.instance.logger.log(\"database\", this.instance.database);\n this.instance.logger.log(\"models\", this.instance.models);\n this.instance.logger.groupEnd();\n\n return this.instance;\n }\n\n public async loadSchema(): Promise {\n if (!this.schemaWillBeLoaded) {\n this.schemaWillBeLoaded = new Promise(async (resolve, reject) => {\n this.logger.log(\"Fetching GraphQL Schema initially ...\");\n\n this.connectionMode = this.adapter.getConnectionMode();\n\n // We send a custom header along with the request. This is required for our test suite to mock the schema request.\n const context = {\n headers: { \"X-GraphQL-Introspection-Query\": \"true\" }\n };\n\n const result = await this.apollo.simpleQuery(\n introspectionQuery,\n {},\n true,\n (context as unknown) as Data\n );\n\n this.schema = new Schema(result.data.__schema);\n\n this.logger.log(\"GraphQL Schema successful fetched\", result);\n\n this.logger.log(\"Starting to process the schema ...\");\n this.processSchema();\n this.logger.log(\"Schema procession done!\");\n\n resolve(this.schema);\n });\n }\n\n return this.schemaWillBeLoaded;\n }\n\n public processSchema() {\n this.models.forEach((model: Model) => {\n let type: GraphQLType;\n\n try {\n type = this.schema!.getType(model.singularName)!;\n } catch (error) {\n this.logger.warn(`Ignoring entity ${model.singularName} because it's not in the schema.`);\n return;\n }\n\n model.fields.forEach((field: Field, fieldName: string) => {\n if (!type.fields!.find(f => f.name === fieldName)) {\n this.logger.warn(\n `Ignoring field ${model.singularName}.${fieldName} because it's not in the schema.`\n );\n\n // TODO: Move skipFields to the model\n model.baseModel.skipFields = model.baseModel.skipFields ? model.baseModel.skipFields : [];\n if (!model.baseModel.skipFields.includes(fieldName)) {\n model.baseModel.skipFields.push(fieldName);\n }\n }\n });\n });\n\n if (this.connectionMode === ConnectionMode.AUTO) {\n this.connectionMode = this.schema!.determineQueryMode();\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by automatic detection`);\n } else {\n this.logger.log(`Connection Query Mode is ${this.connectionMode} by config`);\n }\n }\n\n /**\n * Returns a model from the model collection by it's name\n *\n * @param {Model|string} model A Model instance, a singular or plural name of the model\n * @param {boolean} allowNull When true this method returns null instead of throwing an exception when no model was\n * found. Default is false\n * @returns {Model}\n */\n public getModel(model: Model | string, allowNull: boolean = false): Model {\n if (typeof model === \"string\") {\n const name: string = singularize(downcaseFirstLetter(model));\n model = this.models.get(name) as Model;\n if (!allowNull && !model) throw new Error(`No such model ${name}!`);\n }\n\n return model;\n }\n\n /**\n * Will add a mock for simple mutations or queries. These are model unrelated and have to be\n * handled globally.\n *\n * @param {Mock} mock - Mock config.\n */\n public addGlobalMock(mock: Mock): boolean {\n if (this.findGlobalMock(mock.action, mock.options)) return false;\n if (!this.globalMocks[mock.action]) this.globalMocks[mock.action] = [];\n\n this.globalMocks[mock.action].push(mock);\n return true;\n }\n\n /**\n * Finds a global mock for the given action and options.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions like { name: 'example' }.\n * @returns {Mock | null} null when no mock was found.\n */\n public findGlobalMock(action: string, options: MockOptions | undefined): Mock | null {\n if (this.globalMocks[action]) {\n return (\n this.globalMocks[action].find(m => {\n if (!m.options || !options) return true;\n\n const relevantOptions = pick(options, Object.keys(m.options));\n return isEqual(relevantOptions, m.options || {});\n }) || null\n );\n }\n\n return null;\n }\n\n /**\n * Hook to be called by simpleMutation and simpleQuery actions in order to get the global mock\n * returnValue.\n *\n * @param {string} action - Name of the action like 'simpleQuery' or 'simpleMutation'.\n * @param {MockOptions} options - MockOptions.\n * @returns {any} null when no mock was found.\n */\n public globalMockHook(action: string, options: MockOptions): any {\n let returnValue: null | { [key: string]: any } = null;\n const mock = this.findGlobalMock(action, options);\n\n if (mock) {\n if (mock.returnValue instanceof Function) {\n returnValue = mock.returnValue();\n } else {\n returnValue = mock.returnValue || null;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Wraps all Vuex-ORM entities in a Model object and saves them into this.models\n */\n private collectModels() {\n this.database.entities.forEach((entity: any) => {\n const model: Model = new Model(entity.model as typeof ORMModel);\n this.models.set(model.singularName, model);\n Model.augment(model);\n });\n }\n}\n","export default `\nquery Introspection {\n __schema {\n types {\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n\n inputFields {\n name\n description\n type {\n name\n kind\n\n ofType {\n kind\n\n name\n ofType {\n kind\n name\n\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n`;\n","import { Relation } from \"@vuex-orm/core\";\nimport Model from \"../orm/model\";\nimport { Arguments, Field, GraphQLField, GraphQLType } from \"../support/interfaces\";\nimport { clone, isPlainObject, takeWhile, upcaseFirstLetter } from \"../support/utils\";\nimport gql from \"graphql-tag\";\nimport Context from \"../common/context\";\nimport Schema from \"./schema\";\nimport { ConnectionMode, ArgumentMode } from \"../adapters/adapter\";\n\n/**\n * Contains all logic to build GraphQL queries/mutations.\n */\nexport default class QueryBuilder {\n /**\n * Builds a field for the GraphQL query and a specific model\n *\n * @param {Model|string} model The model to use\n * @param {boolean} multiple Determines whether plural/nodes syntax or singular syntax is used.\n * @param {Arguments} args The args that will be passed to the query field ( user(role: $role) )\n * @param {Array} path The relations in this list are ignored (while traversing relations).\n * Mainly for recursion\n * @param {string} name Optional name of the field. If not provided, this will be the model name\n * @param filter\n * @param {boolean} allowIdFields Optional. Determines if id fields will be ignored for the argument generation.\n * See buildArguments\n * @returns {string}\n *\n * @todo Do we need the allowIdFields param?\n */\n public static buildField(\n model: Model | string,\n multiple: boolean = true,\n args?: Arguments,\n path: Array = [],\n name?: string,\n filter: boolean = false,\n allowIdFields: boolean = false\n ): string {\n const context = Context.getInstance();\n model = context.getModel(model);\n\n name = name ? name : model.pluralName;\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n let params: string = this.buildArguments(model, args, false, filter, allowIdFields, field);\n path = path.length === 0 ? [model.singularName] : path;\n\n const fields = `\n ${model.getQueryFields().join(\" \")}\n ${this.buildRelationsQuery(model, path)}\n `;\n\n if (multiple) {\n const header: string = `${name}${params}`;\n\n if (context.connectionMode === ConnectionMode.NODES) {\n return `\n ${header} {\n nodes {\n ${fields}\n }\n }\n `;\n } else if (context.connectionMode === ConnectionMode.EDGES) {\n return `\n ${header} {\n edges {\n node {\n ${fields}\n }\n }\n }\n `;\n } else {\n return `\n ${header} {\n ${fields}\n }\n `;\n }\n } else {\n return `\n ${name ? name : model.singularName}${params} {\n ${fields}\n }\n `;\n }\n }\n\n /**\n * Generates a query.\n * Currently only one root field for the query is possible.\n * @param {string} type 'mutation' or 'query'\n * @param {Model | string} model The model this query or mutation affects. This mainly determines the query fields.\n * @param {string} name Optional name of the query/mutation. Will overwrite the name from the model.\n * @param {Arguments} args Arguments for the query\n * @param {boolean} multiple Determines if the root query field is a connection or not (will be passed to buildField)\n * @param {boolean} filter When true the query arguments are passed via a filter object.\n * @returns {any} Whatever gql() returns\n */\n public static buildQuery(\n type: string,\n model: Model | string,\n name?: string,\n args?: Arguments,\n multiple?: boolean,\n filter?: boolean\n ) {\n const context = Context.getInstance();\n\n // model\n model = context.getModel(model);\n\n // arguments\n args = this.prepareArguments(args);\n\n // multiple\n multiple = multiple === undefined ? !args[\"id\"] : multiple;\n\n // name\n if (!name) name = multiple ? model.pluralName : model.singularName;\n\n // field\n const field = context.schema!.getMutation(name, true) || context.schema!.getQuery(name, true);\n\n // build query\n const query: string =\n `${type} ${upcaseFirstLetter(name)}${this.buildArguments(\n model,\n args,\n true,\n filter,\n true,\n field\n )} {\\n` +\n ` ${this.buildField(model, multiple, args, [], name, filter, true)}\\n` +\n `}`;\n\n return gql(query);\n }\n\n /**\n * Generates the arguments string for a graphql query based on a given map.\n *\n * There are three types of arguments:\n *\n * 1) Signatures with primitive types (signature = true)\n * => 'mutation createUser($name: String!)'\n *\n * 2) Signatures with object types (signature = true, args = { user: { __type: 'User' }})\n * => 'mutation createUser($user: UserInput!)'\n *\n * 3) Fields with variables (signature = false)\n * => 'user(id: $id)'\n *\n * 4) Filter fields with variables (signature = false, filter = true)\n * => 'users(filter: { active: $active })'\n *\n * @param model\n * @param {Arguments | undefined} args\n * @param {boolean} signature When true, then this method generates a query signature instead of key/value pairs\n * @param filter\n * @param {boolean} allowIdFields If true, ID fields will be included in the arguments list\n * @param {GraphQLField} field Optional. The GraphQL mutation or query field\n * @returns {String}\n */\n public static buildArguments(\n model: Model,\n args?: Arguments,\n signature: boolean = false,\n filter: boolean = false,\n allowIdFields: boolean = true,\n field: GraphQLField | null = null\n ): string {\n const context = Context.getInstance();\n if (args === undefined) return \"\";\n\n let returnValue: string = \"\";\n let first: boolean = true;\n\n if (args) {\n Object.keys(args).forEach((key: string) => {\n let value: any = args[key];\n\n const isForeignKey = model.skipField(key);\n const skipFieldDueId = (key === \"id\" || isForeignKey) && !allowIdFields;\n\n let schemaField: GraphQLField | undefined = this.findSchemaFieldForArgument(\n key,\n field,\n model,\n filter\n );\n\n const isConnectionField =\n schemaField && Schema.getTypeNameOfField(schemaField).endsWith(\"TypeConnection\");\n\n // Ignore null fields, ids and connections\n if (value && !skipFieldDueId && !isConnectionField) {\n let typeOrValue: any = \"\";\n\n if (signature) {\n if (isPlainObject(value) && value.__type) {\n // Case 2 (User!)\n typeOrValue = context.adapter.getInputTypeName(context.getModel(value.__type)) + \"!\";\n } else if (value instanceof Array && field) {\n const arg = QueryBuilder.findSchemaFieldForArgument(key, field, model, filter);\n\n /* istanbul ignore next */\n if (!arg) {\n throw new Error(\n `The argument ${key} is of type array but it's not possible to determine the type, because it's not in the field ${\n field.name\n }`\n );\n }\n\n typeOrValue = Schema.getTypeNameOfField(arg) + \"!\";\n } else if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n // Case 1, 3 and 4\n typeOrValue = Schema.getTypeNameOfField(schemaField) + \"!\";\n } else if (key === \"id\" || isForeignKey) {\n // Case 1 (ID!)\n typeOrValue = \"ID!\";\n } else {\n // Case 1 (String!)\n typeOrValue = this.determineAttributeType(model, key, value, field || undefined);\n typeOrValue = typeOrValue + \"!\";\n }\n } else {\n // Case 3 or 4\n typeOrValue = `$${key}`;\n }\n\n returnValue = `${returnValue}${first ? \"\" : \", \"}${(signature ? \"$\" : \"\") +\n key}: ${typeOrValue}`;\n\n first = false;\n }\n });\n\n if (!first) {\n if (!signature && filter) returnValue = `filter: { ${returnValue} }`;\n returnValue = `(${returnValue})`;\n }\n }\n\n return returnValue;\n }\n\n /**\n * Determines the GraphQL primitive type of a field in the variables hash by the field type or (when\n * the field type is generic attribute) by the variable type.\n * @param {Model} model\n * @param {string} key\n * @param {string} value\n * @param {GraphQLField} query Pass when we have to detect the type of an argument\n * @returns {string}\n */\n public static determineAttributeType(\n model: Model,\n key: string,\n value: any,\n query?: GraphQLField\n ): string {\n const context: Context = Context.getInstance();\n const field: undefined | Field = model.fields.get(key);\n let schemaField: undefined | GraphQLField;\n\n if (query) {\n schemaField = query.args.find(f => f.name === key);\n\n if (!schemaField) {\n const filterField = query.args.find(f => f.name === \"filter\");\n\n if (filterField) {\n schemaField = this.findSchemaFieldForArgument(key, null, model, true);\n }\n }\n } else {\n schemaField = context.schema!.getType(model.singularName)!.fields!.find(f => f.name === key);\n }\n\n if (schemaField && Schema.getTypeNameOfField(schemaField)) {\n return Schema.getTypeNameOfField(schemaField);\n } else {\n if (field instanceof context.components.String) {\n return \"String\";\n } else if (field && field instanceof context.components.Number) {\n return \"Int\";\n } else if (field && field instanceof context.components.Boolean) {\n return \"Boolean\";\n } else {\n if (typeof value === \"number\") return \"Int\";\n if (typeof value === \"string\") return \"String\";\n if (typeof value === \"boolean\") return \"Boolean\";\n\n throw new Error(\n `Can't find suitable graphql type for field '${model.singularName}.${key}'.`\n );\n }\n }\n }\n\n private static findSchemaFieldForArgument(\n name: String,\n field: GraphQLField | null,\n model: Model,\n isFilter: boolean\n ): GraphQLField | undefined {\n const context = Context.getInstance();\n const schema = context.schema!;\n let schemaField: GraphQLField | undefined;\n\n if (field) {\n schemaField = field.args.find(f => f.name === name);\n if (schemaField) return schemaField;\n }\n\n // We try to find the FilterType or at least the Type this query belongs to.\n const type: GraphQLType | null = schema.getType(\n isFilter ? context.adapter.getFilterTypeName(model) : model.singularName,\n true\n );\n\n // Next we try to find the field from the type\n schemaField = type\n ? (isFilter ? type.inputFields! : type.fields!).find(f => f.name === name)\n : undefined;\n\n // Warn before we return null\n if (!schemaField) {\n Context.getInstance().logger.warn(\n `Couldn't find the argument with name ${name} for the mutation/query ${\n field ? field.name : \"(?)\"\n }`\n );\n }\n\n return schemaField;\n }\n\n /**\n * Generates the fields for all related models.\n *\n * @param {Model} model\n * @param {Array} path\n * @returns {string}\n */\n static buildRelationsQuery(model: null | Model, path: Array = []): string {\n if (model === null) return \"\";\n\n const context = Context.getInstance();\n const relationQueries: Array = [];\n\n model.getRelations().forEach((field: Relation, name: string) => {\n let relatedModel: Model = Model.getRelatedModel(field)!;\n\n // We will ignore the field, when it's already in the path. Means: When it's already queried. However there are\n // cases where the model will have a relationship to itself. For example a nested category strucure where the\n // category model has a parent: belongsTo(Category). So we also check if the model references itself. If this is\n // the case, we allow the nesting up to 5 times.\n const referencesItSelf = takeWhile(\n path.slice(0).reverse(),\n (p: string) => p === relatedModel.singularName\n ).length;\n const ignore = referencesItSelf\n ? referencesItSelf > 5\n : path.includes(relatedModel.singularName);\n\n // console.log(`-----> Will ${ignore ? '' : 'not'} ignore ${model.singularName}.${name}, path: ${path.join('.')}`);\n\n if (model.shouldEagerLoadRelation(name, field, relatedModel) && !ignore) {\n const newPath = path.slice(0);\n newPath.push(relatedModel.singularName);\n\n relationQueries.push(\n this.buildField(\n relatedModel,\n Model.isConnection(field as Field),\n undefined,\n newPath,\n name,\n false\n )\n );\n }\n });\n\n return relationQueries.join(\"\\n\");\n }\n\n private static prepareArguments(args?: Arguments): Arguments {\n args = (args ? clone(args) : {}) as Arguments;\n\n Object.keys(args).forEach((key: string) => {\n const value = args![key];\n\n if (value && isPlainObject(value)) {\n if (Context.getInstance().adapter.getArgumentMode() === ArgumentMode.LIST) {\n Object.keys(value).forEach((k: string) => {\n args![k] = value[k];\n });\n delete args![key];\n } else {\n args![key] = { __type: upcaseFirstLetter(key) };\n }\n }\n });\n\n return args;\n }\n}\n","import { Data, DispatchFunction } from \"../support/interfaces\";\nimport Context from \"../common/context\";\n\n/**\n * Provides some helper methods to interact with the Vuex-ORM store\n */\nexport class Store {\n /**\n * Inserts incoming data into the store. Existing data will be updated.\n *\n * @param {Data} data New data to insert/update\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @return {Promise} Inserted data as hash\n */\n public static async insertData(data: Data, dispatch: DispatchFunction): Promise {\n let insertedData: Data = {} as Data;\n\n await Promise.all(\n Object.keys(data).map(async key => {\n const value = data[key];\n Context.getInstance().logger.log(\"Inserting records\", value);\n const newData = await dispatch(\"insertOrUpdate\", ({ data: value } as unknown) as Data);\n\n Object.keys(newData).forEach(dataKey => {\n if (!insertedData[dataKey]) insertedData[dataKey] = [];\n insertedData[dataKey] = insertedData[dataKey].concat(newData[dataKey]);\n });\n })\n );\n\n return insertedData;\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport { Arguments, Data, DispatchFunction } from \"../support/interfaces\";\nimport Model from \"../orm/model\";\nimport RootState from \"@vuex-orm/core/lib/modules/contracts/RootState\";\nimport Transformer from \"../graphql/transformer\";\nimport Schema from \"../graphql/schema\";\nimport { singularize } from \"../support/utils\";\n\n/**\n * Base class for all Vuex actions. Contains some utility and convenience methods.\n */\nexport default class Action {\n /**\n * Sends a mutation.\n *\n * @param {string} name Name of the mutation like 'createUser'\n * @param {Data | undefined} variables Variables to send with the mutation\n * @param {Function} dispatch Vuex Dispatch method for the model\n * @param {Model} model The model this mutation affects.\n * @param {boolean} multiple Tells if we're requesting a single record or multiple.\n * @returns {Promise}\n */\n protected static async mutation(\n name: string,\n variables: Data | undefined,\n dispatch: DispatchFunction,\n model: Model\n ): Promise {\n if (variables) {\n const context: Context = Context.getInstance();\n const schema: Schema = await context.loadSchema();\n\n const multiple: boolean = Schema.returnsConnection(schema.getMutation(name)!);\n const query = QueryBuilder.buildQuery(\"mutation\", model, name, variables, multiple);\n\n // Send GraphQL Mutation\n let newData = await context.apollo.request(model, query, variables, true);\n\n // When this was not a destroy action, we get new data, which we should insert in the store\n if (name !== context.adapter.getNameForDestroy(model)) {\n newData = newData[Object.keys(newData)[0]];\n\n // IDs as String cause terrible issues, so we convert them to integers.\n newData.id = parseInt(newData.id, 10);\n\n const insertedData: Data = await Store.insertData(\n { [model.pluralName]: newData } as Data,\n dispatch\n );\n\n // Try to find the record to return\n const records = insertedData[model.pluralName];\n const newRecord = records[records.length - 1];\n if (newRecord) {\n return newRecord;\n } else {\n Context.getInstance().logger.log(\n \"Couldn't find the record of type '\",\n model.pluralName,\n \"' within\",\n insertedData,\n \". Falling back to find()\"\n );\n return model.baseModel.query().last();\n }\n }\n\n return true;\n }\n }\n\n /**\n * Convenience method to get the model from the state.\n * @param {RootState} state Vuex state\n * @returns {Model}\n */\n static getModelFromState(state: RootState): Model {\n return Context.getInstance().getModel(state.$name);\n }\n\n /**\n * Makes sure args is a hash.\n *\n * @param {Arguments|undefined} args\n * @param {any} id When not undefined, it's added to the args\n * @returns {Arguments}\n */\n static prepareArgs(args?: Arguments, id?: any): Arguments {\n args = args || {};\n if (id) args[\"id\"] = id;\n\n return args;\n }\n\n /**\n * Adds the record itself to the args and sends it through transformOutgoingData. Key is named by the singular name\n * of the model.\n *\n * @param {Arguments} args\n * @param {Model} model\n * @param {Data} data\n * @returns {Arguments}\n */\n static addRecordToArgs(args: Arguments, model: Model, data: Data): Arguments {\n args[model.singularName] = Transformer.transformOutgoingData(model, data, false);\n return args;\n }\n\n /**\n * Transforms each field of the args which contains a model.\n * @param {Arguments} args\n * @returns {Arguments}\n */\n protected static transformArgs(args: Arguments): Arguments {\n const context = Context.getInstance();\n\n Object.keys(args).forEach((key: string) => {\n const value: Data = args[key];\n\n if (value instanceof context.components.Model) {\n const model = context.getModel(singularize(value.$self().entity));\n const transformedValue = Transformer.transformOutgoingData(model, value, false);\n context.logger.log(\n \"A\",\n key,\n \"model was found within the variables and will be transformed from\",\n value,\n \"to\",\n transformedValue\n );\n args[key] = transformedValue;\n }\n });\n\n return args;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Destroy action for sending a delete mutation. Will be used for record.$destroy().\n */\nexport default class Destroy extends Action {\n /**\n * @param {State} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to delete\n * @returns {Promise} true\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForDestroy(model);\n\n const mockReturnValue = model.$mockHook(\"destroy\", { id });\n\n if (mockReturnValue) {\n await Store.insertData(mockReturnValue, dispatch!);\n return true;\n }\n\n args = this.prepareArgs(args, id);\n\n await Action.mutation(mutationName, args as Data, dispatch!, model);\n return true;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The destroy action requires the 'id' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\n\n/**\n * Fetch action for sending a query. Will be used for Model.fetch().\n */\nexport default class Fetch extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {ActionParams} params Optional params to send with the query\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n params?: ActionParams\n ): Promise {\n const context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"fetch\", {\n filter: params ? params.filter || {} : {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n await context.loadSchema();\n\n // Filter\n let filter = {};\n\n if (params && params.filter) {\n filter = Transformer.transformOutgoingData(\n model,\n params.filter as Data,\n true,\n Object.keys(params.filter)\n );\n }\n\n const bypassCache = params && params.bypassCache;\n\n // When the filter contains an id, we query in singular mode\n const multiple: boolean = !filter[\"id\"];\n const name: string = context.adapter.getNameForFetch(model, multiple);\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, multiple);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(model, query, filter, false, bypassCache as boolean);\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n }\n}\n","import { ActionParams, Arguments, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport Schema from \"../graphql/schema\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Mutate action for sending a custom mutation. Will be used for Model.mutate() and record.$mutate().\n */\nexport default class Mutate extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {Arguments} args Arguments for the mutation. Must contain a 'mutation' field.\n * @returns {Promise} The new record if any\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { args, name }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"mutate\", {\n name,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n args = this.prepareArgs(args);\n\n // There could be anything in the args, but we have to be sure that all records are gone through\n // transformOutgoingData()\n this.transformArgs(args);\n\n // Send the mutation\n return Action.mutation(name, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The mutate action requires the mutation name ('mutation') to be set\");\n }\n }\n}\n","import Context from \"../common/context\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Model from \"../orm/model\";\nimport { Store } from \"../orm/store\";\n\n/**\n * Persist action for sending a create mutation. Will be used for record.$persist().\n */\nexport default class Persist extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} id ID of the record to persist\n * @returns {Promise} The saved record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { id, args }: ActionParams\n ): Promise {\n if (id) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPersist(model);\n const oldRecord = model.getRecordWithId(id)!;\n\n const mockReturnValue = model.$mockHook(\"persist\", {\n id,\n args: args || {}\n });\n\n if (mockReturnValue) {\n const newRecord = await Store.insertData(mockReturnValue, dispatch!);\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n return newRecord;\n }\n\n // Arguments\n args = this.prepareArgs(args);\n this.addRecordToArgs(args, model, oldRecord);\n\n // Send mutation\n const newRecord = await Action.mutation(mutationName, args as Data, dispatch!, model);\n\n // Delete the old record if necessary\n await this.deleteObsoleteRecord(model, newRecord, oldRecord);\n\n return newRecord;\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'id' to be set\");\n }\n }\n\n /**\n * It's very likely that the server generated different ID for this record.\n * In this case Action.mutation has inserted a new record instead of updating the existing one.\n *\n * @param {Model} model\n * @param {Data} record\n * @returns {Promise}\n */\n private static async deleteObsoleteRecord(model: Model, newRecord: Data, oldRecord: Data) {\n if (newRecord && oldRecord && newRecord.id !== oldRecord.id) {\n Context.getInstance().logger.log(\"Dropping deprecated record\", oldRecord);\n return oldRecord.$delete();\n }\n\n return null;\n }\n}\n","import { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport { Store } from \"../orm/store\";\nimport Context from \"../common/context\";\n\n/**\n * Push action for sending a update mutation. Will be used for record.$push().\n */\nexport default class Push extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {Arguments} data New data to save\n * @param {Arguments} args Additional arguments\n * @returns {Promise} The updated record\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { data, args }: ActionParams\n ): Promise {\n if (data) {\n const model = this.getModelFromState(state!);\n const mutationName = Context.getInstance().adapter.getNameForPush(model);\n\n const mockReturnValue = model.$mockHook(\"push\", {\n data,\n args: args || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n // Arguments\n args = this.prepareArgs(args, data.id);\n this.addRecordToArgs(args, model, data);\n\n // Send the mutation\n return Action.mutation(mutationName, args as Data, dispatch!, model);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The persist action requires the 'data' to be set\");\n }\n }\n}\n","import QueryBuilder from \"../graphql/query-builder\";\nimport Context from \"../common/context\";\nimport { Store } from \"../orm/store\";\nimport Transformer from \"../graphql/transformer\";\nimport { ActionParams, Data } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Schema from \"../graphql/schema\";\n\n/**\n * Query action for sending a custom query. Will be used for Model.customQuery() and record.$customQuery.\n */\nexport default class Query extends Action {\n /**\n * @param {any} state The Vuex state\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} name Name of the query\n * @param {boolean} multiple Fetch one or multiple?\n * @param {object} filter Filter object (arguments)\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The fetched records as hash\n */\n public static async call(\n { state, dispatch }: ActionParams,\n { name, filter, bypassCache }: ActionParams\n ): Promise {\n if (name) {\n const context: Context = Context.getInstance();\n const model = this.getModelFromState(state!);\n\n const mockReturnValue = model.$mockHook(\"query\", {\n name,\n filter: filter || {}\n });\n\n if (mockReturnValue) {\n return Store.insertData(mockReturnValue, dispatch!);\n }\n\n const schema: Schema = await context.loadSchema();\n\n // Filter\n filter = filter ? Transformer.transformOutgoingData(model, filter as Data, true) : {};\n\n // Multiple?\n const multiple: boolean = Schema.returnsConnection(schema.getQuery(name)!);\n\n // Build query\n const query = QueryBuilder.buildQuery(\"query\", model, name, filter, multiple, false);\n\n // Send the request to the GraphQL API\n const data = await context.apollo.request(\n model,\n query,\n filter,\n false,\n bypassCache as boolean\n );\n\n // Insert incoming data into the store\n return Store.insertData(data, dispatch!);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The customQuery action requires the query name ('name') to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery, removeSymbols } from \"../support/utils\";\n\n/**\n * SimpleQuery action for sending a model unrelated simple query.\n */\nexport default class SimpleQuery extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @param {boolean} bypassCache Whether to bypass the cache\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, bypassCache, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleQuery\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n\n const result = await context.apollo.simpleQuery(\n graphQlDocumentToString(parsedQuery),\n variables,\n bypassCache\n );\n\n // remove the symbols\n return removeSymbols(clone(result.data));\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleQuery action requires the 'query' to be set\");\n }\n }\n}\n","import { ActionParams } from \"../support/interfaces\";\nimport Action from \"./action\";\nimport Context from \"../common/context\";\nimport { clone, graphQlDocumentToString, parseQuery } from \"../support/utils\";\n\n/**\n * SimpleMutation action for sending a model unrelated simple mutation.\n */\nexport default class SimpleMutation extends Action {\n /**\n * @param {DispatchFunction} dispatch Vuex Dispatch method for the model\n * @param {string} query The query to send\n * @param {Arguments} variables\n * @returns {Promise} The result\n */\n public static async call(\n { dispatch }: ActionParams,\n { query, variables }: ActionParams\n ): Promise {\n const context: Context = Context.getInstance();\n\n if (query) {\n const parsedQuery = parseQuery(query);\n\n const mockReturnValue = context.globalMockHook(\"simpleMutation\", {\n name: parsedQuery.definitions[0][\"name\"].value,\n variables\n });\n\n if (mockReturnValue) {\n return mockReturnValue;\n }\n\n variables = this.prepareArgs(variables);\n const result = await context.apollo.simpleMutation(\n graphQlDocumentToString(parsedQuery),\n variables\n );\n\n // remove the symbols\n return clone(result.data);\n } else {\n /* istanbul ignore next */\n throw new Error(\"The simpleMutation action requires the 'query' to be set\");\n }\n }\n}\n","import { PatchedModel, Options, ActionParams } from \"./support/interfaces\";\nimport Context from \"./common/context\";\nimport { Components } from \"@vuex-orm/core/lib/plugins/use\";\nimport { Destroy, Fetch, Mutate, Persist, Push } from \"./actions\";\nimport Query from \"./actions/query\";\nimport SimpleQuery from \"./actions/simple-query\";\nimport SimpleMutation from \"./actions/simple-mutation\";\nimport { isPlainObject } from \"./support/utils\";\n\n/**\n * Main class of the plugin. Setups the internal context, Vuex actions and model methods\n */\nexport default class VuexORMGraphQL {\n /**\n * @constructor\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n */\n public constructor(components: Components, options: Options) {\n Context.setup(components, options);\n VuexORMGraphQL.setupActions();\n VuexORMGraphQL.setupModelMethods();\n }\n\n /**\n * Allow everything to read the context.\n */\n public getContext(): Context {\n return Context.getInstance();\n }\n\n /**\n * This method will setup following Vuex actions: fetch, persist, push, destroy, mutate\n */\n private static setupActions() {\n const context = Context.getInstance();\n\n context.components.RootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);\n context.components.RootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);\n\n context.components.Actions.fetch = Fetch.call.bind(Fetch);\n context.components.Actions.persist = Persist.call.bind(Persist);\n context.components.Actions.push = Push.call.bind(Push);\n context.components.Actions.destroy = Destroy.call.bind(Destroy);\n context.components.Actions.mutate = Mutate.call.bind(Mutate);\n context.components.Actions.query = Query.call.bind(Query);\n }\n\n /**\n * This method will setup following model methods: Model.fetch, Model.mutate, Model.customQuery, record.$mutate,\n * record.$persist, record.$push, record.$destroy and record.$deleteAndDestroy, record.$customQuery\n */\n private static setupModelMethods() {\n const context = Context.getInstance();\n\n // Register static model convenience methods\n (context.components.Model as typeof PatchedModel).fetch = async function(\n filter: any,\n bypassCache = false\n ) {\n let filterObj = filter;\n if (!isPlainObject(filterObj)) {\n filterObj = { id: filter };\n }\n return this.dispatch(\"fetch\", { filter: filterObj, bypassCache });\n };\n\n (context.components.Model as typeof PatchedModel).mutate = async function(\n params: ActionParams\n ) {\n return this.dispatch(\"mutate\", params);\n };\n\n (context.components.Model as typeof PatchedModel).customQuery = async function({\n name,\n filter,\n multiple,\n bypassCache\n }: ActionParams) {\n return this.dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n // Register model convenience methods\n const model: PatchedModel = context.components.Model.prototype as PatchedModel;\n\n model.$mutate = async function({ name, args, multiple }: ActionParams) {\n args = args || {};\n if (!args[\"id\"]) args[\"id\"] = this.$id;\n return this.$dispatch(\"mutate\", { name, args, multiple });\n };\n\n model.$customQuery = async function({ name, filter, multiple, bypassCache }: ActionParams) {\n filter = filter || {};\n if (!filter[\"id\"]) filter[\"id\"] = this.$id;\n return this.$dispatch(\"query\", { name, filter, multiple, bypassCache });\n };\n\n model.$persist = async function(args: any) {\n return this.$dispatch(\"persist\", { id: this.$id, args });\n };\n\n model.$push = async function(args: any) {\n return this.$dispatch(\"push\", { data: this, args });\n };\n\n model.$destroy = async function() {\n return this.$dispatch(\"destroy\", { id: this.$id });\n };\n\n model.$deleteAndDestroy = async function() {\n await this.$delete();\n return this.$destroy();\n };\n }\n}\n","import VuexORMGraphQL from './vuex-orm-graphql';\nimport { Components, Plugin } from '@vuex-orm/core/lib/plugins/use';\nimport { Options } from './support/interfaces';\n\n/**\n * Plugin class. This just provides a static install method for Vuex-ORM and stores the instance of the model\n * within this.instance.\n */\nexport default class VuexORMGraphQLPlugin implements Plugin {\n /**\n * Contains the instance of VuexORMGraphQL\n */\n public static instance: VuexORMGraphQL;\n\n /**\n * This is called, when VuexORM.install(VuexOrmGraphQL, options) is called.\n *\n * @param {Components} components The Vuex-ORM Components collection\n * @param {Options} options The options passed to VuexORM.install\n * @returns {VuexORMGraphQL}\n */\n public static install (components: Components, options: Options): VuexORMGraphQL {\n VuexORMGraphQLPlugin.instance = new VuexORMGraphQL(components, options);\n return VuexORMGraphQLPlugin.instance;\n }\n}\n","import { Model as ORMModel } from \"@vuex-orm/core\";\nimport Context from \"./common/context\";\nimport Model from \"./orm/model\";\nimport VuexORMGraphQLPlugin from \"./index\";\n\nlet context: Context | null = null;\n\nexport function setupTestUtils(plugin: typeof VuexORMGraphQLPlugin): void {\n /* istanbul ignore next */\n if (!plugin.instance) {\n throw new Error(\"Please call this function after setting up the store!\");\n }\n\n context = plugin.instance.getContext();\n}\n\nexport interface MockOptions {\n [key: string]: any;\n}\n\ntype ReturnObject = { [key: string]: any };\n\nexport type ReturnValue =\n | (() => ReturnObject | Array)\n | ReturnObject\n | Array;\n\nexport class Mock {\n public readonly action: string;\n public readonly options?: MockOptions;\n public modelClass?: typeof ORMModel;\n public returnValue?: ReturnValue;\n\n constructor(action: string, options?: MockOptions) {\n this.action = action;\n this.options = options;\n }\n\n public for(modelClass: typeof ORMModel): Mock {\n this.modelClass = modelClass;\n return this;\n }\n\n public andReturn(returnValue: ReturnValue): Mock {\n this.returnValue = returnValue;\n this.installMock();\n return this;\n }\n\n private installMock(): void {\n if (this.action === \"simpleQuery\" || this.action === \"simpleMutation\") {\n context!.addGlobalMock(this);\n } else {\n const model: Model = context!.getModel(this.modelClass!.entity);\n model.$addMock(this);\n }\n }\n}\n\nexport async function clearORMStore() {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n await context.database.store.dispatch(\"entities/deleteAll\");\n}\n\nexport function mock(action: string, options?: MockOptions): Mock {\n /* istanbul ignore next */\n if (!context) {\n throw new Error(\"Please call setupTestUtils() before!\");\n }\n\n return new Mock(action, options);\n}\n"],"names":["Object","defineProperty","exports","value","condition","message","Error","undefined","obj","_invariant2","_invariant","__esModule","default","Source","body","name","locationOffset","instance","Constructor","TypeError","_classCallCheck","this","line","column","source","position","lineRegexp","match","exec","index","length","highlightSourceAtLocation","location","lineOffset","columnOffset","getColumnOffset","contextLine","contextColumn","prevLineNum","toString","lineNum","nextLineNum","padLen","lines","split","whitespace","lpad","filter","Boolean","join","len","Array","str","error","printedLocations","nodes","forEach","node","loc","push","_location","getLocation","start","locations","concat","GraphQLError","positions","path","originalError","extensions","_nodes","isArray","_source","_positions","reduce","list","_locations","providedSource","map","pos","defineProperties","enumerable","writable","stack","configurable","captureStackTrace","prototype","create","constructor","_printError","printError","description","_GraphQLError","_extends","assign","target","i","arguments","key","hasOwnProperty","call","get","_syntaxError","syntaxError","_locatedError","locatedError","_formatError","formatError","leadingWhitespace","isBlank","rawString","commonIndent","indent","_i","slice","shift","pop","options","startOfFileToken","Tok","SOF","lastToken","token","lineStart","advance","advanceLexer","lookahead","kind","_blockStringValue2","_blockStringValue","EOF","next","readToken","COMMENT","BANG","DOLLAR","PAREN_L","PAREN_R","SPREAD","COLON","EQUALS","AT","BRACKET_L","BRACKET_R","BRACE_L","PIPE","BRACE_R","NAME","INT","FLOAT","STRING","BLOCK_STRING","charCodeAt","String","end","prev","printCharCode","code","isNaN","JSON","stringify","fromCharCode","toUpperCase","lexer","bodyLength","startPosition","positionAfterWhitespace","col","_error","readComment","readName","firstCode","isFloat","readDigits","readNumber","chunkStart","rawValue","readBlockString","charCode","a","b","c","d","char2hex","readString","unexpectedCharacterMessage","toJSON","inspect","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","parseName","expect","_lexer","TokenKind","_kinds","parseDefinition","peek","parseExecutableDefinition","parseTypeSystemDefinition","peekDescription","unexpected","parseOperationDefinition","expectKeyword","experimentalFragmentVariables","parseFragmentName","variableDefinitions","parseVariableDefinitions","typeCondition","parseNamedType","directives","parseDirectives","selectionSet","parseSelectionSet","parseFragmentDefinition","OPERATION_DEFINITION","operation","parseOperationType","operationToken","many","parseVariableDefinition","VARIABLE_DEFINITION","variable","parseVariable","type","parseTypeReference","defaultValue","skip","parseValueLiteral","VARIABLE","SELECTION_SET","selections","parseSelection","parseFragment","nameOrAlias","alias","parseArguments","parseField","isConst","item","parseConstArgument","parseArgument","ARGUMENT","parseConstValue","parseValueValue","LIST","values","openKind","parseFn","closeKind","any","parseList","fields","parseObjectField","parseObject","parseStringLiteral","BOOLEAN","NULL","block","OBJECT_FIELD","parseDirective","DIRECTIVE","LIST_TYPE","NON_NULL_TYPE","NAMED_TYPE","keywordToken","operationTypes","parseOperationTypeDefinition","SCHEMA_DEFINITION","parseSchemaDefinition","parseDescription","SCALAR_TYPE_DEFINITION","parseScalarTypeDefinition","interfaces","parseImplementsInterfaces","parseFieldsDefinition","OBJECT_TYPE_DEFINITION","parseObjectTypeDefinition","INTERFACE_TYPE_DEFINITION","parseInterfaceTypeDefinition","types","parseMemberTypesDefinition","UNION_TYPE_DEFINITION","parseUnionTypeDefinition","parseEnumValuesDefinition","ENUM_TYPE_DEFINITION","parseEnumTypeDefinition","parseInputFieldsDefinition","INPUT_OBJECT_TYPE_DEFINITION","parseInputObjectTypeDefinition","SCALAR_TYPE_EXTENSION","parseScalarTypeExtension","OBJECT_TYPE_EXTENSION","parseObjectTypeExtension","INTERFACE_TYPE_EXTENSION","parseInterfaceTypeExtension","UNION_TYPE_EXTENSION","parseUnionTypeExtension","ENUM_TYPE_EXTENSION","parseEnumTypeExtension","INPUT_OBJECT_TYPE_EXTENSION","parseInputObjectTypeExtension","parseTypeExtension","args","parseArgumentDefs","parseDirectiveLocation","parseDirectiveLocations","DIRECTIVE_DEFINITION","parseDirectiveDefinition","OPERATION_TYPE_DEFINITION","parseFieldDefinition","parseInputValueDef","INPUT_VALUE_DEFINITION","parseEnumValueDefinition","ENUM_VALUE_DEFINITION","_directiveLocation","DirectiveLocation","startToken","noLocation","Loc","endToken","getTokenDesc","atToken","sourceObj","definitions","DOCUMENT","parseDocument","createLexer","root","visitor","visitorKeys","QueryDocumentKeys","inArray","keys","edits","parent","ancestors","newRoot","isLeaving","isEdited","clone","k","editOffset","ii","editKey","editValue","splice","result","isNode","visitFn","getVisitFn","BREAK","visitors","skipping","enter","fn","apply","leave","typeInfo","Name","Document","OperationDefinition","VariableDefinition","Variable","SelectionSet","Field","Argument","FragmentSpread","InlineFragment","FragmentDefinition","IntValue","FloatValue","StringValue","BooleanValue","NullValue","EnumValue","ListValue","ObjectValue","ObjectField","Directive","NamedType","ListType","NonNullType","SchemaDefinition","OperationTypeDefinition","ScalarTypeDefinition","ObjectTypeDefinition","FieldDefinition","InputValueDefinition","InterfaceTypeDefinition","UnionTypeDefinition","EnumTypeDefinition","EnumValueDefinition","InputObjectTypeDefinition","ScalarTypeExtension","ObjectTypeExtension","InterfaceTypeExtension","UnionTypeExtension","EnumTypeExtension","InputObjectTypeExtension","DirectiveDefinition","maybeNode","kindVisitor","kindSpecificVisitor","specificVisitor","specificKindVisitor","ast","_visitor","visit","printDocASTReducer","op","varDefs","wrap","_ref","_ref2","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","isDescription","indexOf","replace","printBlockString","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","_ref18","_ref19","_ref20","_ref21","_ref22","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","_ref30","_ref31","_ref32","_ref33","_ref34","_ref35","_ref36","_ref37","maybeArray","separator","x","array","maybeString","LARGE_ARRAY_SIZE","HASH_UNDEFINED","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","MAX_SAFE_INTEGER","argsTag","arrayTag","asyncTag","boolTag","dateTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","arrayBufferTag","dataViewTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","freeSelf","self","Function","freeExports","nodeType","freeModule","module","moduleExports","freeProcess","process","nodeUtil","binding","e","nodeIsTypedArray","isTypedArray","arraySome","predicate","mapToArray","size","setToArray","set","uid","func","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","IE_PROTO","nativeObjectToString","reIsNative","RegExp","Buffer","Symbol","Uint8Array","propertyIsEnumerable","symToStringTag","toStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","arg","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","SetCache","__data__","add","Stack","data","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","n","iteratee","baseTimes","isIndex","assocIndexOf","eq","baseGetTag","isOwn","tag","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","object","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","byteLength","byteOffset","buffer","convert","isPartial","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isObject","isFunction","test","baseKeys","Ctor","proto","arrLength","seen","arrValue","othIndex","has","keysFunc","symbolsFunc","offset","arrayPush","baseGetAllKeys","getSymbols","getMapData","getValue","hash","string","pairs","resIndex","arrayFilter","symbol","ArrayBuffer","resolve","ctorString","isLength","baseUnary","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","cloneableTags","addMapEntry","pair","addSetEntry","arrayReduce","accumulator","initAccum","isHostObject","overArg","getPrototype","getPrototypeOf","objectCreate","isArrayLike","isArrayLikeObject","assignValue","baseClone","isDeep","isFull","input","initCloneArray","copyArray","isFunc","copy","cloneBuffer","isPrototype","initCloneObject","copyObject","copySymbols","baseAssign","cloneFunc","cloneArrayBuffer","dataView","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneSet","initCloneByTag","props","arrayEach","subValue","arrayBuffer","newValue","cache","pluralize","pluralRules","singularRules","uncountables","irregularPlurals","irregularSingles","sanitizeRule","rule","restoreCase","word","charAt","substr","toLowerCase","sanitizeWord","rules","replaceWord","replaceMap","keepMap","checkWord","bool","count","inclusive","pluralized","singular","plural","isPlural","isSingular","addPluralRule","replacement","addSingularRule","addUncountableRule","addIrregularRule","single","pluralizeLib","singularize","upcaseFirstLetter","downcaseFirstLetter","prettify","query","print","parseQuery","parse","graphQlDocumentToString","isPlainObject","pick","prop","isEqual","lodashIsEqual","lodashClone","enabled","log","console","groupCollapsed","PREFIX","messages","groupEnd","warn","variables","fetchPolicy","prettified","group","trim","baseModel","singularName","entity","pluralName","field","context","Context","getInstance","components","Number","Increment","Attr","BelongsTo","HasOne","MorphTo","MorphOne","model","originalFieldGenerator","bind","originalFields","boolean","relation","BelongsToMany","HasMany","HasManyThrough","MorphedByMany","MorphMany","MorphToMany","getModel","related","HasManyBy","Model","isFieldAttribute","_this","skipField","startsWith","skipFields","shouldSkipField","getRelations","foreignKey","relations","found","models","id","withAllRecursive","where","first","fieldName","relatedModel","eagerLoadList","eagerLoad","eagerSync","find","eagerSaveList","eagerSave","mock","$findMock","action","mocks","m","returnValue","r","$isPersisted","opts","cmp","f","cycles","aobj","bobj","isFinite","out","seenIndex","sort","getDirectiveNames","doc","definition","flattenSelections","selection","selectionNode","selected","directive","sources","checkDocument","operations","getOperationDefinition","getOperationName","getQueryDefinition","queryDef","getDefaultValues","defaultValues","_a","defaultValueObj","valueToObjectRepresentation","argObj","isIntValue","isFloatValue","isBooleanValue","isStringValue","isObjectValue","nestedArgObj_1","isVariable","variableValue","isListValue","listValue","nestedArgArrayObj","isEnumValue","isNullValue","cloneDeep","cloneDeepHelper","val","copy_1","child","copy_2","removeDirectivesFromDocument","docClone","removeDirectivesFromSelectionSet","agressiveRemove","some","dir","remove","directiveMatcher","getDirectiveMatcher","shouldKeep","isNotEmpty","fragments","document","def","getOperationDefinitionOrDie","symTable","fragment","createFragmentMap","getFragmentDefinitions","NetworkStatus","connectionRemoveConfig","willRemove","isEnv","env","NODE_ENV","isProduction","tryFunctionOrLogError","graphQLResultHasError","errors","Date","getTime","isNetworkRequestInFlight","networkStatus","_createClass","descriptor","protoProps","staticProps","hasSymbols","hasSymbol","getSymbol","observable","SymbolIterator","SymbolObservable","SymbolSpecies","getMethod","getSpecies","ctor","Observable","isObservable","hostReportError","setTimeout","enqueue","then","cleanupSubscription","subscription","cleanup","_cleanup","unsubscribe","closeSubscription","_observer","_queue","_state","notifySubscription","observer","onNotify","queue","flushSubscription","Subscription","subscriber","subscriptionObserver","SubscriptionObserver","_subscription","_subscriber","complete","reject","subscribe","done","_this2","_this3","_this4","C","hasSeed","hasValue","acc","_this5","_len","_key","startNext","v","from","_this6","subscriptions","outer","inner","completeIfDone","closed","s","method","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","err","return","_len2","items","_key2","require$$0","link","_super","__extends","isTerminating","request","fromError","errorValue","createOperation","starting","operationName","getKey","passthrough","forward","of","toLink","handler","ApolloLink","empty","links","y","left","right","leftLink","rightLink","second","firstLink","LinkError","nextLink","execute","transformedOperation","transformOperation","OPERATION_FIELDS","validateOperation","ponyfill","window","$$observable","LinkObservable","FetchType","generateErrorMessage","graphQLErrors","graphQLError","errorMessage","networkError","extraInfo","__proto__","ApolloError","scheduler","_b","shouldSubscribe","onSubscribe","isCurrentlyPolling","isTornDown","queryId","queryManager","generateQueryId","observers","subscriptionHandles","ObservableQuery","that","obs","removeQuery","lastError","lastResult","loading","storeValue","policy","queryStoreValue","queryStore","errorPolicy","partial","queryLoading","ready","stale","lastResultSnapshot","__assign","newResult","snapshot","isNetworkFetchPolicy","combinedOptions","fetchQuery","refetch","fetchMoreOptions","updateQuery","qid","normal","fetchMoreResult","previousResult","startGraphQLSubscription","subscriptionData","previous","onError","oldOptions","pollInterval","startPolling","stopPolling","tryFetch","setVariables","fetchResults","newVariables","mapFn","dataStore","markUpdateQueryResult","broadcastQueries","stopPollingQuery","startPollingQuery","setUpQuery","tearDownQuery","addObservableQuery","startQuery","queryListenerForObserver","sub","removeObservableQuery","stopQuery","DedupLink","getContext","forceFetch","toKey","operationKey","inFlightRequestObservables","delete","subscribers","subscription_1","singleObserver_1","sharedObserver","ssrMode","QueryScheduler","fetchType","catch","listener","registeredQueries","addQueryListener","addQueryOnInterval","interval","intervalQueries","checkInFlight","queryOptions","pollingOptions","poll","clearInterval","pollingTimers","setInterval","fetchQueriesOnInterval","MutationStore","store","mutationId","mutationString","mutation","QueryStore","previousQuery","isSetVariables","previousVariables","storePreviousVariables","isPoll","isRefetch","metadata","fetchMoreForQueryId","fetchMore","markQueryResultClient","observableQueryIds","res","queryDeduplication","_c","onBroadcast","_d","deduplicator","Deduplicator","QueryManager","optimisticResponse","updateQueriesByName","refetchQueries","awaitRefetchQueries","updateWithProxyFn","_e","getCache","transformDocument","mutationDef","getMutationDefinition","setQuery","generateUpdateQueriesInfo","ret","queryName","queryIdsByName","updater","mutationStore","initMutation","markMutationInit","updateQueries","update","storeResult","buildOperationForLink","markMutationResult","markMutationError","markMutationComplete","refetchQueryPromises","refetchQueries_1","refetchQuery","promise","refetchQueryByName","all","needToFetch","names","shouldFetch","requestId","generateRequestId","cancel","updateQueryWatch","lastRequestId","invalidated","invalidate","initQuery","networkResult","fetchRequest","markQueryError","removeFetchQueryPromise","previouslyHadError","newData","observableQuery","getLastResult","getLastError","shouldNotifyIfLoading","networkStatusChanged","errorStatusChanged","notifyOnNetworkStatusChange","apolloError_1","info","isMissing","document_1","readResult","diff","optimistic","resultFromStore","isDifferentFromLastResult","queryDefinition","transformedOptions","returnPartialData","idCounter","addFetchQueryPromise","watchQuery","listeners","watch","callback","fetchQueryPromises","resetIds","queries","reset","clearStore","reFetchObservableQueries","includeStandby","observableQueryPromises","getObservableQueryPromises","isCacheEnabled","transformedDoc","markSubscriptionResult","stopQueryInStore","read","queryIdOrObservable","foundObserveableQuery","resetLastResults","errorsFromStore","markQueryResult","refetchedQueries","getQuery","newInfo","extraContext","transformForLink","getCacheKey","config","dataIdFromObject","initialCache","DataStore","ignoreErrors","writeWithErrors","write","dataId","optimistic_1","recordOptimisticTransaction","orig","cacheWrites_1","currentQueryResult","nextQueryResult","mutationResult","queryVariables","performTransaction","update_1","removeOptimistic","hasSuggestedDevtools","ssrForceFetchDelay","connectToDevTools","defaultOptions","supportedCache","supportedDirectives","disableNetworkFetches","mutate","resetStore","defaultConnectToDevTools","__APOLLO_CLIENT__","top","__APOLLO_DEVTOOLS_GLOBAL_HOOK__","navigator","userAgent","debug","version","ApolloClient","initQueryManager","initProxy","readQuery","readFragment","writeQuery","writeFragment","writeData","cb","devToolsHookCb","payload","state","getStore","mutations","dataWithOptimisticResults","extract","resetStoreCallbacks","serializedState","restore","proxy","genericMessage","setPrototypeOf","InvariantError","framesToPop","invariant","KNOWN_DIRECTIVES","getStoreKeyName","filterKeys","queryArgs_1","filteredArgs_1","completeFieldName","stringifiedArgs","argumentsObjectFromField","argObj_1","resultKeyNameFromField","isField","isInlineFragment","isIdValue","idObject","generated","toIdValue","idConfig","typename","shouldInclude","directiveArguments","directiveName","ifArgument","ifValue","evaledValue","getFragmentQueryDocument","fragmentName","actualFragmentName","TYPENAME_FIELD","mergeHelper","pastCopies","isExtensible","shallowCopyForMerge","sourceKey","sourceValue","targetValue","selectionSetFromObj","justTypenameQuery","ApolloCache","rootId","typenameResult","__typename","dataToWrite","queryFromPojo","Cache","newest","oldest","max","dispose","Cp","getEntry","older","newer","clean","useSymbol","for","brand","globalKey","freeze","isObjRef","UniversalWeakMap","_weakMap","_strongMap","_getMap","canCreate","lookup","lookupArray","tuple","arguments$1","t","argc","isTuple","toArray","mustConvertThisToArray","desc","getOwnPropertyDescriptor","forEachArrayMethod","fakeNullFiber","getCurrentFiber","Fiber","reverse","current","fiber","getLocal","UNKNOWN_VALUE","emptySetPool","entryPool","assert","optionalMessage","Entry","parents","childValues","dirtyChildren","dirty","recomputing","reportOrphan","acquire","Ep","maybeReportOrphan","report","reportDirty","reportDirtyChild","reportClean","reportCleanChild","mightBeDirty","cv","childValue","setDirty","removeDirtyChild","dc","POOL_TARGET_SIZE","reallyRecompute","originalChildren","forgetChildren","local","currentParentEntry","threw","setClean","recompute","rememberParent","recomputeIfDirty","forgetChild","release","reusableEmptyArray","children","unsub","require$$1","require$$2","require$$3","disposable","makeCacheKey","Math","pow","normalizeOptions","testMap","set_1","testSet","add_1","frozen","seal","preventExtensions","haveWarned","shouldWarn","answer","HeuristicFragmentMatcher","idValue","CacheKeyNode","getOrCreate","hasOwn","depend","DepTrackingCache","defaultNormalizedCacheFactory","seed","cacheKeyRoot","reader","executeStoreQuery","executeSelectionSet","rootValue","contextValue","variableValues","fragmentMatcher","execContext","StoreReader","diffQueryAgainstStore","fragmentMatcherFunction","cacheRedirects","execResult","hasMissingFields","missing","tolerable","mainDefinition","queryDoc","fragmentDefinition","getMainDefinition","fragmentMap","finalResult","objectsToMerge","handleMissing","fieldResult","executeField","fragmentExecResult","mergeDeepArray","readStoreResult","storeKeyName","fieldValue","resolver","storeObj","jsonObject","json","readStoreResolver","resultKey","directiveObj_1","getDirectiveInfoFromField","combineExecResults","executeSubSelectedArray","assertSelectionSetForIdValue","execResults","childResult","defaultFragmentMatcher","ObjectCache","tslib_1.__extends","StoreWriter","writeResultToStore","operationDefinition","writeSelectionSetToStore","processedData","enhancedError","WriteError","enhanceErrorWithDocument","resultFieldKey","writeFieldToStore","isDefered","isClient","matches","fakeContext","storeObject","storeFieldName","directivesObj","storeKeyNameFromField","generatedId","processArrayValue","valueDataId","isGeneratedId","semanticId","isDataProcessed","escapedId","hadTypename","hasTypename","typenameChanged","mergeWithGenerated","generatedKey","realKey","real","madeChanges","realValue","newRealValue","itemDataId","defaultConfig","_id","addTypename","resultCaching","optimisticId","transaction","OptimisticCacheLayer","toObject","customResolvers","cacheResolvers","optimisticData","storeReader","storeWriter","maybeBroadcastWatch","InMemoryCache","readQueryFromStore","broadcastWatches","watches","idToRemove","toReapply","removedCount","layer","layer_1","silenceBroadcast","typenameDocumentCache","lastIndexOf","fallbackHttpConfig","http","includeQuery","includeExtensions","headers","accept","content-type","throwServerError","response","statusCode","status","serializeFetchParameter","p","label","serialized","parseError","createHttpLink","linkOptions","uri","fetcher","useGETForQueries","requestOptions","fetch","library","checkFetcher","linkConfig","fetchOptions","credentials","controller","chosenURI","fallbackURI","contextURI","selectURI","contextConfig","fallbackConfig","configs","signal","AbortController","_controller","queryParams","addQueryParam","encodeURIComponent","serializedVariables","serializedExtensions","preFragment","fragmentStart","queryParamsPrefix","newURI","setContext","text","bodyText","abort","ConnectionMode","ArgumentMode","whitelist","outgoingRecords","recursiveCall","isRelation","isRecursion","shouldIncludeOutgoingField","getRelatedModel","arrayModel_1","addRecordForRecursionDetection","transformOutgoingData","$id","$self","logger","transformIncomingData","localModel","connectionMode","NODES","edges","EDGES","newKey","isFieldNumber","parseFloat","endsWith","isTypeFieldOfPolymorphicRelation","forFilter","includes","shouldEagerSaveRelation","records","record","ids","parser","normalize","docCache","fragmentSourceMap","printFragmentWarnings","cacheKey","parsed","stripLoc","removeLocAtThisLevel","docType","valueType","astFragmentMap","substring","processFragments","gql","literals","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","apolloClient","httpLink","HttpLink","url","debugMode","bypassCache","logQuery","Apollo","getHeaders","Transformer","schema","getType","adapter","getRootQueryName","getRootMutationName","connection","typeName","Schema","getTypeNameOfField","PLAIN","allowNull","prepareSchemaTypeName","getRealType","ofType","TYPE","AUTO","database","Logger","DefaultAdapter","apollo","collectModels","schemaWillBeLoaded","getConnectionMode","X-GraphQL-Introspection-Query","simpleQuery","__schema","processSchema","determineQueryMode","name_1","findGlobalMock","globalMocks","entities","augment","multiple","allowIdFields","getMutation","params","buildArguments","getQueryFields","buildRelationsQuery","header","prepareArguments","buildField","signature","isForeignKey","skipFieldDueId","schemaField","findSchemaFieldForArgument","isConnectionField","typeOrValue","__type","getInputTypeName","QueryBuilder","determineAttributeType","isFilter","getFilterTypeName","inputFields","relationQueries","referencesItSelf","takeWhile","ignore","shouldEagerLoadRelation","newPath","isConnection","getArgumentMode","dispatch","dataKey","insertedData","loadSchema","returnsConnection","buildQuery","getNameForDestroy","parseInt","Store","insertData","newRecord","last","$name","transformedValue","getModelFromState","$mockHook","mockReturnValue","prepareArgs","Action","mutationName","getNameForFetch","transformArgs","getNameForPersist","getRecordWithId","deleteObsoleteRecord","newRecord_1","oldRecord","addRecordToArgs","$delete","getNameForPush","globalMockHook","parsedQuery","simpleMutation","setup","setupActions","setupModelMethods","RootActions","SimpleQuery","SimpleMutation","Actions","Fetch","persist","Persist","Push","destroy","Destroy","Mutate","Query","filterObj","customQuery","$mutate","$dispatch","$customQuery","$persist","$push","$destroy","$deleteAndDestroy","VuexORMGraphQL","VuexORMGraphQLPlugin","modelClass","installMock","addGlobalMock","$addMock","plugin","Mock"],"mappings":"+zEAEAA,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,UAUA,SAAmBE,EAAWC,GAE5B,IAAKD,EACH,MAAM,IAAIE,MAAMD,iCChBpBL,OAAOC,eAAeC,EAAS,cAC7BC,OAAO,IAETD,cAAiBK,EAIjB,IAEgCC,EAF5BC,GAE4BD,EAFSE,IAEYF,EAAIG,WAAaH,GAAQI,QAASJ,GAmB1EN,SAAiB,SAASW,EAAOC,EAAMC,EAAMC,IAjB1D,SAAyBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAkB9GC,CAAgBC,KAAMR,GAEtBQ,KAAKP,KAAOA,EACZO,KAAKN,KAAOA,GAAQ,kBACpBM,K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SACjC,2BAA4B,SAC5B,iBAAkB,UAClB,wHAAyH,QACzH,qGAAsG,QACtG,QAAS,QACT,2CAA4C,YAC5C,oBAAqB,UACrB,uBAAwB,UACxB,oBAAqB,SACrB,gDAAiD,WACjD,sBAAuB,UACvB,sBAAuB,WACvB,oBAAqB,UACrB,SAAU,OACV,WAAY,QACZ,OAAQ,QACTlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU2B,cAAcpB,EAAK,GAAIA,EAAK,QAO5C,MAAO,KACP,SAAU,OACV,gEAAiE,SACjE,kCAAmC,QACnC,QAAS,MACT,uFAAwF,SACxF,oBAAqB,SACrB,aAAc,WACd,sBAAuB,OACvB,iFAAkF,OAClF,qEAAsE,UACtE,iCAAkC,OAClC,oBAAqB,SACrB,kGAAmG,SACnG,yGAA0G,SAC1G,8FAA+F,SAC/F,0BAA2B,QAC3B,+BAAgC,SAChC,sBAAuB,SACvB,oBAAqB,WACrB,eAAgB,OAChB,YAAa,OACb,QAAS,QACVlqB,QAAQ,SAAUkqB,GAClB,OAAOP,EAAU6B,gBAAgBtB,EAAK,GAAIA,EAAK,OAQ/C,YACA,SACA,SACA,MACA,UACA,OACA,QACA,YACA,QACA,QACA,QACA,QACA,UACA,SACA,OACA,OACA,UACA,QACA,WACA,MACA,WACA,cACA,QACA,SACA,WACA,YACA,MACA,SACA,YACA,YACA,YACA,WACA,MACA,UACA,UACA,WACA,eACA,SACA,SACA,YACA,WACA,YACA,cACA,QACA,UACA,QACA,SACA,aACA,YACA,WACA,OACA,QACA,OACA,QACA,QACA,QACA,OACA,OACA,WACA,SACA,YACA,WACA,OACA,WACA,OACA,SACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,QACA,SACA,UACA,gBACA,QACA,OACA,SACA,UACA,UACA,aACA,WACA,MAEA,gBACA,SACA,SACA,YACA,WACA,QACA,WACAlqB,QAAQ2pB,EAAU8B,oBAEb9B,GAleLrN,UAAiBqN,kNCMRA,EAAYiC,EAAaT,OACzBU,EAAcD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AAav+B,GAAIvyB,KAAKwmD,IAAK/zC,iBAG7Cw+C,MAAQ,SAAex+C,6EACpBzS,KAAK8wD,UAAU,QAAUnuC,KAAM3iB,KAAMyS,iBAGxCy+C,SAAW,qFACRlxD,KAAK8wD,UAAU,WAAav+B,GAAIvyB,KAAKwmD,cAGxC2K,kBAAoB,4GAClBnxD,KAAKuvD,qCACJvvD,KAAKkxD,qEC1FhB,SAAuB9gC,EAAwBpqB,YACxBpG,SAAW,IAAIwxD,GAAehhC,EAAYpqB,GACxDqrD,EAAqBzxD,eClB5BqwB,GAA0B,kCA4BhBoD,EAAgBrtB,QACrBqtB,OAASA,OACTrtB,QAAUA,yBAGjB,SAAWsrD,eACJA,WAAaA,EACXtxD,4BAGT,SAAiBwzB,eACVA,YAAcA,OACd+9B,cACEvxD,8BAGT,WACsB,gBAAhBA,KAAKqzB,QAA4C,mBAAhBrzB,KAAKqzB,UAC/Bm+B,cAAcxxD,MAEFiwB,GAASuB,SAASxxB,KAAKsxD,WAAYxhC,QAClD2hC,SAASzxD,uEA/CU0xD,OAExBA,EAAO9xD,eACJ,IAAIX,MAAM,4DAGRyyD,EAAO9xD,SAASilC,8BAuDPxR,EAAgBrtB,OAE9BiqB,SACG,IAAIhxB,MAAM,+CAGX,IAAI0yD,GAAKt+B,EAAQrtB,2HAbnBiqB,SACG,IAAIhxB,MAAM,iDAGZgxB,GAAQy6B,SAAShkB,MAAMinB,SAAS"} \ No newline at end of file diff --git a/package.json b/package.json index f107eb01..e9567c51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vuex-orm/plugin-graphql", - "version": "1.0.0-rc.34", + "version": "1.0.0-rc.35", "description": "Vuex-ORM persistence plugin to sync the store against a GraphQL API.", "main": "dist/vuex-orm-graphql.umd.js", "module": "dist/vuex-orm-graphql.es5.js",