{"version":3,"file":"vendor.graphql-language-service-utils.2021b0054908768e.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAuC;AACH;AAC7B;AACP;AACA;AACA;AACA;AACA;AACA,0BAA0B,wBAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,IAAI,yBAAK;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,qBAAqB,oBAAU;AAC/B;AACA,KAAK;AACL;AACA;AACA,QAAQ,yBAAK;AACb;AACA;AACA;AACA,6BAA6B,oBAAU;AACvC;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;ACtDkG;AAC3F;AACP;AACA;AACA,SAAS,2BAAI;AACb;AACA;AACA;AACA,QAAQ,yCAAa;AACrB;AACA,QAAQ,2BAAI;AACZ;AACA,aAAa,sCAAU;AACvB,QAAQ,2BAAI;AACZ;AACA,QAAQ,2BAAI;AACZ;AACA;AACA,QAAQ,2BAAI;AACZ;AACA;AACA;AACA;AACA;AACA,QAAQ,2BAAI;AACZ;AACA;AACA;AACA,QAAQ,2BAAI;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sCAAU;AAClB;AACA;AACA;AACA,QAAQ,wCAAY;AACpB;AACA;AACA,QAAQ,sCAAU;AAClB;AACA,gBAAgB,qCAAqC;AACrD;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,QAAQ,yCAAa;AACrB;AACA,gBAAgB,qCAAqC;AACrD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,QAAQ,6CAAiB;AACzB,2CAA2C,UAAU;AACrD;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qFAAqF;AACzG,oBAAoB,+BAA+B;AACnD,2EAA2E;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS,wCAAY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,oBAAoB,qCAAqC;AACzD;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA,SAAS;AACT;AACA;AACA;AACA;;ACvKgC;AACzB;AACP;AACA;AACA,IAAI,yBAAK;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjD2b;AAC3b;AACA,IAAI,wDAAwB;AAC5B,IAAI,wDAAwB;AAC5B,IAAI,8CAAmB;AACvB,IAAI,wDAAwB;AAC5B,IAAI,oEAA8B;AAClC,IAAI,wDAAwB;AAC5B,IAAI,4CAAkB;AACtB,IAAI,8CAAmB;AACvB,IAAI,sEAA+B;AACnC,IAAI,4DAA0B;AAC9B,IAAI,sDAAuB;AAC3B,IAAI,0DAAyB;AAC7B;AACO;AACP,kBAAkB,qCAAc;AAChC,qBAAqB,kDAAqB,aAAa,0DAAyB;AAChF;AACA;AACA,0CAA0C,oDAAsB;AAChE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6BAAQ;AAC3B;AACA;AACA;AACA,sCAAsC,iBAAI;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;AC7C2D;AACpD;AACP;AACA;AACA;AACA;AACA;AACA,+CAA+C,gBAAgB;AAC/D,sCAAsC,kCAAW;AACjD;AACA;AACA;AACA,2CAA2C,iBAAI;AAC/C;AACA,kEAAkE,4BAAY;AAC9E;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;AACL;AACA;AACA;;ACvBuC;AACe;AAC/C;AACP;AACA,UAAU,gBAAgB;AAC1B;AACA;AACA,IAAI,yBAAK;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL,aAAa;AACb;AACe;AACf;AACA;AACA;AACA;AACA,4BAA4B,wBAAK;AACjC,6CAA6C,gDAAgD,aAAa;AAC1G;AACA;AACA;AACA;AACA;AACO;AACP;;AC3BiG;AAC9B;AACU;AACL;AACJ;AACd;AACmD;AACzG","sources":["webpack://admin/./node_modules/graphql-language-service-utils/esm/fragmentDependencies.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/getVariablesJSONSchema.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/getASTNodeAtPosition.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/Range.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/validateWithCustomRules.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/collectVariables.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/getOperationFacts.js","webpack://admin/./node_modules/graphql-language-service-utils/esm/index.js"],"sourcesContent":["import { parse, visit } from 'graphql';\nimport nullthrows from 'nullthrows';\nexport const getFragmentDependencies = (operationString, fragmentDefinitions) => {\n if (!fragmentDefinitions) {\n return [];\n }\n let parsedOperation;\n try {\n parsedOperation = parse(operationString);\n }\n catch (error) {\n return [];\n }\n return getFragmentDependenciesForAST(parsedOperation, fragmentDefinitions);\n};\nexport const getFragmentDependenciesForAST = (parsedOperation, fragmentDefinitions) => {\n if (!fragmentDefinitions) {\n return [];\n }\n const existingFrags = new Map();\n const referencedFragNames = new Set();\n visit(parsedOperation, {\n FragmentDefinition(node) {\n existingFrags.set(node.name.value, true);\n },\n FragmentSpread(node) {\n if (!referencedFragNames.has(node.name.value)) {\n referencedFragNames.add(node.name.value);\n }\n },\n });\n const asts = new Set();\n referencedFragNames.forEach(name => {\n if (!existingFrags.has(name) && fragmentDefinitions.has(name)) {\n asts.add(nullthrows(fragmentDefinitions.get(name)));\n }\n });\n const referencedFragments = [];\n asts.forEach(ast => {\n visit(ast, {\n FragmentSpread(node) {\n if (!referencedFragNames.has(node.name.value) &&\n fragmentDefinitions.get(node.name.value)) {\n asts.add(nullthrows(fragmentDefinitions.get(node.name.value)));\n referencedFragNames.add(node.name.value);\n }\n },\n });\n if (!existingFrags.has(ast.name.value)) {\n referencedFragments.push(ast);\n }\n });\n return referencedFragments;\n};\n//# sourceMappingURL=fragmentDependencies.js.map","import { isEnumType, isInputObjectType, isListType, isNonNullType, isScalarType, } from 'graphql';\nexport const defaultJSONSchemaOptions = {\n useMarkdownDescription: false,\n};\nfunction text(into, newText) {\n into.push(newText);\n}\nfunction renderType(into, t) {\n if (isNonNullType(t)) {\n renderType(into, t.ofType);\n text(into, '!');\n }\n else if (isListType(t)) {\n text(into, '[');\n renderType(into, t.ofType);\n text(into, ']');\n }\n else {\n text(into, t.name);\n }\n}\nfunction renderTypeToString(t, useMarkdown) {\n const into = [];\n if (useMarkdown) {\n text(into, '```graphql\\n');\n }\n renderType(into, t);\n if (useMarkdown) {\n text(into, '\\n```');\n }\n return into.join('');\n}\nconst scalarTypesMap = {\n Int: 'integer',\n String: 'string',\n Float: 'number',\n ID: 'string',\n Boolean: 'boolean',\n DateTime: 'string',\n};\nfunction getJSONSchemaFromGraphQLType(type, options) {\n var _a;\n let required = false;\n let definition = Object.create(null);\n const definitions = Object.create(null);\n if ('defaultValue' in type && type.defaultValue !== undefined) {\n definition.default = type.defaultValue;\n }\n if (isEnumType(type)) {\n definition.type = 'string';\n definition.enum = type.getValues().map(val => val.name);\n }\n if (isScalarType(type)) {\n definition.type = (_a = scalarTypesMap[type.name]) !== null && _a !== void 0 ? _a : 'any';\n }\n if (isListType(type)) {\n definition.type = 'array';\n const { definition: def, definitions: defs } = getJSONSchemaFromGraphQLType(type.ofType, options);\n if (def.$ref) {\n definition.items = { $ref: def.$ref };\n }\n else {\n definition.items = def;\n }\n if (defs) {\n Object.keys(defs).forEach(defName => {\n definitions[defName] = defs[defName];\n });\n }\n }\n if (isNonNullType(type)) {\n required = true;\n const { definition: def, definitions: defs } = getJSONSchemaFromGraphQLType(type.ofType, options);\n definition = def;\n if (defs) {\n Object.keys(defs).forEach(defName => {\n definitions[defName] = defs[defName];\n });\n }\n }\n if (isInputObjectType(type)) {\n definition.$ref = `#/definitions/${type.name}`;\n const fields = type.getFields();\n const fieldDef = {\n type: 'object',\n properties: {},\n required: [],\n };\n if (type.description) {\n fieldDef.description = type.description + `\\n` + renderTypeToString(type);\n if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {\n fieldDef.markdownDescription =\n type.description + `\\n` + renderTypeToString(type, true);\n }\n }\n else {\n fieldDef.description = renderTypeToString(type);\n if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {\n fieldDef.markdownDescription = renderTypeToString(type, true);\n }\n }\n Object.keys(fields).forEach(fieldName => {\n const field = fields[fieldName];\n const { required: fieldRequired, definition: typeDefinition, definitions: typeDefinitions, } = getJSONSchemaFromGraphQLType(field.type, options);\n const { definition: fieldDefinition, } = getJSONSchemaFromGraphQLType(field, options);\n fieldDef.properties[fieldName] = Object.assign(Object.assign({}, typeDefinition), fieldDefinition);\n const renderedField = renderTypeToString(field.type);\n fieldDef.properties[fieldName].description = field.description\n ? field.description + '\\n' + renderedField\n : renderedField;\n if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {\n const renderedFieldMarkdown = renderTypeToString(field.type, true);\n fieldDef.properties[fieldName].markdownDescription = field.description\n ? field.description + '\\n' + renderedFieldMarkdown\n : renderedFieldMarkdown;\n }\n if (fieldRequired) {\n fieldDef.required.push(fieldName);\n }\n if (typeDefinitions) {\n Object.keys(typeDefinitions).map(defName => {\n definitions[defName] = typeDefinitions[defName];\n });\n }\n });\n definitions[type.name] = fieldDef;\n }\n if ('description' in type &&\n !isScalarType(type) &&\n type.description &&\n !definition.description) {\n definition.description = type.description + '\\n' + renderTypeToString(type);\n if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {\n definition.markdownDescription =\n type.description + '\\n' + renderTypeToString(type, true);\n }\n }\n else {\n definition.description = renderTypeToString(type);\n if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {\n definition.markdownDescription = renderTypeToString(type, true);\n }\n }\n return { required, definition, definitions };\n}\nexport function getVariablesJSONSchema(variableToType, options) {\n const jsonSchema = {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n type: 'object',\n properties: {},\n required: [],\n };\n if (variableToType) {\n Object.entries(variableToType).forEach(([variableName, type]) => {\n var _a;\n const { definition, required, definitions, } = getJSONSchemaFromGraphQLType(type, options);\n jsonSchema.properties[variableName] = definition;\n if (required) {\n (_a = jsonSchema.required) === null || _a === void 0 ? void 0 : _a.push(variableName);\n }\n if (definitions) {\n jsonSchema.definitions = Object.assign(Object.assign({}, jsonSchema === null || jsonSchema === void 0 ? void 0 : jsonSchema.definitions), definitions);\n }\n });\n }\n return jsonSchema;\n}\n//# sourceMappingURL=getVariablesJSONSchema.js.map","import { visit } from 'graphql';\nexport function getASTNodeAtPosition(query, ast, point) {\n const offset = pointToOffset(query, point);\n let nodeContainingPosition;\n visit(ast, {\n enter(node) {\n if (node.kind !== 'Name' &&\n node.loc &&\n node.loc.start <= offset &&\n offset <= node.loc.end) {\n nodeContainingPosition = node;\n }\n else {\n return false;\n }\n },\n leave(node) {\n if (node.loc && node.loc.start <= offset && offset <= node.loc.end) {\n return false;\n }\n },\n });\n return nodeContainingPosition;\n}\nexport function pointToOffset(text, point) {\n const linesUntilPosition = text.split('\\n').slice(0, point.line);\n return (point.character +\n linesUntilPosition\n .map(line => line.length + 1)\n .reduce((a, b) => a + b, 0));\n}\n//# sourceMappingURL=getASTNodeAtPosition.js.map","export class Range {\n constructor(start, end) {\n this.containsPosition = (position) => {\n if (this.start.line === position.line) {\n return this.start.character <= position.character;\n }\n else if (this.end.line === position.line) {\n return this.end.character >= position.character;\n }\n else {\n return this.start.line <= position.line && this.end.line >= position.line;\n }\n };\n this.start = start;\n this.end = end;\n }\n setStart(line, character) {\n this.start = new Position(line, character);\n }\n setEnd(line, character) {\n this.end = new Position(line, character);\n }\n}\nexport class Position {\n constructor(line, character) {\n this.lessThanOrEqualTo = (position) => this.line < position.line ||\n (this.line === position.line && this.character <= position.character);\n this.line = line;\n this.character = character;\n }\n setLine(line) {\n this.line = line;\n }\n setCharacter(character) {\n this.character = character;\n }\n}\nexport function offsetToPosition(text, loc) {\n const EOL = '\\n';\n const buf = text.slice(0, loc);\n const lines = buf.split(EOL).length - 1;\n const lastLineIndex = buf.lastIndexOf(EOL);\n return new Position(lines, loc - lastLineIndex - 1);\n}\nexport function locToRange(text, loc) {\n const start = offsetToPosition(text, loc.start);\n const end = offsetToPosition(text, loc.end);\n return new Range(start, end);\n}\n//# sourceMappingURL=Range.js.map","import { specifiedRules, validate, NoUnusedFragmentsRule, KnownFragmentNamesRule, Kind, ExecutableDefinitionsRule, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, KnownTypeNamesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, PossibleTypeExtensionsRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, } from 'graphql';\nconst specifiedSDLRules = [\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n KnownTypeNamesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n PossibleTypeExtensionsRule,\n UniqueArgumentNamesRule,\n UniqueInputFieldNamesRule,\n];\nexport function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, isSchemaDocument) {\n const rules = specifiedRules.filter(rule => {\n if (rule === NoUnusedFragmentsRule || rule === ExecutableDefinitionsRule) {\n return false;\n }\n if (isRelayCompatMode && rule === KnownFragmentNamesRule) {\n return false;\n }\n return true;\n });\n if (customRules) {\n Array.prototype.push.apply(rules, customRules);\n }\n if (isSchemaDocument) {\n Array.prototype.push.apply(rules, specifiedSDLRules);\n }\n const errors = validate(schema, ast, rules);\n return errors.filter(error => {\n if (error.message.indexOf('Unknown directive') !== -1 && error.nodes) {\n const node = error.nodes[0];\n if (node && node.kind === Kind.DIRECTIVE) {\n const name = node.name.value;\n if (name === 'arguments' || name === 'argumentDefinitions') {\n return false;\n }\n }\n }\n return true;\n });\n}\n//# sourceMappingURL=validateWithCustomRules.js.map","import { typeFromAST, GraphQLFloat, Kind, } from 'graphql';\nexport function collectVariables(schema, documentAST) {\n const variableToType = Object.create(null);\n documentAST.definitions.forEach(definition => {\n if (definition.kind === 'OperationDefinition') {\n const variableDefinitions = definition.variableDefinitions;\n if (variableDefinitions) {\n variableDefinitions.forEach(({ variable, type }) => {\n const inputType = typeFromAST(schema, type);\n if (inputType) {\n variableToType[variable.name.value] = inputType;\n }\n else if (type.kind === Kind.NAMED_TYPE) {\n if (type.name.value === 'Float') {\n variableToType[variable.name.value] = GraphQLFloat;\n }\n }\n });\n }\n }\n });\n return variableToType;\n}\n//# sourceMappingURL=collectVariables.js.map","import { parse, visit } from 'graphql';\nimport { collectVariables } from './collectVariables';\nexport function getOperationASTFacts(documentAST, schema) {\n const variableToType = schema\n ? collectVariables(schema, documentAST)\n : undefined;\n const operations = [];\n visit(documentAST, {\n OperationDefinition(node) {\n operations.push(node);\n },\n });\n return { variableToType, operations };\n}\nexport default function getOperationFacts(schema, documentString) {\n if (!documentString) {\n return;\n }\n try {\n const documentAST = parse(documentString);\n return Object.assign(Object.assign({}, getOperationASTFacts(documentAST, schema)), { documentAST });\n }\n catch (_a) {\n return;\n }\n}\nexport const getQueryFacts = getOperationFacts;\n//# sourceMappingURL=getOperationFacts.js.map","export { getFragmentDependencies, getFragmentDependenciesForAST, } from './fragmentDependencies';\nexport { getVariablesJSONSchema, } from './getVariablesJSONSchema';\nexport { getASTNodeAtPosition, pointToOffset } from './getASTNodeAtPosition';\nexport { Position, Range, locToRange, offsetToPosition } from './Range';\nexport { validateWithCustomRules } from './validateWithCustomRules';\nexport { collectVariables } from './collectVariables';\nexport { default as getOperationFacts, getOperationASTFacts, getQueryFacts, } from './getOperationFacts';\n//# sourceMappingURL=index.js.map"],"names":[],"sourceRoot":""}