diff --git a/Rakefile b/Rakefile index a11ccd1..fd7a355 100644 --- a/Rakefile +++ b/Rakefile @@ -48,8 +48,8 @@ task :update_graphiql do new_css_versions["graphiql"] = new_version puts "Copying GraphiQL #{new_version}" - FileUtils.cp("./graphiql.js", "../../../app/assets/javascripts/graphiql/rails/graphiql-#{new_version}.js") - FileUtils.cp("./graphiql.css", "../../../app/assets/stylesheets/graphiql/rails/graphiql-#{new_version}.css") + FileUtils.cp("./graphiql.min.js", "../../../app/assets/javascripts/graphiql/rails/graphiql-#{new_version}.js") + FileUtils.cp("./graphiql.min.css", "../../../app/assets/stylesheets/graphiql/rails/graphiql-#{new_version}.css") end FileUtils.cd("./node_modules/react") do diff --git a/app/assets/javascripts/graphiql/rails/application.js b/app/assets/javascripts/graphiql/rails/application.js index 1d9b0c7..a421752 100644 --- a/app/assets/javascripts/graphiql/rails/application.js +++ b/app/assets/javascripts/graphiql/rails/application.js @@ -1,5 +1,5 @@ //= require ./react-17.0.2 //= require ./react-dom-17.0.2 //= require ./fetch-0.10.1 -//= require ./graphiql-2.4.0 +//= require ./graphiql-2.4.1 //= require ./graphiql_show diff --git a/app/assets/javascripts/graphiql/rails/graphiql-2.4.0.js b/app/assets/javascripts/graphiql/rails/graphiql-2.4.0.js deleted file mode 100644 index 8983c08..0000000 --- a/app/assets/javascripts/graphiql/rails/graphiql-2.4.0.js +++ /dev/null @@ -1,71267 +0,0 @@ -/******/ (function() { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js": -/*!********************************************************************************!*\ - !*** ../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js ***! - \********************************************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () { - 'use strict'; - - Object.defineProperty(exports, "__esModule", ({ - value: true - })); - function createDeferred() { - const d = {}; - d.promise = new Promise((resolve, reject) => { - d.resolve = resolve; - d.reject = reject; - }); - return d; - } - const SYMBOL_FINISHED = Symbol(); - const SYMBOL_NEW_VALUE = Symbol(); - /** - * makePushPullAsyncIterableIterator - * - * The iterable will publish values until return or throw is called. - * Afterwards it is in the completed state and cannot be used for publishing any further values. - * It will handle back-pressure and keep pushed values until they are consumed by a source. - */ - function makePushPullAsyncIterableIterator() { - let isRunning = true; - const values = []; - let newValueD = createDeferred(); - const finishedD = createDeferred(); - const asyncIterableIterator = async function* PushPullAsyncIterableIterator() { - while (true) { - if (values.length > 0) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - yield values.shift(); - } else { - const result = await Promise.race([newValueD.promise, finishedD.promise]); - if (result === SYMBOL_FINISHED) { - break; - } - if (result !== SYMBOL_NEW_VALUE) { - throw result; - } - } - } - }(); - function pushValue(value) { - if (isRunning === false) { - // TODO: Should this throw? - return; - } - values.push(value); - newValueD.resolve(SYMBOL_NEW_VALUE); - newValueD = createDeferred(); - } - // We monkey patch the original generator for clean-up - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const originalReturn = asyncIterableIterator.return.bind(asyncIterableIterator); - asyncIterableIterator.return = function () { - isRunning = false; - finishedD.resolve(SYMBOL_FINISHED); - return originalReturn(...arguments); - }; - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const originalThrow = asyncIterableIterator.throw.bind(asyncIterableIterator); - asyncIterableIterator.throw = err => { - isRunning = false; - finishedD.resolve(err); - return originalThrow(err); - }; - return { - pushValue, - asyncIterableIterator - }; - } - const makeAsyncIterableIteratorFromSink = make => { - const { - pushValue, - asyncIterableIterator - } = makePushPullAsyncIterableIterator(); - const dispose = make({ - next: value => { - pushValue(value); - }, - complete: () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - asyncIterableIterator.return(); - }, - error: err => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - asyncIterableIterator.throw(err); - } - }); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const originalReturn = asyncIterableIterator.return; - let returnValue = undefined; - asyncIterableIterator.return = () => { - if (returnValue === undefined) { - dispose(); - returnValue = originalReturn(); - } - return returnValue; - }; - return asyncIterableIterator; - }; - function applyAsyncIterableIteratorToSink(asyncIterableIterator, sink) { - const run = async () => { - try { - for await (const value of asyncIterableIterator) { - sink.next(value); - } - sink.complete(); - } catch (err) { - sink.error(err); - } - }; - run(); - return () => { - var _a; - (_a = asyncIterableIterator.return) === null || _a === void 0 ? void 0 : _a.call(asyncIterableIterator); - }; - } - function isAsyncIterable(input) { - return typeof input === "object" && input !== null && ( - // The AsyncGenerator check is for Safari on iOS which currently does not have - // Symbol.asyncIterator implemented - // That means every custom AsyncIterable must be built using a AsyncGeneratorFunction (async function * () {}) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - input[Symbol.toStringTag] === "AsyncGenerator" || Symbol.asyncIterator && Symbol.asyncIterator in input); - } - exports.applyAsyncIterableIteratorToSink = applyAsyncIterableIteratorToSink; - exports.isAsyncIterable = isAsyncIterable; - exports.makeAsyncIterableIteratorFromSink = makeAsyncIterableIteratorFromSink; - exports.makePushPullAsyncIterableIterator = makePushPullAsyncIterableIterator; -}); - -/***/ }), - -/***/ "../../../node_modules/graphql-ws/lib/index.js": -/*!*****************************************************!*\ - !*** ../../../node_modules/graphql-ws/lib/index.js ***! - \*****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () { - "use strict"; - - var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { - enumerable: true, - get: function () { - return m[k]; - } - }); - } : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); - }; - Object.defineProperty(exports, "__esModule", ({ - value: true - })); - __exportStar(__webpack_require__(/*! ./client */ "../../../node_modules/graphql-ws/lib/client.mjs"), exports); - __exportStar(__webpack_require__(/*! ./server */ "../../../node_modules/graphql-ws/lib/server.mjs"), exports); - __exportStar(__webpack_require__(/*! ./common */ "../../../node_modules/graphql-ws/lib/common.mjs"), exports); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/Range.es.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/Range.es.js ***! - \*********************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.R = _exports.P = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - class Range { - constructor(start, end) { - this.containsPosition = position => { - if (this.start.line === position.line) { - return this.start.character <= position.character; - } - if (this.end.line === position.line) { - return this.end.character >= position.character; - } - return this.start.line <= position.line && this.end.line >= position.line; - }; - this.start = start; - this.end = end; - } - setStart(line, character) { - this.start = new Position(line, character); - } - setEnd(line, character) { - this.end = new Position(line, character); - } - } - _exports.R = Range; - __name(Range, "Range"); - class Position { - constructor(line, character) { - this.lessThanOrEqualTo = position => this.line < position.line || this.line === position.line && this.character <= position.character; - this.line = line; - this.character = character; - } - setLine(line) { - this.line = line; - } - setCharacter(character) { - this.character = character; - } - } - _exports.P = Position; - __name(Position, "Position"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/SchemaReference.es.js": -/*!*******************************************************!*\ - !*** ../../graphiql-react/dist/SchemaReference.es.js ***! - \*******************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! ./forEachState.es.js */ "../../graphiql-react/dist/forEachState.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _graphql, _indexEs, _forEachStateEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.a = getFieldReference; - _exports.b = getDirectiveReference; - _exports.c = getArgumentReference; - _exports.d = getEnumValueReference; - _exports.e = getTypeReference; - _exports.g = getTypeInfo; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function getTypeInfo(schema, tokenState) { - const info = { - schema, - type: null, - parentType: null, - inputType: null, - directiveDef: null, - fieldDef: null, - argDef: null, - argDefs: null, - objectFieldDefs: null - }; - (0, _forEachStateEs.f)(tokenState, state => { - var _a, _b; - switch (state.kind) { - case "Query": - case "ShortQuery": - info.type = schema.getQueryType(); - break; - case "Mutation": - info.type = schema.getMutationType(); - break; - case "Subscription": - info.type = schema.getSubscriptionType(); - break; - case "InlineFragment": - case "FragmentDefinition": - if (state.type) { - info.type = schema.getType(state.type); - } - break; - case "Field": - case "AliasedField": - info.fieldDef = info.type && state.name ? getFieldDef(schema, info.parentType, state.name) : null; - info.type = (_a = info.fieldDef) === null || _a === void 0 ? void 0 : _a.type; - break; - case "SelectionSet": - info.parentType = info.type ? (0, _graphql.getNamedType)(info.type) : null; - break; - case "Directive": - info.directiveDef = state.name ? schema.getDirective(state.name) : null; - break; - case "Arguments": - const parentDef = state.prevState ? state.prevState.kind === "Field" ? info.fieldDef : state.prevState.kind === "Directive" ? info.directiveDef : state.prevState.kind === "AliasedField" ? state.prevState.name && getFieldDef(schema, info.parentType, state.prevState.name) : null : null; - info.argDefs = parentDef ? parentDef.args : null; - break; - case "Argument": - info.argDef = null; - if (info.argDefs) { - for (let i = 0; i < info.argDefs.length; i++) { - if (info.argDefs[i].name === state.name) { - info.argDef = info.argDefs[i]; - break; - } - } - } - info.inputType = (_b = info.argDef) === null || _b === void 0 ? void 0 : _b.type; - break; - case "EnumValue": - const enumType = info.inputType ? (0, _graphql.getNamedType)(info.inputType) : null; - info.enumValue = enumType instanceof _graphql.GraphQLEnumType ? find(enumType.getValues(), val => val.value === state.name) : null; - break; - case "ListValue": - const nullableType = info.inputType ? (0, _graphql.getNullableType)(info.inputType) : null; - info.inputType = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; - break; - case "ObjectValue": - const objectType = info.inputType ? (0, _graphql.getNamedType)(info.inputType) : null; - info.objectFieldDefs = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; - break; - case "ObjectField": - const objectField = state.name && info.objectFieldDefs ? info.objectFieldDefs[state.name] : null; - info.inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; - break; - case "NamedType": - info.type = state.name ? schema.getType(state.name) : null; - break; - } - }); - return info; - } - __name(getTypeInfo, "getTypeInfo"); - function getFieldDef(schema, type, fieldName) { - if (fieldName === _indexEs.S.name && schema.getQueryType() === type) { - return _indexEs.S; - } - if (fieldName === _indexEs.T.name && schema.getQueryType() === type) { - return _indexEs.T; - } - if (fieldName === _indexEs.a.name && (0, _graphql.isCompositeType)(type)) { - return _indexEs.a; - } - if (type && type.getFields) { - return type.getFields()[fieldName]; - } - } - __name(getFieldDef, "getFieldDef"); - function find(array, predicate) { - for (let i = 0; i < array.length; i++) { - if (predicate(array[i])) { - return array[i]; - } - } - } - __name(find, "find"); - function getFieldReference(typeInfo) { - return { - kind: "Field", - schema: typeInfo.schema, - field: typeInfo.fieldDef, - type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType - }; - } - __name(getFieldReference, "getFieldReference"); - function getDirectiveReference(typeInfo) { - return { - kind: "Directive", - schema: typeInfo.schema, - directive: typeInfo.directiveDef - }; - } - __name(getDirectiveReference, "getDirectiveReference"); - function getArgumentReference(typeInfo) { - return typeInfo.directiveDef ? { - kind: "Argument", - schema: typeInfo.schema, - argument: typeInfo.argDef, - directive: typeInfo.directiveDef - } : { - kind: "Argument", - schema: typeInfo.schema, - argument: typeInfo.argDef, - field: typeInfo.fieldDef, - type: isMetaField(typeInfo.fieldDef) ? null : typeInfo.parentType - }; - } - __name(getArgumentReference, "getArgumentReference"); - function getEnumValueReference(typeInfo) { - return { - kind: "EnumValue", - value: typeInfo.enumValue || void 0, - type: typeInfo.inputType ? (0, _graphql.getNamedType)(typeInfo.inputType) : void 0 - }; - } - __name(getEnumValueReference, "getEnumValueReference"); - function getTypeReference(typeInfo, type) { - return { - kind: "Type", - schema: typeInfo.schema, - type: type || typeInfo.type - }; - } - __name(getTypeReference, "getTypeReference"); - function isMetaField(fieldDef) { - return fieldDef.name.slice(0, 2) === "__"; - } - __name(isMetaField, "isMetaField"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/brace-fold.es.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/brace-fold.es.js ***! - \**************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.b = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var braceFold$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - function bracketFolding(pairs) { - return function (cm, start) { - var line = start.line, - lineText = cm.getLine(line); - function findOpening(pair) { - var tokenType; - for (var at = start.ch, pass = 0;;) { - var found2 = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1); - if (found2 == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found2 < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found2 + 1)); - if (!/^(comment|string)/.test(tokenType)) return { - ch: found2 + 1, - tokenType, - pair - }; - at = found2 - 1; - } - } - __name(findOpening, "findOpening"); - function findRange(found2) { - var count = 1, - lastLine = cm.lastLine(), - end, - startCh = found2.ch, - endCh; - outer: for (var i2 = line; i2 <= lastLine; ++i2) { - var text = cm.getLine(i2), - pos = i2 == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(found2.pair[0], pos), - nextClose = text.indexOf(found2.pair[1], pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i2, pos + 1)) == found2.tokenType) { - if (pos == nextOpen) ++count;else if (! --count) { - end = i2; - endCh = pos; - break outer; - } - } - ++pos; - } - } - if (end == null || line == end) return null; - return { - from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh) - }; - } - __name(findRange, "findRange"); - var found = []; - for (var i = 0; i < pairs.length; i++) { - var open = findOpening(pairs[i]); - if (open) found.push(open); - } - found.sort(function (a, b) { - return a.ch - b.ch; - }); - for (var i = 0; i < found.length; i++) { - var range = findRange(found[i]); - if (range) return range; - } - return null; - }; - } - __name(bracketFolding, "bracketFolding"); - CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]])); - CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]])); - CodeMirror.registerHelper("fold", "import", function (cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start2 = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start2.string)) start2 = cm.getTokenAt(CodeMirror.Pos(line, start2.end + 1)); - if (start2.type != "keyword" || start2.string != "import") return null; - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), - semi = text.indexOf(";"); - if (semi != -1) return { - startCh: start2.end, - end: CodeMirror.Pos(i, semi) - }; - } - } - __name(hasImport, "hasImport"); - var startLine = start.line, - has = hasImport(startLine), - prev; - if (!has || hasImport(startLine - 1) || (prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1) return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return { - from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), - to: end - }; - }); - CodeMirror.registerHelper("fold", "include", function (cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start2 = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start2.string)) start2 = cm.getTokenAt(CodeMirror.Pos(line, start2.end + 1)); - if (start2.type == "meta" && start2.string.slice(0, 8) == "#include") return start2.start + 8; - } - __name(hasInclude, "hasInclude"); - var startLine = start.line, - has = hasInclude(startLine); - if (has == null || hasInclude(startLine - 1) != null) return null; - for (var end = startLine;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return { - from: CodeMirror.Pos(startLine, has + 1), - to: cm.clipPos(CodeMirror.Pos(end)) - }; - }); - }); - })(); - var braceFold = braceFold$2.exports; - var braceFold$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": braceFold - }, [braceFold$2.exports]); - _exports.b = braceFold$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/closebrackets.es.js": -/*!*****************************************************!*\ - !*** ../../graphiql-react/dist/closebrackets.es.js ***! - \*****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.c = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var closebrackets$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var defaults = { - pairs: `()[]{}''""`, - closeBefore: `)]}'":;>`, - triples: "", - explode: "[]{}" - }; - var Pos = CodeMirror.Pos; - CodeMirror.defineOption("autoCloseBrackets", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.removeKeyMap(keyMap); - cm.state.closeBrackets = null; - } - if (val) { - ensureBound(getOption(val, "pairs")); - cm.state.closeBrackets = val; - cm.addKeyMap(keyMap); - } - }); - function getOption(conf, name) { - if (name == "pairs" && typeof conf == "string") return conf; - if (typeof conf == "object" && conf[name] != null) return conf[name]; - return defaults[name]; - } - __name(getOption, "getOption"); - var keyMap = { - Backspace: handleBackspace, - Enter: handleEnter - }; - function ensureBound(chars) { - for (var i = 0; i < chars.length; i++) { - var ch = chars.charAt(i), - key = "'" + ch + "'"; - if (!keyMap[key]) keyMap[key] = handler(ch); - } - } - __name(ensureBound, "ensureBound"); - ensureBound(defaults.pairs + "`"); - function handler(ch) { - return function (cm) { - return handleChar(cm, ch); - }; - } - __name(handler, "handler"); - function getConfig(cm) { - var deflt = cm.state.closeBrackets; - if (!deflt || deflt.override) return deflt; - var mode = cm.getModeAt(cm.getCursor()); - return mode.closeBrackets || deflt; - } - __name(getConfig, "getConfig"); - function handleBackspace(cm) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - var pairs = getOption(conf, "pairs"); - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete"); - } - } - __name(handleBackspace, "handleBackspace"); - function handleEnter(cm) { - var conf = getConfig(cm); - var explode = conf && getOption(conf, "explode"); - if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - cm.operation(function () { - var linesep = cm.lineSeparator() || "\n"; - cm.replaceSelection(linesep + linesep, null); - moveSel(cm, -1); - ranges = cm.listSelections(); - for (var i2 = 0; i2 < ranges.length; i2++) { - var line = ranges[i2].head.line; - cm.indentLine(line, null, true); - cm.indentLine(line + 1, null, true); - } - }); - } - __name(handleEnter, "handleEnter"); - function moveSel(cm, dir) { - var newRanges = [], - ranges = cm.listSelections(), - primary = 0; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head == cm.getCursor()) primary = i; - var pos = range.head.ch || dir > 0 ? { - line: range.head.line, - ch: range.head.ch + dir - } : { - line: range.head.line - 1 - }; - newRanges.push({ - anchor: pos, - head: pos - }); - } - cm.setSelections(newRanges, primary); - } - __name(moveSel, "moveSel"); - function contractSelection(sel) { - var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0; - return { - anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)), - head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1)) - }; - } - __name(contractSelection, "contractSelection"); - function handleChar(cm, ch) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - var pairs = getOption(conf, "pairs"); - var pos = pairs.indexOf(ch); - if (pos == -1) return CodeMirror.Pass; - var closeBefore = getOption(conf, "closeBefore"); - var triples = getOption(conf, "triples"); - var identical = pairs.charAt(pos + 1) == ch; - var ranges = cm.listSelections(); - var opening = pos % 2 == 0; - var type; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - cur = range.head, - curType; - var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); - if (opening && !range.empty()) { - curType = "surround"; - } else if ((identical || !opening) && next == ch) { - if (identical && stringStartsAfter(cm, cur)) curType = "both";else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) curType = "skipThree";else curType = "skip"; - } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) { - if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass; - curType = "addFour"; - } else if (identical) { - var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur); - if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";else return CodeMirror.Pass; - } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) { - curType = "both"; - } else { - return CodeMirror.Pass; - } - if (!type) type = curType;else if (type != curType) return CodeMirror.Pass; - } - var left = pos % 2 ? pairs.charAt(pos - 1) : ch; - var right = pos % 2 ? ch : pairs.charAt(pos + 1); - cm.operation(function () { - if (type == "skip") { - moveSel(cm, 1); - } else if (type == "skipThree") { - moveSel(cm, 3); - } else if (type == "surround") { - var sels = cm.getSelections(); - for (var i2 = 0; i2 < sels.length; i2++) sels[i2] = left + sels[i2] + right; - cm.replaceSelections(sels, "around"); - sels = cm.listSelections().slice(); - for (var i2 = 0; i2 < sels.length; i2++) sels[i2] = contractSelection(sels[i2]); - cm.setSelections(sels); - } else if (type == "both") { - cm.replaceSelection(left + right, null); - cm.triggerElectric(left + right); - moveSel(cm, -1); - } else if (type == "addFour") { - cm.replaceSelection(left + left + left + left, "before"); - moveSel(cm, 1); - } - }); - } - __name(handleChar, "handleChar"); - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), Pos(pos.line, pos.ch + 1)); - return str.length == 2 ? str : null; - } - __name(charsAround, "charsAround"); - function stringStartsAfter(cm, pos) { - var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1)); - return /\bstring/.test(token.type) && token.start == pos.ch && (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos))); - } - __name(stringStartsAfter, "stringStartsAfter"); - }); - })(); - var closebrackets = closebrackets$2.exports; - var closebrackets$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": closebrackets - }, [closebrackets$2.exports]); - _exports.c = closebrackets$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/codemirror.es.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/codemirror.es.js ***! - \**************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _indexEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.c = _exports.a = _exports.C = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var codemirror$1 = { - exports: {} - }; - _exports.a = codemirror$1; - (function (module, exports) { - (function (global, factory) { - module.exports = factory(); - })(_indexEs.c, function () { - var userAgent = navigator.userAgent; - var platform = navigator.platform; - var gecko = /gecko\/\d/i.test(userAgent); - var ie_upto10 = /MSIE \d/.test(userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); - var edge = /Edge\/(\d+)/.exec(userAgent); - var ie = ie_upto10 || ie_11up || edge; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); - var webkit = !edge && /WebKit\//.test(userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); - var chrome = !edge && /Chrome\//.test(userAgent); - var presto = /Opera\//.test(userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); - var phantom = /PhantomJS/.test(userAgent); - var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); - var android = /Android/.test(userAgent); - var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); - var mac = ios || /Mac/.test(platform); - var chromeOS = /\bCrOS\b/.test(userAgent); - var windows = /win/i.test(platform); - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) { - presto_version = Number(presto_version[1]); - } - if (presto_version && presto_version >= 15) { - presto = false; - webkit = true; - } - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || ie && ie_version >= 9; - function classTest(cls) { - return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); - } - __name(classTest, "classTest"); - var rmClass = /* @__PURE__ */__name(function (node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }, "rmClass"); - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) { - e.removeChild(e.firstChild); - } - return e; - } - __name(removeChildren, "removeChildren"); - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - __name(removeChildrenAndAdd, "removeChildrenAndAdd"); - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) { - e.className = className; - } - if (style) { - e.style.cssText = style; - } - if (typeof content == "string") { - e.appendChild(document.createTextNode(content)); - } else if (content) { - for (var i2 = 0; i2 < content.length; ++i2) { - e.appendChild(content[i2]); - } - } - return e; - } - __name(elt, "elt"); - function eltP(tag, content, className, style) { - var e = elt(tag, content, className, style); - e.setAttribute("role", "presentation"); - return e; - } - __name(eltP, "eltP"); - var range; - if (document.createRange) { - range = /* @__PURE__ */__name(function (node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r; - }, "range"); - } else { - range = /* @__PURE__ */__name(function (node, start, end) { - var r = document.body.createTextRange(); - try { - r.moveToElementText(node.parentNode); - } catch (e) { - return r; - } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }, "range"); - } - function contains(parent, child) { - if (child.nodeType == 3) { - child = child.parentNode; - } - if (parent.contains) { - return parent.contains(child); - } - do { - if (child.nodeType == 11) { - child = child.host; - } - if (child == parent) { - return true; - } - } while (child = child.parentNode); - } - __name(contains, "contains"); - function activeElt() { - var activeElement; - try { - activeElement = document.activeElement; - } catch (e) { - activeElement = document.body || null; - } - while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) { - activeElement = activeElement.shadowRoot.activeElement; - } - return activeElement; - } - __name(activeElt, "activeElt"); - function addClass(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) { - node.className += (current ? " " : "") + cls; - } - } - __name(addClass, "addClass"); - function joinClasses(a, b) { - var as = a.split(" "); - for (var i2 = 0; i2 < as.length; i2++) { - if (as[i2] && !classTest(as[i2]).test(b)) { - b += " " + as[i2]; - } - } - return b; - } - __name(joinClasses, "joinClasses"); - var selectInput = /* @__PURE__ */__name(function (node) { - node.select(); - }, "selectInput"); - if (ios) { - selectInput = /* @__PURE__ */__name(function (node) { - node.selectionStart = 0; - node.selectionEnd = node.value.length; - }, "selectInput"); - } else if (ie) { - selectInput = /* @__PURE__ */__name(function (node) { - try { - node.select(); - } catch (_e) {} - }, "selectInput"); - } - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return f.apply(null, args); - }; - } - __name(bind, "bind"); - function copyObj(obj, target, overwrite) { - if (!target) { - target = {}; - } - for (var prop2 in obj) { - if (obj.hasOwnProperty(prop2) && (overwrite !== false || !target.hasOwnProperty(prop2))) { - target[prop2] = obj[prop2]; - } - } - return target; - } - __name(copyObj, "copyObj"); - function countColumn(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) { - end = string.length; - } - } - for (var i2 = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf(" ", i2); - if (nextTab < 0 || nextTab >= end) { - return n + (end - i2); - } - n += nextTab - i2; - n += tabSize - n % tabSize; - i2 = nextTab + 1; - } - } - __name(countColumn, "countColumn"); - var Delayed = /* @__PURE__ */__name(function () { - this.id = null; - this.f = null; - this.time = 0; - this.handler = bind(this.onTimeout, this); - }, "Delayed"); - Delayed.prototype.onTimeout = function (self) { - self.id = 0; - if (self.time <= +new Date()) { - self.f(); - } else { - setTimeout(self.handler, self.time - +new Date()); - } - }; - Delayed.prototype.set = function (ms, f) { - this.f = f; - var time = +new Date() + ms; - if (!this.id || time < this.time) { - clearTimeout(this.id); - this.id = setTimeout(this.handler, ms); - this.time = time; - } - }; - function indexOf(array, elt2) { - for (var i2 = 0; i2 < array.length; ++i2) { - if (array[i2] == elt2) { - return i2; - } - } - return -1; - } - __name(indexOf, "indexOf"); - var scrollerGap = 50; - var Pass = { - toString: function () { - return "CodeMirror.Pass"; - } - }; - var sel_dontScroll = { - scroll: false - }, - sel_mouse = { - origin: "*mouse" - }, - sel_move = { - origin: "+move" - }; - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf(" ", pos); - if (nextTab == -1) { - nextTab = string.length; - } - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) { - return pos + Math.min(skipped, goal - col); - } - col += nextTab - pos; - col += tabSize - col % tabSize; - pos = nextTab + 1; - if (col >= goal) { - return pos; - } - } - } - __name(findColumn, "findColumn"); - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) { - spaceStrs.push(lst(spaceStrs) + " "); - } - return spaceStrs[n]; - } - __name(spaceStr, "spaceStr"); - function lst(arr) { - return arr[arr.length - 1]; - } - __name(lst, "lst"); - function map(array, f) { - var out = []; - for (var i2 = 0; i2 < array.length; i2++) { - out[i2] = f(array[i2], i2); - } - return out; - } - __name(map, "map"); - function insertSorted(array, value, score) { - var pos = 0, - priority = score(value); - while (pos < array.length && score(array[pos]) <= priority) { - pos++; - } - array.splice(pos, 0, value); - } - __name(insertSorted, "insertSorted"); - function nothing() {} - __name(nothing, "nothing"); - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) { - copyObj(props, inst); - } - return inst; - } - __name(createObj, "createObj"); - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - function isWordCharBasic(ch) { - return /\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - } - __name(isWordCharBasic, "isWordCharBasic"); - function isWordChar(ch, helper) { - if (!helper) { - return isWordCharBasic(ch); - } - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { - return true; - } - return helper.test(ch); - } - __name(isWordChar, "isWordChar"); - function isEmpty(obj) { - for (var n in obj) { - if (obj.hasOwnProperty(n) && obj[n]) { - return false; - } - } - return true; - } - __name(isEmpty, "isEmpty"); - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { - return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); - } - __name(isExtendingChar, "isExtendingChar"); - function skipExtendingChars(str, pos, dir) { - while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { - pos += dir; - } - return pos; - } - __name(skipExtendingChars, "skipExtendingChars"); - function findFirst(pred, from, to) { - var dir = from > to ? -1 : 1; - for (;;) { - if (from == to) { - return from; - } - var midF = (from + to) / 2, - mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); - if (mid == from) { - return pred(mid) ? from : to; - } - if (pred(mid)) { - to = mid; - } else { - from = mid + dir; - } - } - } - __name(findFirst, "findFirst"); - function iterateBidiSections(order, from, to, f) { - if (!order) { - return f(from, to, "ltr", 0); - } - var found = false; - for (var i2 = 0; i2 < order.length; ++i2) { - var part = order[i2]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i2); - found = true; - } - } - if (!found) { - f(from, to, "ltr"); - } - } - __name(iterateBidiSections, "iterateBidiSections"); - var bidiOther = null; - function getBidiPartAt(order, ch, sticky) { - var found; - bidiOther = null; - for (var i2 = 0; i2 < order.length; ++i2) { - var cur = order[i2]; - if (cur.from < ch && cur.to > ch) { - return i2; - } - if (cur.to == ch) { - if (cur.from != cur.to && sticky == "before") { - found = i2; - } else { - bidiOther = i2; - } - } - if (cur.from == ch) { - if (cur.from != cur.to && sticky != "before") { - found = i2; - } else { - bidiOther = i2; - } - } - } - return found != null ? found : bidiOther; - } - __name(getBidiPartAt, "getBidiPartAt"); - var bidiOrdering = function () { - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; - function charType(code) { - if (code <= 247) { - return lowTypes.charAt(code); - } else if (1424 <= code && code <= 1524) { - return "R"; - } else if (1536 <= code && code <= 1785) { - return arabicTypes.charAt(code - 1536); - } else if (1774 <= code && code <= 2220) { - return "r"; - } else if (8192 <= code && code <= 8203) { - return "w"; - } else if (code == 8204) { - return "b"; - } else { - return "L"; - } - } - __name(charType, "charType"); - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, - isStrong = /[LRr]/, - countsAsLeft = /[Lb1n]/, - countsAsNum = /[1n]/; - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; - this.to = to; - } - __name(BidiSpan, "BidiSpan"); - return function (str, direction) { - var outerType = direction == "ltr" ? "L" : "R"; - if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { - return false; - } - var len = str.length, - types = []; - for (var i2 = 0; i2 < len; ++i2) { - types.push(charType(str.charCodeAt(i2))); - } - for (var i$12 = 0, prev = outerType; i$12 < len; ++i$12) { - var type = types[i$12]; - if (type == "m") { - types[i$12] = prev; - } else { - prev = type; - } - } - for (var i$22 = 0, cur = outerType; i$22 < len; ++i$22) { - var type$1 = types[i$22]; - if (type$1 == "1" && cur == "r") { - types[i$22] = "n"; - } else if (isStrong.test(type$1)) { - cur = type$1; - if (type$1 == "r") { - types[i$22] = "R"; - } - } - } - for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3]; - if (type$2 == "+" && prev$1 == "1" && types[i$3 + 1] == "1") { - types[i$3] = "1"; - } else if (type$2 == "," && prev$1 == types[i$3 + 1] && (prev$1 == "1" || prev$1 == "n")) { - types[i$3] = prev$1; - } - prev$1 = type$2; - } - for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4]; - if (type$3 == ",") { - types[i$4] = "N"; - } else if (type$3 == "%") { - var end = void 0; - for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = i$4 && types[i$4 - 1] == "!" || end < len && types[end] == "1" ? "1" : "N"; - for (var j = i$4; j < end; ++j) { - types[j] = replace; - } - i$4 = end - 1; - } - } - for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5]; - if (cur$1 == "L" && type$4 == "1") { - types[i$5] = "L"; - } else if (isStrong.test(type$4)) { - cur$1 = type$4; - } - } - for (var i$6 = 0; i$6 < len; ++i$6) { - if (isNeutral.test(types[i$6])) { - var end$1 = void 0; - for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6 - 1] : outerType) == "L"; - var after = (end$1 < len ? types[end$1] : outerType) == "L"; - var replace$1 = before == after ? before ? "L" : "R" : outerType; - for (var j$1 = i$6; j$1 < end$1; ++j$1) { - types[j$1] = replace$1; - } - i$6 = end$1 - 1; - } - } - var order = [], - m; - for (var i$7 = 0; i$7 < len;) { - if (countsAsLeft.test(types[i$7])) { - var start = i$7; - for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)); - } else { - var pos = i$7, - at = order.length, - isRTL = direction == "rtl" ? 1 : 0; - for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} - for (var j$2 = pos; j$2 < i$7;) { - if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { - order.splice(at, 0, new BidiSpan(1, pos, j$2)); - at += isRTL; - } - var nstart = j$2; - for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)); - at += isRTL; - pos = j$2; - } else { - ++j$2; - } - } - if (pos < i$7) { - order.splice(at, 0, new BidiSpan(1, pos, i$7)); - } - } - } - if (direction == "ltr") { - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - } - return direction == "rtl" ? order.reverse() : order; - }; - }(); - function getOrder(line, direction) { - var order = line.order; - if (order == null) { - order = line.order = bidiOrdering(line.text, direction); - } - return order; - } - __name(getOrder, "getOrder"); - var noHandlers = []; - var on = /* @__PURE__ */__name(function (emitter, type, f) { - if (emitter.addEventListener) { - emitter.addEventListener(type, f, false); - } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f); - } else { - var map2 = emitter._handlers || (emitter._handlers = {}); - map2[type] = (map2[type] || noHandlers).concat(f); - } - }, "on"); - function getHandlers(emitter, type) { - return emitter._handlers && emitter._handlers[type] || noHandlers; - } - __name(getHandlers, "getHandlers"); - function off(emitter, type, f) { - if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false); - } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f); - } else { - var map2 = emitter._handlers, - arr = map2 && map2[type]; - if (arr) { - var index = indexOf(arr, f); - if (index > -1) { - map2[type] = arr.slice(0, index).concat(arr.slice(index + 1)); - } - } - } - } - __name(off, "off"); - function signal(emitter, type) { - var handlers = getHandlers(emitter, type); - if (!handlers.length) { - return; - } - var args = Array.prototype.slice.call(arguments, 2); - for (var i2 = 0; i2 < handlers.length; ++i2) { - handlers[i2].apply(null, args); - } - } - __name(signal, "signal"); - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") { - e = { - type: e, - preventDefault: function () { - this.defaultPrevented = true; - } - }; - } - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - __name(signalDOMEvent, "signalDOMEvent"); - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) { - return; - } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i2 = 0; i2 < arr.length; ++i2) { - if (indexOf(set, arr[i2]) == -1) { - set.push(arr[i2]); - } - } - } - __name(signalCursorActivity, "signalCursorActivity"); - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0; - } - __name(hasHandler, "hasHandler"); - function eventMixin(ctor) { - ctor.prototype.on = function (type, f) { - on(this, type, f); - }; - ctor.prototype.off = function (type, f) { - off(this, type, f); - }; - } - __name(eventMixin, "eventMixin"); - function e_preventDefault(e) { - if (e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - } - __name(e_preventDefault, "e_preventDefault"); - function e_stopPropagation(e) { - if (e.stopPropagation) { - e.stopPropagation(); - } else { - e.cancelBubble = true; - } - } - __name(e_stopPropagation, "e_stopPropagation"); - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; - } - __name(e_defaultPrevented, "e_defaultPrevented"); - function e_stop(e) { - e_preventDefault(e); - e_stopPropagation(e); - } - __name(e_stop, "e_stop"); - function e_target(e) { - return e.target || e.srcElement; - } - __name(e_target, "e_target"); - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) { - b = 1; - } else if (e.button & 2) { - b = 3; - } else if (e.button & 4) { - b = 2; - } - } - if (mac && e.ctrlKey && b == 1) { - b = 3; - } - return b; - } - __name(e_button, "e_button"); - var dragAndDrop = function () { - if (ie && ie_version < 9) { - return false; - } - var div = elt("div"); - return "draggable" in div || "dragDrop" in div; - }(); - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200B"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) { - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } - } - var node = zwspSupported ? elt("span", "\u200B") : elt("span", "\xA0", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node; - } - __name(zeroWidthElement, "zeroWidthElement"); - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) { - return badBidiRects; - } - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062EA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - var r1 = range(txt, 1, 2).getBoundingClientRect(); - removeChildren(measure); - if (!r0 || r0.left == r0.right) { - return false; - } - return badBidiRects = r1.right - r0.right < 3; - } - __name(hasBadBidiRects, "hasBadBidiRects"); - var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, - result = [], - l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) { - nl = string.length; - } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function (string) { - return string.split(/\r\n?|\n/); - }; - var hasSelection = window.getSelection ? function (te) { - try { - return te.selectionStart != te.selectionEnd; - } catch (e) { - return false; - } - } : function (te) { - var range2; - try { - range2 = te.ownerDocument.selection.createRange(); - } catch (e) {} - if (!range2 || range2.parentElement() != te) { - return false; - } - return range2.compareEndPoints("StartToEnd", range2) != 0; - }; - var hasCopyEvent = function () { - var e = elt("div"); - if ("oncopy" in e) { - return true; - } - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - }(); - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) { - return badZoomedRects; - } - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - __name(hasBadZoomedRects, "hasBadZoomedRects"); - var modes = {}, - mimeModes = {}; - function defineMode(name, mode) { - if (arguments.length > 2) { - mode.dependencies = Array.prototype.slice.call(arguments, 2); - } - modes[name] = mode; - } - __name(defineMode, "defineMode"); - function defineMIME(mime, spec) { - mimeModes[mime] = spec; - } - __name(defineMIME, "defineMIME"); - function resolveMode(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") { - found = { - name: found - }; - } - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return resolveMode("application/xml"); - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return resolveMode("application/json"); - } - if (typeof spec == "string") { - return { - name: spec - }; - } else { - return spec || { - name: "null" - }; - } - } - __name(resolveMode, "resolveMode"); - function getMode(options, spec) { - spec = resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) { - return getMode(options, "text/plain"); - } - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop2 in exts) { - if (!exts.hasOwnProperty(prop2)) { - continue; - } - if (modeObj.hasOwnProperty(prop2)) { - modeObj["_" + prop2] = modeObj[prop2]; - } - modeObj[prop2] = exts[prop2]; - } - } - modeObj.name = spec.name; - if (spec.helperType) { - modeObj.helperType = spec.helperType; - } - if (spec.modeProps) { - for (var prop$1 in spec.modeProps) { - modeObj[prop$1] = spec.modeProps[prop$1]; - } - } - return modeObj; - } - __name(getMode, "getMode"); - var modeExtensions = {}; - function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : modeExtensions[mode] = {}; - copyObj(properties, exts); - } - __name(extendMode, "extendMode"); - function copyState(mode, state) { - if (state === true) { - return state; - } - if (mode.copyState) { - return mode.copyState(state); - } - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) { - val = val.concat([]); - } - nstate[n] = val; - } - return nstate; - } - __name(copyState, "copyState"); - function innerMode(mode, state) { - var info; - while (mode.innerMode) { - info = mode.innerMode(state); - if (!info || info.mode == mode) { - break; - } - state = info.state; - mode = info.mode; - } - return info || { - mode, - state - }; - } - __name(innerMode, "innerMode"); - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - } - __name(startState, "startState"); - var StringStream = /* @__PURE__ */__name(function (string, tabSize, lineOracle) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - this.lineOracle = lineOracle; - }, "StringStream"); - StringStream.prototype.eol = function () { - return this.pos >= this.string.length; - }; - StringStream.prototype.sol = function () { - return this.pos == this.lineStart; - }; - StringStream.prototype.peek = function () { - return this.string.charAt(this.pos) || void 0; - }; - StringStream.prototype.next = function () { - if (this.pos < this.string.length) { - return this.string.charAt(this.pos++); - } - }; - StringStream.prototype.eat = function (match) { - var ch = this.string.charAt(this.pos); - var ok; - if (typeof match == "string") { - ok = ch == match; - } else { - ok = ch && (match.test ? match.test(ch) : match(ch)); - } - if (ok) { - ++this.pos; - return ch; - } - }; - StringStream.prototype.eatWhile = function (match) { - var start = this.pos; - while (this.eat(match)) {} - return this.pos > start; - }; - StringStream.prototype.eatSpace = function () { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { - ++this.pos; - } - return this.pos > start; - }; - StringStream.prototype.skipToEnd = function () { - this.pos = this.string.length; - }; - StringStream.prototype.skipTo = function (ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) { - this.pos = found; - return true; - } - }; - StringStream.prototype.backUp = function (n) { - this.pos -= n; - }; - StringStream.prototype.column = function () { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }; - StringStream.prototype.indentation = function () { - return countColumn(this.string, null, this.tabSize) - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }; - StringStream.prototype.match = function (pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = /* @__PURE__ */__name(function (str) { - return caseInsensitive ? str.toLowerCase() : str; - }, "cased"); - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) { - this.pos += pattern.length; - } - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) { - return null; - } - if (match && consume !== false) { - this.pos += match[0].length; - } - return match; - } - }; - StringStream.prototype.current = function () { - return this.string.slice(this.start, this.pos); - }; - StringStream.prototype.hideFirstChars = function (n, inner) { - this.lineStart += n; - try { - return inner(); - } finally { - this.lineStart -= n; - } - }; - StringStream.prototype.lookAhead = function (n) { - var oracle = this.lineOracle; - return oracle && oracle.lookAhead(n); - }; - StringStream.prototype.baseToken = function () { - var oracle = this.lineOracle; - return oracle && oracle.baseToken(this.pos); - }; - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) { - throw new Error("There is no line " + (n + doc.first) + " in the document."); - } - var chunk = doc; - while (!chunk.lines) { - for (var i2 = 0;; ++i2) { - var child = chunk.children[i2], - sz = child.chunkSize(); - if (n < sz) { - chunk = child; - break; - } - n -= sz; - } - } - return chunk.lines[n]; - } - __name(getLine, "getLine"); - function getBetween(doc, start, end) { - var out = [], - n = start.line; - doc.iter(start.line, end.line + 1, function (line) { - var text = line.text; - if (n == end.line) { - text = text.slice(0, end.ch); - } - if (n == start.line) { - text = text.slice(start.ch); - } - out.push(text); - ++n; - }); - return out; - } - __name(getBetween, "getBetween"); - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function (line) { - out.push(line.text); - }); - return out; - } - __name(getLines, "getLines"); - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) { - for (var n = line; n; n = n.parent) { - n.height += diff; - } - } - } - __name(updateLineHeight, "updateLineHeight"); - function lineNo(line) { - if (line.parent == null) { - return null; - } - var cur = line.parent, - no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i2 = 0;; ++i2) { - if (chunk.children[i2] == cur) { - break; - } - no += chunk.children[i2].chunkSize(); - } - } - return no + cur.first; - } - __name(lineNo, "lineNo"); - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i$12 = 0; i$12 < chunk.children.length; ++i$12) { - var child = chunk.children[i$12], - ch = child.height; - if (h < ch) { - chunk = child; - continue outer; - } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - var i2 = 0; - for (; i2 < chunk.lines.length; ++i2) { - var line = chunk.lines[i2], - lh = line.height; - if (h < lh) { - break; - } - h -= lh; - } - return n + i2; - } - __name(lineAtHeight, "lineAtHeight"); - function isLine(doc, l) { - return l >= doc.first && l < doc.first + doc.size; - } - __name(isLine, "isLine"); - function lineNumberFor(options, i2) { - return String(options.lineNumberFormatter(i2 + options.firstLineNumber)); - } - __name(lineNumberFor, "lineNumberFor"); - function Pos(line, ch, sticky) { - if (sticky === void 0) sticky = null; - if (!(this instanceof Pos)) { - return new Pos(line, ch, sticky); - } - this.line = line; - this.ch = ch; - this.sticky = sticky; - } - __name(Pos, "Pos"); - function cmp(a, b) { - return a.line - b.line || a.ch - b.ch; - } - __name(cmp, "cmp"); - function equalCursorPos(a, b) { - return a.sticky == b.sticky && cmp(a, b) == 0; - } - __name(equalCursorPos, "equalCursorPos"); - function copyPos(x) { - return Pos(x.line, x.ch); - } - __name(copyPos, "copyPos"); - function maxPos(a, b) { - return cmp(a, b) < 0 ? b : a; - } - __name(maxPos, "maxPos"); - function minPos(a, b) { - return cmp(a, b) < 0 ? a : b; - } - __name(minPos, "minPos"); - function clipLine(doc, n) { - return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1)); - } - __name(clipLine, "clipLine"); - function clipPos(doc, pos) { - if (pos.line < doc.first) { - return Pos(doc.first, 0); - } - var last = doc.first + doc.size - 1; - if (pos.line > last) { - return Pos(last, getLine(doc, last).text.length); - } - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - __name(clipPos, "clipPos"); - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) { - return Pos(pos.line, linelen); - } else if (ch < 0) { - return Pos(pos.line, 0); - } else { - return pos; - } - } - __name(clipToLen, "clipToLen"); - function clipPosArray(doc, array) { - var out = []; - for (var i2 = 0; i2 < array.length; i2++) { - out[i2] = clipPos(doc, array[i2]); - } - return out; - } - __name(clipPosArray, "clipPosArray"); - var SavedContext = /* @__PURE__ */__name(function (state, lookAhead) { - this.state = state; - this.lookAhead = lookAhead; - }, "SavedContext"); - var Context = /* @__PURE__ */__name(function (doc, state, line, lookAhead) { - this.state = state; - this.doc = doc; - this.line = line; - this.maxLookAhead = lookAhead || 0; - this.baseTokens = null; - this.baseTokenPos = 1; - }, "Context"); - Context.prototype.lookAhead = function (n) { - var line = this.doc.getLine(this.line + n); - if (line != null && n > this.maxLookAhead) { - this.maxLookAhead = n; - } - return line; - }; - Context.prototype.baseToken = function (n) { - if (!this.baseTokens) { - return null; - } - while (this.baseTokens[this.baseTokenPos] <= n) { - this.baseTokenPos += 2; - } - var type = this.baseTokens[this.baseTokenPos + 1]; - return { - type: type && type.replace(/( |^)overlay .*/, ""), - size: this.baseTokens[this.baseTokenPos] - n - }; - }; - Context.prototype.nextLine = function () { - this.line++; - if (this.maxLookAhead > 0) { - this.maxLookAhead--; - } - }; - Context.fromSaved = function (doc, saved, line) { - if (saved instanceof SavedContext) { - return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead); - } else { - return new Context(doc, copyState(doc.mode, saved), line); - } - }; - Context.prototype.save = function (copy) { - var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; - return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state; - }; - function highlightLine(cm, line, context, forceToEnd) { - var st = [cm.state.modeGen], - lineClasses = {}; - runMode(cm, line.text, cm.doc.mode, context, function (end, style) { - return st.push(end, style); - }, lineClasses, forceToEnd); - var state = context.state; - var loop = /* @__PURE__ */__name(function (o2) { - context.baseTokens = st; - var overlay = cm.state.overlays[o2], - i2 = 1, - at = 0; - context.state = true; - runMode(cm, line.text, overlay.mode, context, function (end, style) { - var start = i2; - while (at < end) { - var i_end = st[i2]; - if (i_end > end) { - st.splice(i2, 1, end, st[i2 + 1], i_end); - } - i2 += 2; - at = Math.min(end, i_end); - } - if (!style) { - return; - } - if (overlay.opaque) { - st.splice(start, i2 - start, end, "overlay " + style); - i2 = start + 2; - } else { - for (; start < i2; start += 2) { - var cur = st[start + 1]; - st[start + 1] = (cur ? cur + " " : "") + "overlay " + style; - } - } - }, lineClasses); - context.state = state; - context.baseTokens = null; - context.baseTokenPos = 1; - }, "loop"); - for (var o = 0; o < cm.state.overlays.length; ++o) loop(o); - return { - styles: st, - classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null - }; - } - __name(highlightLine, "highlightLine"); - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var context = getContextBefore(cm, lineNo(line)); - var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); - var result = highlightLine(cm, line, context); - if (resetState) { - context.state = resetState; - } - line.stateAfter = context.save(!resetState); - line.styles = result.styles; - if (result.classes) { - line.styleClasses = result.classes; - } else if (line.styleClasses) { - line.styleClasses = null; - } - if (updateFrontier === cm.doc.highlightFrontier) { - cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); - } - } - return line.styles; - } - __name(getLineStyles, "getLineStyles"); - function getContextBefore(cm, n, precise) { - var doc = cm.doc, - display = cm.display; - if (!doc.mode.startState) { - return new Context(doc, true, n); - } - var start = findStartLine(cm, n, precise); - var saved = start > doc.first && getLine(doc, start - 1).stateAfter; - var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); - doc.iter(start, n, function (line) { - processLine(cm, line.text, context); - var pos = context.line; - line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; - context.nextLine(); - }); - if (precise) { - doc.modeFrontier = context.line; - } - return context; - } - __name(getContextBefore, "getContextBefore"); - function processLine(cm, text, context, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize, context); - stream.start = stream.pos = startAt || 0; - if (text == "") { - callBlankLine(mode, context.state); - } - while (!stream.eol()) { - readToken(mode, stream, context.state); - stream.start = stream.pos; - } - } - __name(processLine, "processLine"); - function callBlankLine(mode, state) { - if (mode.blankLine) { - return mode.blankLine(state); - } - if (!mode.innerMode) { - return; - } - var inner = innerMode(mode, state); - if (inner.mode.blankLine) { - return inner.mode.blankLine(inner.state); - } - } - __name(callBlankLine, "callBlankLine"); - function readToken(mode, stream, state, inner) { - for (var i2 = 0; i2 < 10; i2++) { - if (inner) { - inner[0] = innerMode(mode, state).mode; - } - var style = mode.token(stream, state); - if (stream.pos > stream.start) { - return style; - } - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - __name(readToken, "readToken"); - var Token = /* @__PURE__ */__name(function (stream, type, state) { - this.start = stream.start; - this.end = stream.pos; - this.string = stream.current(); - this.type = type || null; - this.state = state; - }, "Token"); - function takeToken(cm, pos, precise, asArray) { - var doc = cm.doc, - mode = doc.mode, - style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), - context = getContextBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize, context), - tokens; - if (asArray) { - tokens = []; - } - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, context.state); - if (asArray) { - tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); - } - } - return asArray ? tokens : new Token(stream, style, context.state); - } - __name(takeToken, "takeToken"); - function extractLineClasses(type, output) { - if (type) { - for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) { - break; - } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop2 = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop2] == null) { - output[prop2] = lineClass[2]; - } else if (!new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)").test(output[prop2])) { - output[prop2] += " " + lineClass[2]; - } - } - } - return type; - } - __name(extractLineClasses, "extractLineClasses"); - function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) { - flattenSpans = cm.options.flattenSpans; - } - var curStart = 0, - curStyle = null; - var stream = new StringStream(text, cm.options.tabSize, context), - style; - var inner = cm.options.addModeClass && [null]; - if (text == "") { - extractLineClasses(callBlankLine(mode, context.state), lineClasses); - } - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) { - processLine(cm, text, context, stream.pos); - } - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) { - style = "m-" + (style ? mName + " " + style : mName); - } - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5e3); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - var pos = Math.min(stream.pos, curStart + 5e3); - f(pos, curStyle); - curStart = pos; - } - } - __name(runMode, "runMode"); - function findStartLine(cm, n, precise) { - var minindent, - minline, - doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1e3 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) { - return doc.first; - } - var line = getLine(doc, search - 1), - after = line.stateAfter; - if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { - return search; - } - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - __name(findStartLine, "findStartLine"); - function retreatFrontier(doc, n) { - doc.modeFrontier = Math.min(doc.modeFrontier, n); - if (doc.highlightFrontier < n - 10) { - return; - } - var start = doc.first; - for (var line = n - 1; line > start; line--) { - var saved = getLine(doc, line).stateAfter; - if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { - start = line + 1; - break; - } - } - doc.highlightFrontier = Math.min(doc.highlightFrontier, start); - } - __name(retreatFrontier, "retreatFrontier"); - var sawReadOnlySpans = false, - sawCollapsedSpans = false; - function seeReadOnlySpans() { - sawReadOnlySpans = true; - } - __name(seeReadOnlySpans, "seeReadOnlySpans"); - function seeCollapsedSpans() { - sawCollapsedSpans = true; - } - __name(seeCollapsedSpans, "seeCollapsedSpans"); - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; - this.to = to; - } - __name(MarkedSpan, "MarkedSpan"); - function getMarkedSpanFor(spans, marker) { - if (spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if (span.marker == marker) { - return span; - } - } - } - } - __name(getMarkedSpanFor, "getMarkedSpanFor"); - function removeMarkedSpan(spans, span) { - var r; - for (var i2 = 0; i2 < spans.length; ++i2) { - if (spans[i2] != span) { - (r || (r = [])).push(spans[i2]); - } - } - return r; - } - __name(removeMarkedSpan, "removeMarkedSpan"); - function addMarkedSpan(line, span, op) { - var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = /* @__PURE__ */new WeakSet())); - if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) { - line.markedSpans.push(span); - } else { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - if (inThisOp) { - inThisOp.add(line.markedSpans); - } - } - span.marker.attachLine(line); - } - __name(addMarkedSpan, "addMarkedSpan"); - function markedSpansBefore(old, startCh, isInsert) { - var nw; - if (old) { - for (var i2 = 0; i2 < old.length; ++i2) { - var span = old[i2], - marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - } - return nw; - } - __name(markedSpansBefore, "markedSpansBefore"); - function markedSpansAfter(old, endCh, isInsert) { - var nw; - if (old) { - for (var i2 = 0; i2 < old.length; ++i2) { - var span = old[i2], - marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, span.to == null ? null : span.to - endCh)); - } - } - } - return nw; - } - __name(markedSpansAfter, "markedSpansAfter"); - function stretchSpansOverChange(doc, change) { - if (change.full) { - return null; - } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) { - return null; - } - var startCh = change.from.ch, - endCh = change.to.ch, - isInsert = cmp(change.from, change.to) == 0; - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - var sameLine = change.text.length == 1, - offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - for (var i2 = 0; i2 < first.length; ++i2) { - var span = first[i2]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) { - span.to = startCh; - } else if (sameLine) { - span.to = found.to == null ? null : found.to + offset; - } - } - } - } - if (last) { - for (var i$12 = 0; i$12 < last.length; ++i$12) { - var span$1 = last[i$12]; - if (span$1.to != null) { - span$1.to += offset; - } - if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker); - if (!found$1) { - span$1.from = offset; - if (sameLine) { - (first || (first = [])).push(span$1); - } - } - } else { - span$1.from += offset; - if (sameLine) { - (first || (first = [])).push(span$1); - } - } - } - } - if (first) { - first = clearEmptySpans(first); - } - if (last && last != first) { - last = clearEmptySpans(last); - } - var newMarkers = [first]; - if (!sameLine) { - var gap = change.text.length - 2, - gapMarkers; - if (gap > 0 && first) { - for (var i$22 = 0; i$22 < first.length; ++i$22) { - if (first[i$22].to == null) { - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$22].marker, null, null)); - } - } - } - for (var i$3 = 0; i$3 < gap; ++i$3) { - newMarkers.push(gapMarkers); - } - newMarkers.push(last); - } - return newMarkers; - } - __name(stretchSpansOverChange, "stretchSpansOverChange"); - function clearEmptySpans(spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { - spans.splice(i2--, 1); - } - } - if (!spans.length) { - return null; - } - return spans; - } - __name(clearEmptySpans, "clearEmptySpans"); - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function (line) { - if (line.markedSpans) { - for (var i3 = 0; i3 < line.markedSpans.length; ++i3) { - var mark = line.markedSpans[i3].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { - (markers || (markers = [])).push(mark); - } - } - } - }); - if (!markers) { - return null; - } - var parts = [{ - from, - to - }]; - for (var i2 = 0; i2 < markers.length; ++i2) { - var mk = markers[i2], - m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { - continue; - } - var newParts = [j, 1], - dfrom = cmp(p.from, m.from), - dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { - newParts.push({ - from: p.from, - to: m.from - }); - } - if (dto > 0 || !mk.inclusiveRight && !dto) { - newParts.push({ - from: m.to, - to: p.to - }); - } - parts.splice.apply(parts, newParts); - j += newParts.length - 3; - } - } - return parts; - } - __name(removeReadOnlyRanges, "removeReadOnlyRanges"); - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) { - return; - } - for (var i2 = 0; i2 < spans.length; ++i2) { - spans[i2].marker.detachLine(line); - } - line.markedSpans = null; - } - __name(detachMarkedSpans, "detachMarkedSpans"); - function attachMarkedSpans(line, spans) { - if (!spans) { - return; - } - for (var i2 = 0; i2 < spans.length; ++i2) { - spans[i2].marker.attachLine(line); - } - line.markedSpans = spans; - } - __name(attachMarkedSpans, "attachMarkedSpans"); - function extraLeft(marker) { - return marker.inclusiveLeft ? -1 : 0; - } - __name(extraLeft, "extraLeft"); - function extraRight(marker) { - return marker.inclusiveRight ? 1 : 0; - } - __name(extraRight, "extraRight"); - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) { - return lenDiff; - } - var aPos = a.find(), - bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) { - return -fromCmp; - } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) { - return toCmp; - } - return b.id - a.id; - } - __name(compareCollapsedMarkers, "compareCollapsedMarkers"); - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, - found; - if (sps) { - for (var sp = void 0, i2 = 0; i2 < sps.length; ++i2) { - sp = sps[i2]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { - found = sp.marker; - } - } - } - return found; - } - __name(collapsedSpanAtSide, "collapsedSpanAtSide"); - function collapsedSpanAtStart(line) { - return collapsedSpanAtSide(line, true); - } - __name(collapsedSpanAtStart, "collapsedSpanAtStart"); - function collapsedSpanAtEnd(line) { - return collapsedSpanAtSide(line, false); - } - __name(collapsedSpanAtEnd, "collapsedSpanAtEnd"); - function collapsedSpanAround(line, ch) { - var sps = sawCollapsedSpans && line.markedSpans, - found; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - var sp = sps[i2]; - if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { - found = sp.marker; - } - } - } - return found; - } - __name(collapsedSpanAround, "collapsedSpanAround"); - function conflictingCollapsedRange(doc, lineNo2, from, to, marker) { - var line = getLine(doc, lineNo2); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - var sp = sps[i2]; - if (!sp.marker.collapsed) { - continue; - } - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { - continue; - } - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { - return true; - } - } - } - } - __name(conflictingCollapsedRange, "conflictingCollapsedRange"); - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) { - line = merged.find(-1, true).line; - } - return line; - } - __name(visualLine, "visualLine"); - function visualLineEnd(line) { - var merged; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - } - return line; - } - __name(visualLineEnd, "visualLineEnd"); - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - __name(visualLineContinued, "visualLineContinued"); - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), - vis = visualLine(line); - if (line == vis) { - return lineN; - } - return lineNo(vis); - } - __name(visualLineNo, "visualLineNo"); - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) { - return lineN; - } - var line = getLine(doc, lineN), - merged; - if (!lineIsHidden(doc, line)) { - return lineN; - } - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - } - return lineNo(line) + 1; - } - __name(visualLineEndNo, "visualLineEndNo"); - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { - for (var sp = void 0, i2 = 0; i2 < sps.length; ++i2) { - sp = sps[i2]; - if (!sp.marker.collapsed) { - continue; - } - if (sp.from == null) { - return true; - } - if (sp.marker.widgetNode) { - continue; - } - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { - return true; - } - } - } - } - __name(lineIsHidden, "lineIsHidden"); - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) { - return true; - } - for (var sp = void 0, i2 = 0; i2 < line.markedSpans.length; ++i2) { - sp = line.markedSpans[i2]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && (sp.to == null || sp.to != span.from) && (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && lineIsHiddenInner(doc, line, sp)) { - return true; - } - } - } - __name(lineIsHiddenInner, "lineIsHiddenInner"); - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - var h = 0, - chunk = lineObj.parent; - for (var i2 = 0; i2 < chunk.lines.length; ++i2) { - var line = chunk.lines[i2]; - if (line == lineObj) { - break; - } else { - h += line.height; - } - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i$12 = 0; i$12 < p.children.length; ++i$12) { - var cur = p.children[i$12]; - if (cur == chunk) { - break; - } else { - h += cur.height; - } - } - } - return h; - } - __name(heightAtLine, "heightAtLine"); - function lineLength(line) { - if (line.height == 0) { - return 0; - } - var len = line.text.length, - merged, - cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true); - len -= cur.text.length - found$1.from.ch; - cur = found$1.to.line; - len += cur.text.length - found$1.to.ch; - } - return len; - } - __name(lineLength, "lineLength"); - function findMaxLine(cm) { - var d = cm.display, - doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function (line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - __name(findMaxLine, "findMaxLine"); - var Line = /* @__PURE__ */__name(function (text, markedSpans, estimateHeight2) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight2 ? estimateHeight2(this) : 1; - }, "Line"); - Line.prototype.lineNo = function () { - return lineNo(this); - }; - eventMixin(Line); - function updateLine(line, text, markedSpans, estimateHeight2) { - line.text = text; - if (line.stateAfter) { - line.stateAfter = null; - } - if (line.styles) { - line.styles = null; - } - if (line.order != null) { - line.order = null; - } - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight2 ? estimateHeight2(line) : 1; - if (estHeight != line.height) { - updateLineHeight(line, estHeight); - } - } - __name(updateLine, "updateLine"); - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - __name(cleanUpLine, "cleanUpLine"); - var styleToClassCache = {}, - styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) { - return null; - } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - __name(interpretTokenStyle, "interpretTokenStyle"); - function buildLineContent(cm, lineView) { - var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = { - pre: eltP("pre", [content], "CodeMirror-line"), - content, - col: 0, - pos: 0, - cm, - trailingSpace: false, - splitSpaces: cm.getOption("lineWrapping") - }; - lineView.measure = {}; - for (var i2 = 0; i2 <= (lineView.rest ? lineView.rest.length : 0); i2++) { - var line = i2 ? lineView.rest[i2 - 1] : lineView.line, - order = void 0; - builder.pos = 0; - builder.addToken = buildToken; - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { - builder.addToken = buildTokenBadBidi(builder.addToken, order); - } - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) { - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - } - if (line.styleClasses.textClass) { - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - } - if (builder.map.length == 0) { - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - } - if (i2 == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - if (webkit) { - var last = builder.content.lastChild; - if (/\bcm-tab\b/.test(last.className) || last.querySelector && last.querySelector(".cm-tab")) { - builder.content.className = "cm-tab-wrap-hack"; - } - } - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) { - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - } - return builder; - } - __name(buildLineContent, "buildLineContent"); - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token; - } - __name(defaultSpecialCharPlaceholder, "defaultSpecialCharPlaceholder"); - function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { - if (!text) { - return; - } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; - var special = builder.cm.state.specialChars, - mustWrap = false; - var content; - if (!special.test(text)) { - builder.col += text.length; - content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) { - mustWrap = true; - } - builder.pos += text.length; - } else { - content = document.createDocumentFragment(); - var pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) { - content.appendChild(elt("span", [txt])); - } else { - content.appendChild(txt); - } - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) { - break; - } - pos += skipped + 1; - var txt$1 = void 0; - if (m[0] == " ") { - var tabSize = builder.cm.options.tabSize, - tabWidth = tabSize - builder.col % tabSize; - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt$1.setAttribute("role", "presentation"); - txt$1.setAttribute("cm-text", " "); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240D" : "\u2424", "cm-invalidchar")); - txt$1.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); - txt$1.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) { - content.appendChild(elt("span", [txt$1])); - } else { - content.appendChild(txt$1); - } - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt$1); - builder.pos++; - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; - if (style || startStyle || endStyle || mustWrap || css || attributes) { - var fullStyle = style || ""; - if (startStyle) { - fullStyle += startStyle; - } - if (endStyle) { - fullStyle += endStyle; - } - var token = elt("span", [content], fullStyle, css); - if (attributes) { - for (var attr in attributes) { - if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") { - token.setAttribute(attr, attributes[attr]); - } - } - } - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - __name(buildToken, "buildToken"); - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) { - return text; - } - var spaceBefore = trailingBefore, - result = ""; - for (var i2 = 0; i2 < text.length; i2++) { - var ch = text.charAt(i2); - if (ch == " " && spaceBefore && (i2 == text.length - 1 || text.charCodeAt(i2 + 1) == 32)) { - ch = "\xA0"; - } - result += ch; - spaceBefore = ch == " "; - } - return result; - } - __name(splitSpaces, "splitSpaces"); - function buildTokenBadBidi(inner, order) { - return function (builder, text, style, startStyle, endStyle, css, attributes) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, - end = start + text.length; - for (;;) { - var part = void 0; - for (var i2 = 0; i2 < order.length; i2++) { - part = order[i2]; - if (part.to > start && part.from <= start) { - break; - } - } - if (part.to >= end) { - return inner(builder, text, style, startStyle, endStyle, css, attributes); - } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - __name(buildTokenBadBidi, "buildTokenBadBidi"); - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { - builder.map.push(builder.pos, builder.pos + size, widget); - } - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) { - widget = builder.content.appendChild(document.createElement("span")); - } - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - builder.trailingSpace = false; - } - __name(buildCollapsedSpan, "buildCollapsedSpan"); - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, - allText = line.text, - at = 0; - if (!spans) { - for (var i$12 = 1; i$12 < styles.length; i$12 += 2) { - builder.addToken(builder, allText.slice(at, at = styles[i$12]), interpretTokenStyle(styles[i$12 + 1], builder.cm.options)); - } - return; - } - var len = allText.length, - pos = 0, - i2 = 1, - text = "", - style, - css; - var nextChange = 0, - spanStyle, - spanEndStyle, - spanStartStyle, - collapsed, - attributes; - for (;;) { - if (nextChange == pos) { - spanStyle = spanEndStyle = spanStartStyle = css = ""; - attributes = null; - collapsed = null; - nextChange = Infinity; - var foundBookmarks = [], - endStyles = void 0; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], - m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) { - spanStyle += " " + m.className; - } - if (m.css) { - css = (css ? css + ";" : "") + m.css; - } - if (m.startStyle && sp.from == pos) { - spanStartStyle += " " + m.startStyle; - } - if (m.endStyle && sp.to == nextChange) { - (endStyles || (endStyles = [])).push(m.endStyle, sp.to); - } - if (m.title) { - (attributes || (attributes = {})).title = m.title; - } - if (m.attributes) { - for (var attr in m.attributes) { - (attributes || (attributes = {}))[attr] = m.attributes[attr]; - } - } - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { - collapsed = sp; - } - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (endStyles) { - for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { - if (endStyles[j$1 + 1] == nextChange) { - spanEndStyle += " " + endStyles[j$1]; - } - } - } - if (!collapsed || collapsed.from == pos) { - for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { - buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); - } - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); - if (collapsed.to == null) { - return; - } - if (collapsed.to == pos) { - collapsed = false; - } - } - } - if (pos >= len) { - break; - } - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); - } - if (end >= upto) { - text = text.slice(upto - pos); - pos = upto; - break; - } - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i2++]); - style = interpretTokenStyle(styles[i2++], builder.cm.options); - } - } - } - __name(insertLineContent, "insertLineContent"); - function LineView(doc, line, lineN) { - this.line = line; - this.rest = visualLineContinued(line); - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - __name(LineView, "LineView"); - function buildViewArray(cm, from, to) { - var array = [], - nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - __name(buildViewArray, "buildViewArray"); - var operationGroup = null; - function pushOperation(op) { - if (operationGroup) { - operationGroup.ops.push(op); - } else { - op.ownsGroup = operationGroup = { - ops: [op], - delayedCallbacks: [] - }; - } - } - __name(pushOperation, "pushOperation"); - function fireCallbacksForOps(group) { - var callbacks = group.delayedCallbacks, - i2 = 0; - do { - for (; i2 < callbacks.length; i2++) { - callbacks[i2].call(null); - } - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) { - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) { - op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); - } - } - } - } while (i2 < callbacks.length); - } - __name(fireCallbacksForOps, "fireCallbacksForOps"); - function finishOperation(op, endCb) { - var group = op.ownsGroup; - if (!group) { - return; - } - try { - fireCallbacksForOps(group); - } finally { - operationGroup = null; - endCb(group); - } - } - __name(finishOperation, "finishOperation"); - var orphanDelayedCallbacks = null; - function signalLater(emitter, type) { - var arr = getHandlers(emitter, type); - if (!arr.length) { - return; - } - var args = Array.prototype.slice.call(arguments, 2), - list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - var loop = /* @__PURE__ */__name(function (i3) { - list.push(function () { - return arr[i3].apply(null, args); - }); - }, "loop"); - for (var i2 = 0; i2 < arr.length; ++i2) loop(i2); - } - __name(signalLater, "signalLater"); - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i2 = 0; i2 < delayed.length; ++i2) { - delayed[i2](); - } - } - __name(fireOrphanDelayed, "fireOrphanDelayed"); - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") { - updateLineText(cm, lineView); - } else if (type == "gutter") { - updateLineGutter(cm, lineView, lineN, dims); - } else if (type == "class") { - updateLineClasses(cm, lineView); - } else if (type == "widget") { - updateLineWidgets(cm, lineView, dims); - } - } - lineView.changes = null; - } - __name(updateLineForChanges, "updateLineForChanges"); - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) { - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - } - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) { - lineView.node.style.zIndex = 2; - } - } - return lineView.node; - } - __name(ensureLineWrapped, "ensureLineWrapped"); - function updateLineBackground(cm, lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) { - cls += " CodeMirror-linebackground"; - } - if (lineView.background) { - if (cls) { - lineView.background.className = cls; - } else { - lineView.background.parentNode.removeChild(lineView.background); - lineView.background = null; - } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - cm.display.input.setUneditable(lineView.background); - } - } - __name(updateLineBackground, "updateLineBackground"); - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - __name(getLineContent, "getLineContent"); - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) { - lineView.node = built.pre; - } - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(cm, lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - __name(updateLineText, "updateLineText"); - function updateLineClasses(cm, lineView) { - updateLineBackground(cm, lineView); - if (lineView.line.wrapClass) { - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - } else if (lineView.node != lineView.text) { - lineView.node.className = ""; - } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - __name(updateLineClasses, "updateLineClasses"); - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + dims.gutterTotalWidth + "px"); - cm.display.input.setUneditable(lineView.gutterBackground); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); - gutterWrap.setAttribute("aria-hidden", "true"); - cm.display.input.setUneditable(gutterWrap); - wrap$1.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) { - gutterWrap.className += " " + lineView.line.gutterClass; - } - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) { - lineView.lineNumber = gutterWrap.appendChild(elt("div", lineNumberFor(cm.options, lineN), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + cm.display.lineNumInnerWidth + "px")); - } - if (markers) { - for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { - var id = cm.display.gutterSpecs[k].className, - found = markers.hasOwnProperty(id) && markers[id]; - if (found) { - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - } - } - __name(updateLineGutter, "updateLineGutter"); - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { - lineView.alignable = null; - } - var isWidget = classTest("CodeMirror-linewidget"); - for (var node = lineView.node.firstChild, next = void 0; node; node = next) { - next = node.nextSibling; - if (isWidget.test(node.className)) { - lineView.node.removeChild(node); - } - } - insertLineWidgets(cm, lineView, dims); - } - __name(updateLineWidgets, "updateLineWidgets"); - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) { - lineView.bgClass = built.bgClass; - } - if (built.textClass) { - lineView.textClass = built.textClass; - } - updateLineClasses(cm, lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node; - } - __name(buildLineElement, "buildLineElement"); - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - insertLineWidgetsFor(cm, lineView.rest[i2], lineView, dims, false); - } - } - } - __name(insertLineWidgets, "insertLineWidgets"); - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) { - return; - } - var wrap = ensureLineWrapped(lineView); - for (var i2 = 0, ws = line.widgets; i2 < ws.length; ++i2) { - var widget = ws[i2], - node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); - if (!widget.handleMouseEvents) { - node.setAttribute("cm-ignore-events", "true"); - } - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) { - wrap.insertBefore(node, lineView.gutter || lineView.text); - } else { - wrap.appendChild(node); - } - signalLater(widget, "redraw"); - } - } - __name(insertLineWidgetsFor, "insertLineWidgetsFor"); - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) { - node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - } - __name(positionLineWidget, "positionLineWidget"); - function widgetHeight(widget) { - if (widget.height != null) { - return widget.height; - } - var cm = widget.doc.cm; - if (!cm) { - return 0; - } - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) { - parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; - } - if (widget.noHScroll) { - parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; - } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.parentNode.offsetHeight; - } - __name(widgetHeight, "widgetHeight"); - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true" || n.parentNode == display.sizer && n != display.mover) { - return true; - } - } - } - __name(eventInWidget, "eventInWidget"); - function paddingTop(display) { - return display.lineSpace.offsetTop; - } - __name(paddingTop, "paddingTop"); - function paddingVert(display) { - return display.mover.offsetHeight - display.lineSpace.offsetHeight; - } - __name(paddingVert, "paddingVert"); - function paddingH(display) { - if (display.cachedPaddingH) { - return display.cachedPaddingH; - } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = { - left: parseInt(style.paddingLeft), - right: parseInt(style.paddingRight) - }; - if (!isNaN(data.left) && !isNaN(data.right)) { - display.cachedPaddingH = data; - } - return data; - } - __name(paddingH, "paddingH"); - function scrollGap(cm) { - return scrollerGap - cm.display.nativeBarWidth; - } - __name(scrollGap, "scrollGap"); - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; - } - __name(displayWidth, "displayWidth"); - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; - } - __name(displayHeight, "displayHeight"); - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i2 = 0; i2 < rects.length - 1; i2++) { - var cur = rects[i2], - next = rects[i2 + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) { - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - } - heights.push(rect.bottom - rect.top); - } - } - __name(ensureLineHeights, "ensureLineHeights"); - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) { - return { - map: lineView.measure.map, - cache: lineView.measure.cache - }; - } - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - if (lineView.rest[i2] == line) { - return { - map: lineView.measure.maps[i2], - cache: lineView.measure.caches[i2] - }; - } - } - for (var i$12 = 0; i$12 < lineView.rest.length; i$12++) { - if (lineNo(lineView.rest[i$12]) > lineN) { - return { - map: lineView.measure.maps[i$12], - cache: lineView.measure.caches[i$12], - before: true - }; - } - } - } - } - __name(mapFromLineView, "mapFromLineView"); - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - __name(updateExternalMeasurement, "updateExternalMeasurement"); - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - __name(measureChar, "measureChar"); - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { - return cm.display.view[findViewIndex(cm, lineN)]; - } - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { - return ext; - } - } - __name(findViewForLine, "findViewForLine"); - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) { - view = updateExternalMeasurement(cm, line); - } - var info = mapFromLineView(view, line, lineN); - return { - line, - view, - rect: null, - map: info.map, - cache: info.cache, - before: info.before, - hasHeights: false - }; - } - __name(prepareMeasureForLine, "prepareMeasureForLine"); - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { - ch = -1; - } - var key = ch + (bias || ""), - found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) { - prepared.rect = prepared.view.text.getBoundingClientRect(); - } - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) { - prepared.cache[key] = found; - } - } - return { - left: found.left, - right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom - }; - } - __name(measureCharPrepared, "measureCharPrepared"); - var nullRect = { - left: 0, - right: 0, - top: 0, - bottom: 0 - }; - function nodeAndOffsetInLineMap(map2, ch, bias) { - var node, start, end, collapse, mStart, mEnd; - for (var i2 = 0; i2 < map2.length; i2 += 3) { - mStart = map2[i2]; - mEnd = map2[i2 + 1]; - if (ch < mStart) { - start = 0; - end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i2 == map2.length - 3 || ch == mEnd && map2[i2 + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) { - collapse = "right"; - } - } - if (start != null) { - node = map2[i2 + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) { - collapse = bias; - } - if (bias == "left" && start == 0) { - while (i2 && map2[i2 - 2] == map2[i2 - 3] && map2[i2 - 1].insertLeft) { - node = map2[(i2 -= 3) + 2]; - collapse = "left"; - } - } - if (bias == "right" && start == mEnd - mStart) { - while (i2 < map2.length - 3 && map2[i2 + 3] == map2[i2 + 4] && !map2[i2 + 5].insertLeft) { - node = map2[(i2 += 3) + 2]; - collapse = "right"; - } - } - break; - } - } - return { - node, - start, - end, - collapse, - coverStart: mStart, - coverEnd: mEnd - }; - } - __name(nodeAndOffsetInLineMap, "nodeAndOffsetInLineMap"); - function getUsefulRect(rects, bias) { - var rect = nullRect; - if (bias == "left") { - for (var i2 = 0; i2 < rects.length; i2++) { - if ((rect = rects[i2]).left != rect.right) { - break; - } - } - } else { - for (var i$12 = rects.length - 1; i$12 >= 0; i$12--) { - if ((rect = rects[i$12]).left != rect.right) { - break; - } - } - } - return rect; - } - __name(getUsefulRect, "getUsefulRect"); - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, - start = place.start, - end = place.end, - collapse = place.collapse; - var rect; - if (node.nodeType == 3) { - for (var i$12 = 0; i$12 < 4; i$12++) { - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { - --start; - } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { - ++end; - } - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { - rect = node.parentNode.getBoundingClientRect(); - } else { - rect = getUsefulRect(range(node, start, end).getClientRects(), bias); - } - if (rect.left || rect.right || start == 0) { - break; - } - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) { - rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } - } else { - if (start > 0) { - collapse = bias = "right"; - } - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) { - rect = rects[bias == "right" ? rects.length - 1 : 0]; - } else { - rect = node.getBoundingClientRect(); - } - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) { - rect = { - left: rSpan.left, - right: rSpan.left + charWidth(cm.display), - top: rSpan.top, - bottom: rSpan.bottom - }; - } else { - rect = nullRect; - } - } - var rtop = rect.top - prepared.rect.top, - rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - var i2 = 0; - for (; i2 < heights.length - 1; i2++) { - if (mid < heights[i2]) { - break; - } - } - var top = i2 ? heights[i2 - 1] : 0, - bot = heights[i2]; - var result = { - left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top, - bottom: bot - }; - if (!rect.left && !rect.right) { - result.bogus = true; - } - if (!cm.options.singleCursorHeightPerLine) { - result.rtop = rtop; - result.rbottom = rbot; - } - return result; - } - __name(measureCharInner, "measureCharInner"); - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { - return rect; - } - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return { - left: rect.left * scaleX, - right: rect.right * scaleX, - top: rect.top * scaleY, - bottom: rect.bottom * scaleY - }; - } - __name(maybeUpdateRectForZooming, "maybeUpdateRectForZooming"); - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) { - for (var i2 = 0; i2 < lineView.rest.length; i2++) { - lineView.measure.caches[i2] = {}; - } - } - } - } - __name(clearLineMeasurementCacheFor, "clearLineMeasurementCacheFor"); - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i2 = 0; i2 < cm.display.view.length; i2++) { - clearLineMeasurementCacheFor(cm.display.view[i2]); - } - } - __name(clearLineMeasurementCache, "clearLineMeasurementCache"); - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) { - cm.display.maxLineChanged = true; - } - cm.display.lineNumChars = null; - } - __name(clearCaches, "clearCaches"); - function pageScrollX() { - if (chrome && android) { - return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)); - } - return window.pageXOffset || (document.documentElement || document.body).scrollLeft; - } - __name(pageScrollX, "pageScrollX"); - function pageScrollY() { - if (chrome && android) { - return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)); - } - return window.pageYOffset || (document.documentElement || document.body).scrollTop; - } - __name(pageScrollY, "pageScrollY"); - function widgetTopHeight(lineObj) { - var ref = visualLine(lineObj); - var widgets = ref.widgets; - var height = 0; - if (widgets) { - for (var i2 = 0; i2 < widgets.length; ++i2) { - if (widgets[i2].above) { - height += widgetHeight(widgets[i2]); - } - } - } - return height; - } - __name(widgetTopHeight, "widgetTopHeight"); - function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets) { - var height = widgetTopHeight(lineObj); - rect.top += height; - rect.bottom += height; - } - if (context == "line") { - return rect; - } - if (!context) { - context = "local"; - } - var yOff = heightAtLine(lineObj); - if (context == "local") { - yOff += paddingTop(cm.display); - } else { - yOff -= cm.display.viewOffset; - } - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; - rect.right += xOff; - } - rect.top += yOff; - rect.bottom += yOff; - return rect; - } - __name(intoCoordSystem, "intoCoordSystem"); - function fromCoordSystem(cm, coords, context) { - if (context == "div") { - return coords; - } - var left = coords.left, - top = coords.top; - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return { - left: left - lineSpaceBox.left, - top: top - lineSpaceBox.top - }; - } - __name(fromCoordSystem, "fromCoordSystem"); - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { - lineObj = getLine(cm.doc, pos.line); - } - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); - } - __name(charCoords, "charCoords"); - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) { - preparedMeasure = prepareMeasureForLine(cm, lineObj); - } - function get(ch2, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch2, right ? "right" : "left", varHeight); - if (right) { - m.left = m.right; - } else { - m.right = m.left; - } - return intoCoordSystem(cm, lineObj, m, context); - } - __name(get, "get"); - var order = getOrder(lineObj, cm.doc.direction), - ch = pos.ch, - sticky = pos.sticky; - if (ch >= lineObj.text.length) { - ch = lineObj.text.length; - sticky = "before"; - } else if (ch <= 0) { - ch = 0; - sticky = "after"; - } - if (!order) { - return get(sticky == "before" ? ch - 1 : ch, sticky == "before"); - } - function getBidi(ch2, partPos2, invert) { - var part = order[partPos2], - right = part.level == 1; - return get(invert ? ch2 - 1 : ch2, right != invert); - } - __name(getBidi, "getBidi"); - var partPos = getBidiPartAt(order, ch, sticky); - var other = bidiOther; - var val = getBidi(ch, partPos, sticky == "before"); - if (other != null) { - val.other = getBidi(ch, other, sticky != "before"); - } - return val; - } - __name(cursorCoords, "cursorCoords"); - function estimateCoords(cm, pos) { - var left = 0; - pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) { - left = charWidth(cm.display) * pos.ch; - } - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return { - left, - right: left, - top, - bottom: top + lineObj.height - }; - } - __name(estimateCoords, "estimateCoords"); - function PosWithInfo(line, ch, sticky, outside, xRel) { - var pos = Pos(line, ch, sticky); - pos.xRel = xRel; - if (outside) { - pos.outside = outside; - } - return pos; - } - __name(PosWithInfo, "PosWithInfo"); - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) { - return PosWithInfo(doc.first, 0, null, -1, -1); - } - var lineN = lineAtHeight(doc, y), - last = doc.first + doc.size - 1; - if (lineN > last) { - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1); - } - if (x < 0) { - x = 0; - } - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); - if (!collapsed) { - return found; - } - var rangeEnd = collapsed.find(1); - if (rangeEnd.line == lineN) { - return rangeEnd; - } - lineObj = getLine(doc, lineN = rangeEnd.line); - } - } - __name(coordsChar, "coordsChar"); - function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { - y -= widgetTopHeight(lineObj); - var end = lineObj.text.length; - var begin = findFirst(function (ch) { - return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; - }, end, 0); - end = findFirst(function (ch) { - return measureCharPrepared(cm, preparedMeasure, ch).top > y; - }, begin, end); - return { - begin, - end - }; - } - __name(wrappedLineExtent, "wrappedLineExtent"); - function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { - if (!preparedMeasure) { - preparedMeasure = prepareMeasureForLine(cm, lineObj); - } - var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; - return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop); - } - __name(wrappedLineExtentChar, "wrappedLineExtentChar"); - function boxIsAfter(box, x, y, left) { - return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x; - } - __name(boxIsAfter, "boxIsAfter"); - function coordsCharInner(cm, lineObj, lineNo2, x, y) { - y -= heightAtLine(lineObj); - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - var widgetHeight2 = widgetTopHeight(lineObj); - var begin = 0, - end = lineObj.text.length, - ltr = true; - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)(cm, lineObj, lineNo2, preparedMeasure, order, x, y); - ltr = part.level != 1; - begin = ltr ? part.from : part.to - 1; - end = ltr ? part.to : part.from - 1; - } - var chAround = null, - boxAround = null; - var ch = findFirst(function (ch2) { - var box = measureCharPrepared(cm, preparedMeasure, ch2); - box.top += widgetHeight2; - box.bottom += widgetHeight2; - if (!boxIsAfter(box, x, y, false)) { - return false; - } - if (box.top <= y && box.left <= x) { - chAround = ch2; - boxAround = box; - } - return true; - }, begin, end); - var baseX, - sticky, - outside = false; - if (boxAround) { - var atLeft = x - boxAround.left < boxAround.right - x, - atStart = atLeft == ltr; - ch = chAround + (atStart ? 0 : 1); - sticky = atStart ? "after" : "before"; - baseX = atLeft ? boxAround.left : boxAround.right; - } else { - if (!ltr && (ch == end || ch == begin)) { - ch++; - } - sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight2 <= y == ltr ? "after" : "before"; - var coords = cursorCoords(cm, Pos(lineNo2, ch, sticky), "line", lineObj, preparedMeasure); - baseX = coords.left; - outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; - } - ch = skipExtendingChars(lineObj.text, ch, 1); - return PosWithInfo(lineNo2, ch, sticky, outside, x - baseX); - } - __name(coordsCharInner, "coordsCharInner"); - function coordsBidiPart(cm, lineObj, lineNo2, preparedMeasure, order, x, y) { - var index = findFirst(function (i2) { - var part2 = order[i2], - ltr2 = part2.level != 1; - return boxIsAfter(cursorCoords(cm, Pos(lineNo2, ltr2 ? part2.to : part2.from, ltr2 ? "before" : "after"), "line", lineObj, preparedMeasure), x, y, true); - }, 0, order.length - 1); - var part = order[index]; - if (index > 0) { - var ltr = part.level != 1; - var start = cursorCoords(cm, Pos(lineNo2, ltr ? part.from : part.to, ltr ? "after" : "before"), "line", lineObj, preparedMeasure); - if (boxIsAfter(start, x, y, true) && start.top > y) { - part = order[index - 1]; - } - } - return part; - } - __name(coordsBidiPart, "coordsBidiPart"); - function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { - var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); - var begin = ref.begin; - var end = ref.end; - if (/\s/.test(lineObj.text.charAt(end - 1))) { - end--; - } - var part = null, - closestDist = null; - for (var i2 = 0; i2 < order.length; i2++) { - var p = order[i2]; - if (p.from >= end || p.to <= begin) { - continue; - } - var ltr = p.level != 1; - var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; - var dist = endX < x ? x - endX + 1e9 : endX - x; - if (!part || closestDist > dist) { - part = p; - closestDist = dist; - } - } - if (!part) { - part = order[order.length - 1]; - } - if (part.from < begin) { - part = { - from: begin, - to: part.to, - level: part.level - }; - } - if (part.to > end) { - part = { - from: part.from, - to: end, - level: part.level - }; - } - return part; - } - __name(coordsBidiPartWrapped, "coordsBidiPartWrapped"); - var measureText; - function textHeight(display) { - if (display.cachedTextHeight != null) { - return display.cachedTextHeight; - } - if (measureText == null) { - measureText = elt("pre", null, "CodeMirror-line-like"); - for (var i2 = 0; i2 < 49; ++i2) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) { - display.cachedTextHeight = height; - } - removeChildren(display.measure); - return height || 1; - } - __name(textHeight, "textHeight"); - function charWidth(display) { - if (display.cachedCharWidth != null) { - return display.cachedCharWidth; - } - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor], "CodeMirror-line-like"); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), - width = (rect.right - rect.left) / 10; - if (width > 2) { - display.cachedCharWidth = width; - } - return width || 10; - } - __name(charWidth, "charWidth"); - function getDimensions(cm) { - var d = cm.display, - left = {}, - width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i2 = 0; n; n = n.nextSibling, ++i2) { - var id = cm.display.gutterSpecs[i2].className; - left[id] = n.offsetLeft + n.clientLeft + gutterLeft; - width[id] = n.clientWidth; - } - return { - fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth - }; - } - __name(getDimensions, "getDimensions"); - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - __name(compensateForHScroll, "compensateForHScroll"); - function estimateHeight(cm) { - var th = textHeight(cm.display), - wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function (line) { - if (lineIsHidden(cm.doc, line)) { - return 0; - } - var widgetsHeight = 0; - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; i2++) { - if (line.widgets[i2].height) { - widgetsHeight += line.widgets[i2].height; - } - } - } - if (wrapping) { - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - } else { - return widgetsHeight + th; - } - }; - } - __name(estimateHeight, "estimateHeight"); - function estimateLineHeights(cm) { - var doc = cm.doc, - est = estimateHeight(cm); - doc.iter(function (line) { - var estHeight = est(line); - if (estHeight != line.height) { - updateLineHeight(line, estHeight); - } - }); - } - __name(estimateLineHeights, "estimateLineHeights"); - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { - return null; - } - var x, - y, - space = display.lineSpace.getBoundingClientRect(); - try { - x = e.clientX - space.left; - y = e.clientY - space.top; - } catch (e$1) { - return null; - } - var coords = coordsChar(cm, x, y), - line; - if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; - } - __name(posFromMouse, "posFromMouse"); - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) { - return null; - } - n -= cm.display.viewFrom; - if (n < 0) { - return null; - } - var view = cm.display.view; - for (var i2 = 0; i2 < view.length; i2++) { - n -= view[i2].size; - if (n < 0) { - return i2; - } - } - } - __name(findViewIndex, "findViewIndex"); - function regChange(cm, from, to, lendiff) { - if (from == null) { - from = cm.doc.first; - } - if (to == null) { - to = cm.doc.first + cm.doc.size; - } - if (!lendiff) { - lendiff = 0; - } - var display = cm.display; - if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { - display.updateLineNumbers = from; - } - cm.curOp.viewChanged = true; - if (from >= display.viewTo) { - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { - resetView(cm); - } - } else if (to <= display.viewFrom) { - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { - resetView(cm); - } else if (from <= display.viewFrom) { - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { - var cut$1 = viewCuttingPoint(cm, from, from, -1); - if (cut$1) { - display.view = display.view.slice(0, cut$1.index); - display.viewTo = cut$1.lineN; - } else { - resetView(cm); - } - } else { - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) { - ext.lineN += lendiff; - } else if (from < ext.lineN + ext.size) { - display.externalMeasured = null; - } - } - } - __name(regChange, "regChange"); - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, - ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { - display.externalMeasured = null; - } - if (line < display.viewFrom || line >= display.viewTo) { - return; - } - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) { - return; - } - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) { - arr.push(type); - } - } - __name(regLineChange, "regLineChange"); - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - __name(resetView, "resetView"); - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), - diff, - view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) { - return { - index, - lineN: newN - }; - } - var n = cm.display.viewFrom; - for (var i2 = 0; i2 < index; i2++) { - n += view[i2].size; - } - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) { - return null; - } - diff = n + view[index].size - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; - newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) { - return null; - } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return { - index, - lineN: newN - }; - } - __name(viewCuttingPoint, "viewCuttingPoint"); - function adjustView(cm, from, to) { - var display = cm.display, - view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) { - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - } else if (display.viewFrom < from) { - display.view = display.view.slice(findViewIndex(cm, from)); - } - display.viewFrom = from; - if (display.viewTo < to) { - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - } else if (display.viewTo > to) { - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - } - display.viewTo = to; - } - __name(adjustView, "adjustView"); - function countDirtyView(cm) { - var view = cm.display.view, - dirty = 0; - for (var i2 = 0; i2 < view.length; i2++) { - var lineView = view[i2]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) { - ++dirty; - } - } - return dirty; - } - __name(countDirtyView, "countDirtyView"); - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - __name(updateSelection, "updateSelection"); - function prepareSelection(cm, primary) { - if (primary === void 0) primary = true; - var doc = cm.doc, - result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - var customCursor = cm.options.$customCursor; - if (customCursor) { - primary = true; - } - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - if (!primary && i2 == doc.sel.primIndex) { - continue; - } - var range2 = doc.sel.ranges[i2]; - if (range2.from().line >= cm.display.viewTo || range2.to().line < cm.display.viewFrom) { - continue; - } - var collapsed = range2.empty(); - if (customCursor) { - var head = customCursor(cm, range2); - if (head) { - drawSelectionCursor(cm, head, curFragment); - } - } else if (collapsed || cm.options.showCursorWhenSelecting) { - drawSelectionCursor(cm, range2.head, curFragment); - } - if (!collapsed) { - drawSelectionRange(cm, range2, selFragment); - } - } - return result; - } - __name(prepareSelection, "prepareSelection"); - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - var cursor = output.appendChild(elt("div", "\xA0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { - var charPos = charCoords(cm, head, "div", null, null); - var width = charPos.right - charPos.left; - cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; - } - if (pos.other) { - var otherCursor = output.appendChild(elt("div", "\xA0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * 0.85 + "px"; - } - } - __name(drawSelectionCursor, "drawSelectionCursor"); - function cmpCoords(a, b) { - return a.top - b.top || a.left - b.left; - } - __name(cmpCoords, "cmpCoords"); - function drawSelectionRange(cm, range2, output) { - var display = cm.display, - doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), - leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - var docLTR = doc.direction == "ltr"; - function add(left, top, width, bottom) { - if (top < 0) { - top = 0; - } - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")); - } - __name(add, "add"); - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - __name(coords, "coords"); - function wrapX(pos, dir, side) { - var extent = wrappedLineExtentChar(cm, lineObj, null, pos); - var prop2 = dir == "ltr" == (side == "after") ? "left" : "right"; - var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); - return coords(ch, prop2)[prop2]; - } - __name(wrapX, "wrapX"); - var order = getOrder(lineObj, doc.direction); - iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i2) { - var ltr = dir == "ltr"; - var fromPos = coords(from, ltr ? "left" : "right"); - var toPos = coords(to - 1, ltr ? "right" : "left"); - var openStart = fromArg == null && from == 0, - openEnd = toArg == null && to == lineLen; - var first = i2 == 0, - last = !order || i2 == order.length - 1; - if (toPos.top - fromPos.top <= 3) { - var openLeft = (docLTR ? openStart : openEnd) && first; - var openRight = (docLTR ? openEnd : openStart) && last; - var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; - var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; - add(left, fromPos.top, right - left, fromPos.bottom); - } else { - var topLeft, topRight, botLeft, botRight; - if (ltr) { - topLeft = docLTR && openStart && first ? leftSide : fromPos.left; - topRight = docLTR ? rightSide : wrapX(from, dir, "before"); - botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); - botRight = docLTR && openEnd && last ? rightSide : toPos.right; - } else { - topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); - topRight = !docLTR && openStart && first ? rightSide : fromPos.right; - botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; - botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); - } - add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); - if (fromPos.bottom < toPos.top) { - add(leftSide, fromPos.bottom, null, toPos.top); - } - add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); - } - if (!start || cmpCoords(fromPos, start) < 0) { - start = fromPos; - } - if (cmpCoords(toPos, start) < 0) { - start = toPos; - } - if (!end || cmpCoords(fromPos, end) < 0) { - end = fromPos; - } - if (cmpCoords(toPos, end) < 0) { - end = toPos; - } - }); - return { - start, - end - }; - } - __name(drawForLine, "drawForLine"); - var sFrom = range2.from(), - sTo = range2.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), - toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) { - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - } - output.appendChild(fragment); - } - __name(drawSelectionRange, "drawSelectionRange"); - function restartBlink(cm) { - if (!cm.state.focused) { - return; - } - var display = cm.display; - clearInterval(display.blinker); - var on2 = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) { - display.blinker = setInterval(function () { - if (!cm.hasFocus()) { - onBlur(cm); - } - display.cursorDiv.style.visibility = (on2 = !on2) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - } else if (cm.options.cursorBlinkRate < 0) { - display.cursorDiv.style.visibility = "hidden"; - } - } - __name(restartBlink, "restartBlink"); - function ensureFocus(cm) { - if (!cm.hasFocus()) { - cm.display.input.focus(); - if (!cm.state.focused) { - onFocus(cm); - } - } - } - __name(ensureFocus, "ensureFocus"); - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function () { - if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - if (cm.state.focused) { - onBlur(cm); - } - } - }, 100); - } - __name(delayBlurEvent, "delayBlurEvent"); - function onFocus(cm, e) { - if (cm.state.delayingBlurEvent && !cm.state.draggingText) { - cm.state.delayingBlurEvent = false; - } - if (cm.options.readOnly == "nocursor") { - return; - } - if (!cm.state.focused) { - signal(cm, "focus", cm, e); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) { - setTimeout(function () { - return cm.display.input.reset(true); - }, 20); - } - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - __name(onFocus, "onFocus"); - function onBlur(cm, e) { - if (cm.state.delayingBlurEvent) { - return; - } - if (cm.state.focused) { - signal(cm, "blur", cm, e); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function () { - if (!cm.state.focused) { - cm.display.shift = false; - } - }, 150); - } - __name(onBlur, "onBlur"); - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); - var oldHeight = display.lineDiv.getBoundingClientRect().top; - var mustScroll = 0; - for (var i2 = 0; i2 < display.view.length; i2++) { - var cur = display.view[i2], - wrapping = cm.options.lineWrapping; - var height = void 0, - width = 0; - if (cur.hidden) { - continue; - } - oldHeight += cur.line.height; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - if (!wrapping && cur.text.firstChild) { - width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; - } - } - var diff = cur.line.height - height; - if (diff > 5e-3 || diff < -5e-3) { - if (oldHeight < viewTop) { - mustScroll -= diff; - } - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) { - for (var j = 0; j < cur.rest.length; j++) { - updateWidgetHeight(cur.rest[j]); - } - } - } - if (width > cm.display.sizerWidth) { - var chWidth = Math.ceil(width / charWidth(cm.display)); - if (chWidth > cm.display.maxLineLength) { - cm.display.maxLineLength = chWidth; - cm.display.maxLine = cur.line; - cm.display.maxLineChanged = true; - } - } - } - if (Math.abs(mustScroll) > 2) { - display.scroller.scrollTop += mustScroll; - } - } - __name(updateHeightsInViewport, "updateHeightsInViewport"); - function updateWidgetHeight(line) { - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; ++i2) { - var w = line.widgets[i2], - parent = w.node.parentNode; - if (parent) { - w.height = parent.offsetHeight; - } - } - } - } - __name(updateWidgetHeight, "updateWidgetHeight"); - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - var from = lineAtHeight(doc, top), - to = lineAtHeight(doc, bottom); - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, - ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return { - from, - to: Math.max(to, from + 1) - }; - } - __name(visibleLines, "visibleLines"); - function maybeScrollWindow(cm, rect) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { - return; - } - var display = cm.display, - box = display.sizer.getBoundingClientRect(), - doScroll = null; - if (rect.top + box.top < 0) { - doScroll = true; - } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { - doScroll = false; - } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200B", null, "position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + rect.left + "px; width: " + Math.max(2, rect.right - rect.left) + "px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - __name(maybeScrollWindow, "maybeScrollWindow"); - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { - margin = 0; - } - var rect; - if (!cm.options.lineWrapping && pos == end) { - end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; - pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; - } - for (var limit = 0; limit < 5; limit++) { - var changed = false; - var coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - rect = { - left: Math.min(coords.left, endCoords.left), - top: Math.min(coords.top, endCoords.top) - margin, - right: Math.max(coords.left, endCoords.left), - bottom: Math.max(coords.bottom, endCoords.bottom) + margin - }; - var scrollPos = calculateScrollPos(cm, rect); - var startTop = cm.doc.scrollTop, - startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { - changed = true; - } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { - changed = true; - } - } - if (!changed) { - break; - } - } - return rect; - } - __name(scrollPosIntoView, "scrollPosIntoView"); - function scrollIntoView(cm, rect) { - var scrollPos = calculateScrollPos(cm, rect); - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - } - } - __name(scrollIntoView, "scrollIntoView"); - function calculateScrollPos(cm, rect) { - var display = cm.display, - snapMargin = textHeight(cm.display); - if (rect.top < 0) { - rect.top = 0; - } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen2 = displayHeight(cm), - result = {}; - if (rect.bottom - rect.top > screen2) { - rect.bottom = rect.top + screen2; - } - var docBottom = cm.doc.height + paddingVert(display); - var atTop = rect.top < snapMargin, - atBottom = rect.bottom > docBottom - snapMargin; - if (rect.top < screentop) { - result.scrollTop = atTop ? 0 : rect.top; - } else if (rect.bottom > screentop + screen2) { - var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen2); - if (newTop != screentop) { - result.scrollTop = newTop; - } - } - var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; - var screenw = displayWidth(cm) - display.gutters.offsetWidth; - var tooWide = rect.right - rect.left > screenw; - if (tooWide) { - rect.right = rect.left + screenw; - } - if (rect.left < 10) { - result.scrollLeft = 0; - } else if (rect.left < screenleft) { - result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); - } else if (rect.right > screenw + screenleft - 3) { - result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; - } - return result; - } - __name(calculateScrollPos, "calculateScrollPos"); - function addToScrollTop(cm, top) { - if (top == null) { - return; - } - resolveScrollToPos(cm); - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - __name(addToScrollTop, "addToScrollTop"); - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(); - cm.curOp.scrollToPos = { - from: cur, - to: cur, - margin: cm.options.cursorScrollMargin - }; - } - __name(ensureCursorVisible, "ensureCursorVisible"); - function scrollToCoords(cm, x, y) { - if (x != null || y != null) { - resolveScrollToPos(cm); - } - if (x != null) { - cm.curOp.scrollLeft = x; - } - if (y != null) { - cm.curOp.scrollTop = y; - } - } - __name(scrollToCoords, "scrollToCoords"); - function scrollToRange(cm, range2) { - resolveScrollToPos(cm); - cm.curOp.scrollToPos = range2; - } - __name(scrollToRange, "scrollToRange"); - function resolveScrollToPos(cm) { - var range2 = cm.curOp.scrollToPos; - if (range2) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range2.from), - to = estimateCoords(cm, range2.to); - scrollToCoordsRange(cm, from, to, range2.margin); - } - } - __name(resolveScrollToPos, "resolveScrollToPos"); - function scrollToCoordsRange(cm, from, to, margin) { - var sPos = calculateScrollPos(cm, { - left: Math.min(from.left, to.left), - top: Math.min(from.top, to.top) - margin, - right: Math.max(from.right, to.right), - bottom: Math.max(from.bottom, to.bottom) + margin - }); - scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); - } - __name(scrollToCoordsRange, "scrollToCoordsRange"); - function updateScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { - return; - } - if (!gecko) { - updateDisplaySimple(cm, { - top: val - }); - } - setScrollTop(cm, val, true); - if (gecko) { - updateDisplaySimple(cm); - } - startWorker(cm, 100); - } - __name(updateScrollTop, "updateScrollTop"); - function setScrollTop(cm, val, forceScroll) { - val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); - if (cm.display.scroller.scrollTop == val && !forceScroll) { - return; - } - cm.doc.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (cm.display.scroller.scrollTop != val) { - cm.display.scroller.scrollTop = val; - } - } - __name(setScrollTop, "setScrollTop"); - function setScrollLeft(cm, val, isScroller, forceScroll) { - val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); - if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { - return; - } - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) { - cm.display.scroller.scrollLeft = val; - } - cm.display.scrollbars.setScrollLeft(val); - } - __name(setScrollLeft, "setScrollLeft"); - function measureForScrollbars(cm) { - var d = cm.display, - gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, - clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - }; - } - __name(measureForScrollbars, "measureForScrollbars"); - var NativeScrollbars = /* @__PURE__ */__name(function (place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - vert.tabIndex = horiz.tabIndex = -1; - place(vert); - place(horiz); - on(vert, "scroll", function () { - if (vert.clientHeight) { - scroll(vert.scrollTop, "vertical"); - } - }); - on(horiz, "scroll", function () { - if (horiz.clientWidth) { - scroll(horiz.scrollLeft, "horizontal"); - } - }); - this.checkedZeroWidth = false; - if (ie && ie_version < 8) { - this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; - } - }, "NativeScrollbars"); - NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - this.vert.firstChild.style.height = Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.scrollTop = 0; - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { - this.zeroWidthHack(); - } - this.checkedZeroWidth = true; - } - return { - right: needsV ? sWidth : 0, - bottom: needsH ? sWidth : 0 - }; - }; - NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { - this.horiz.scrollLeft = pos; - } - if (this.disableHoriz) { - this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); - } - }; - NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { - this.vert.scrollTop = pos; - } - if (this.disableVert) { - this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); - } - }; - NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.height = this.vert.style.width = w; - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; - this.disableHoriz = new Delayed(); - this.disableVert = new Delayed(); - }; - NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { - bar.style.pointerEvents = "auto"; - function maybeDisable() { - var box = bar.getBoundingClientRect(); - var elt2 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); - if (elt2 != bar) { - bar.style.pointerEvents = "none"; - } else { - delay.set(1e3, maybeDisable); - } - } - __name(maybeDisable, "maybeDisable"); - delay.set(1e3, maybeDisable); - }; - NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - }; - var NullScrollbars = /* @__PURE__ */__name(function () {}, "NullScrollbars"); - NullScrollbars.prototype.update = function () { - return { - bottom: 0, - right: 0 - }; - }; - NullScrollbars.prototype.setScrollLeft = function () {}; - NullScrollbars.prototype.setScrollTop = function () {}; - NullScrollbars.prototype.clear = function () {}; - function updateScrollbars(cm, measure) { - if (!measure) { - measure = measureForScrollbars(cm); - } - var startWidth = cm.display.barWidth, - startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i2 = 0; i2 < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i2++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) { - updateHeightsInViewport(cm); - } - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; - startHeight = cm.display.barHeight; - } - } - __name(updateScrollbars, "updateScrollbars"); - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else { - d.scrollbarFiller.style.display = ""; - } - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else { - d.gutterFiller.style.display = ""; - } - } - __name(updateScrollbarsInner, "updateScrollbarsInner"); - var scrollbarModel = { - "native": NativeScrollbars, - "null": NullScrollbars - }; - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) { - rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - } - cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - on(node, "mousedown", function () { - if (cm.state.focused) { - setTimeout(function () { - return cm.display.input.focus(); - }, 0); - } - }); - node.setAttribute("cm-not-content", "true"); - }, function (pos, axis) { - if (axis == "horizontal") { - setScrollLeft(cm, pos); - } else { - updateScrollTop(cm, pos); - } - }, cm); - if (cm.display.scrollbars.addClass) { - addClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - } - __name(initScrollbars, "initScrollbars"); - var nextOpId = 0; - function startOperation(cm) { - cm.curOp = { - cm, - viewChanged: false, - startHeight: cm.doc.height, - forceUpdate: false, - updateInput: 0, - typing: false, - changeObjs: null, - cursorActivityHandlers: null, - cursorActivityCalled: 0, - selectionChanged: false, - updateMaxLine: false, - scrollLeft: null, - scrollTop: null, - scrollToPos: null, - focus: false, - id: ++nextOpId, - markArrays: null - }; - pushOperation(cm.curOp); - } - __name(startOperation, "startOperation"); - function endOperation(cm) { - var op = cm.curOp; - if (op) { - finishOperation(op, function (group) { - for (var i2 = 0; i2 < group.ops.length; i2++) { - group.ops[i2].cm.curOp = null; - } - endOperations(group); - }); - } - } - __name(endOperation, "endOperation"); - function endOperations(group) { - var ops = group.ops; - for (var i2 = 0; i2 < ops.length; i2++) { - endOperation_R1(ops[i2]); - } - for (var i$12 = 0; i$12 < ops.length; i$12++) { - endOperation_W1(ops[i$12]); - } - for (var i$22 = 0; i$22 < ops.length; i$22++) { - endOperation_R2(ops[i$22]); - } - for (var i$3 = 0; i$3 < ops.length; i$3++) { - endOperation_W2(ops[i$3]); - } - for (var i$4 = 0; i$4 < ops.length; i$4++) { - endOperation_finish(ops[i$4]); - } - } - __name(endOperations, "endOperations"); - function endOperation_R1(op) { - var cm = op.cm, - display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) { - findMaxLine(cm); - } - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || op.scrollToPos.to.line >= display.viewTo) || display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && new DisplayUpdate(cm, op.mustUpdate && { - top: op.scrollTop, - ensure: op.scrollToPos - }, op.forceUpdate); - } - __name(endOperation_R1, "endOperation_R1"); - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - __name(endOperation_W1, "endOperation_W1"); - function endOperation_R2(op) { - var cm = op.cm, - display = cm.display; - if (op.updatedDisplay) { - updateHeightsInViewport(cm); - } - op.barMeasure = measureForScrollbars(cm); - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - if (op.updatedDisplay || op.selectionChanged) { - op.preparedSelection = display.input.prepareSelection(); - } - } - __name(endOperation_R2, "endOperation_R2"); - function endOperation_W2(op) { - var cm = op.cm; - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) { - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - } - cm.display.maxLineChanged = false; - } - var takeFocus = op.focus && op.focus == activeElt(); - if (op.preparedSelection) { - cm.display.input.showSelection(op.preparedSelection, takeFocus); - } - if (op.updatedDisplay || op.startHeight != cm.doc.height) { - updateScrollbars(cm, op.barMeasure); - } - if (op.updatedDisplay) { - setDocumentHeight(cm, op.barMeasure); - } - if (op.selectionChanged) { - restartBlink(cm); - } - if (cm.state.focused && op.updateInput) { - cm.display.input.reset(op.typing); - } - if (takeFocus) { - ensureFocus(op.cm); - } - } - __name(endOperation_W2, "endOperation_W2"); - function endOperation_finish(op) { - var cm = op.cm, - display = cm.display, - doc = cm.doc; - if (op.updatedDisplay) { - postUpdateDisplay(cm, op.update); - } - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) { - display.wheelStartX = display.wheelStartY = null; - } - if (op.scrollTop != null) { - setScrollTop(cm, op.scrollTop, op.forceScroll); - } - if (op.scrollLeft != null) { - setScrollLeft(cm, op.scrollLeft, true, true); - } - if (op.scrollToPos) { - var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - maybeScrollWindow(cm, rect); - } - var hidden = op.maybeHiddenMarkers, - unhidden = op.maybeUnhiddenMarkers; - if (hidden) { - for (var i2 = 0; i2 < hidden.length; ++i2) { - if (!hidden[i2].lines.length) { - signal(hidden[i2], "hide"); - } - } - } - if (unhidden) { - for (var i$12 = 0; i$12 < unhidden.length; ++i$12) { - if (unhidden[i$12].lines.length) { - signal(unhidden[i$12], "unhide"); - } - } - } - if (display.wrapper.offsetHeight) { - doc.scrollTop = cm.display.scroller.scrollTop; - } - if (op.changeObjs) { - signal(cm, "changes", cm, op.changeObjs); - } - if (op.update) { - op.update.finish(); - } - } - __name(endOperation_finish, "endOperation_finish"); - function runInOp(cm, f) { - if (cm.curOp) { - return f(); - } - startOperation(cm); - try { - return f(); - } finally { - endOperation(cm); - } - } - __name(runInOp, "runInOp"); - function operation(cm, f) { - return function () { - if (cm.curOp) { - return f.apply(cm, arguments); - } - startOperation(cm); - try { - return f.apply(cm, arguments); - } finally { - endOperation(cm); - } - }; - } - __name(operation, "operation"); - function methodOp(f) { - return function () { - if (this.curOp) { - return f.apply(this, arguments); - } - startOperation(this); - try { - return f.apply(this, arguments); - } finally { - endOperation(this); - } - }; - } - __name(methodOp, "methodOp"); - function docMethodOp(f) { - return function () { - var cm = this.cm; - if (!cm || cm.curOp) { - return f.apply(this, arguments); - } - startOperation(cm); - try { - return f.apply(this, arguments); - } finally { - endOperation(cm); - } - }; - } - __name(docMethodOp, "docMethodOp"); - function startWorker(cm, time) { - if (cm.doc.highlightFrontier < cm.display.viewTo) { - cm.state.highlight.set(time, bind(highlightWorker, cm)); - } - } - __name(startWorker, "startWorker"); - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.highlightFrontier >= cm.display.viewTo) { - return; - } - var end = +new Date() + cm.options.workTime; - var context = getContextBefore(cm, doc.highlightFrontier); - var changedLines = []; - doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (context.line >= cm.display.viewFrom) { - var oldStyles = line.styles; - var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; - var highlighted = highlightLine(cm, line, context, true); - if (resetState) { - context.state = resetState; - } - line.styles = highlighted.styles; - var oldCls = line.styleClasses, - newCls = highlighted.classes; - if (newCls) { - line.styleClasses = newCls; - } else if (oldCls) { - line.styleClasses = null; - } - var ischange = !oldStyles || oldStyles.length != line.styles.length || oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i2 = 0; !ischange && i2 < oldStyles.length; ++i2) { - ischange = oldStyles[i2] != line.styles[i2]; - } - if (ischange) { - changedLines.push(context.line); - } - line.stateAfter = context.save(); - context.nextLine(); - } else { - if (line.text.length <= cm.options.maxHighlightLength) { - processLine(cm, line.text, context); - } - line.stateAfter = context.line % 5 == 0 ? context.save() : null; - context.nextLine(); - } - if (+new Date() > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - doc.highlightFrontier = context.line; - doc.modeFrontier = Math.max(doc.modeFrontier, context.line); - if (changedLines.length) { - runInOp(cm, function () { - for (var i2 = 0; i2 < changedLines.length; i2++) { - regLineChange(cm, changedLines[i2], "text"); - } - }); - } - } - __name(highlightWorker, "highlightWorker"); - var DisplayUpdate = /* @__PURE__ */__name(function (cm, viewport, force) { - var display = cm.display; - this.viewport = viewport; - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - }, "DisplayUpdate"); - DisplayUpdate.prototype.signal = function (emitter, type) { - if (hasHandler(emitter, type)) { - this.events.push(arguments); - } - }; - DisplayUpdate.prototype.finish = function () { - for (var i2 = 0; i2 < this.events.length; i2++) { - signal.apply(null, this.events[i2]); - } - }; - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - __name(maybeClipScrollbars, "maybeClipScrollbars"); - function selectionSnapshot(cm) { - if (cm.hasFocus()) { - return null; - } - var active = activeElt(); - if (!active || !contains(cm.display.lineDiv, active)) { - return null; - } - var result = { - activeElt: active - }; - if (window.getSelection) { - var sel = window.getSelection(); - if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { - result.anchorNode = sel.anchorNode; - result.anchorOffset = sel.anchorOffset; - result.focusNode = sel.focusNode; - result.focusOffset = sel.focusOffset; - } - } - return result; - } - __name(selectionSnapshot, "selectionSnapshot"); - function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { - return; - } - snapshot.activeElt.focus(); - if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { - var sel = window.getSelection(), - range2 = document.createRange(); - range2.setEnd(snapshot.anchorNode, snapshot.anchorOffset); - range2.collapse(false); - sel.removeAllRanges(); - sel.addRange(range2); - sel.extend(snapshot.focusNode, snapshot.focusOffset); - } - } - __name(restoreSelection, "restoreSelection"); - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, - doc = cm.doc; - if (update.editorIsHidden) { - resetView(cm); - return false; - } - if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) { - return false; - } - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) { - from = Math.max(doc.first, display.viewFrom); - } - if (display.viewTo > to && display.viewTo - to < 20) { - to = Math.min(end, display.viewTo); - } - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - cm.display.mover.style.top = display.viewOffset + "px"; - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { - return false; - } - var selSnapshot = selectionSnapshot(cm); - if (toUpdate > 4) { - display.lineDiv.style.display = "none"; - } - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) { - display.lineDiv.style.display = ""; - } - display.renderedView = display.view; - restoreSelection(selSnapshot); - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - display.updateLineNumbers = null; - return true; - } - __name(updateDisplayIfNeeded, "updateDisplayIfNeeded"); - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - if (viewport && viewport.top != null) { - viewport = { - top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top) - }; - } - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) { - break; - } - } else if (first) { - update.visible = visibleLines(cm.display, cm.doc, viewport); - } - if (!updateDisplayIfNeeded(cm, update)) { - break; - } - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.force = false; - } - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; - cm.display.reportedViewTo = cm.display.viewTo; - } - } - __name(postUpdateDisplay, "postUpdateDisplay"); - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.finish(); - } - } - __name(updateDisplaySimple, "updateDisplaySimple"); - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, - lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, - cur = container.firstChild; - function rm(node2) { - var next = node2.nextSibling; - if (webkit && mac && cm.display.currentWheelTarget == node2) { - node2.style.display = "none"; - } else { - node2.parentNode.removeChild(node2); - } - return next; - } - __name(rm, "rm"); - var view = display.view, - lineN = display.viewFrom; - for (var i2 = 0; i2 < view.length; i2++) { - var lineView = view[i2]; - if (lineView.hidden) ;else if (!lineView.node || lineView.node.parentNode != container) { - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { - while (cur != lineView.node) { - cur = rm(cur); - } - var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { - updateNumber = false; - } - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) { - cur = rm(cur); - } - } - __name(patchDisplay, "patchDisplay"); - function updateGutterSpace(display) { - var width = display.gutters.offsetWidth; - display.sizer.style.marginLeft = width + "px"; - signalLater(display, "gutterChanged", display); - } - __name(updateGutterSpace, "updateGutterSpace"); - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = measure.docHeight + cm.display.barHeight + scrollGap(cm) + "px"; - } - __name(setDocumentHeight, "setDocumentHeight"); - function alignHorizontally(cm) { - var display = cm.display, - view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { - return; - } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, - left = comp + "px"; - for (var i2 = 0; i2 < view.length; i2++) { - if (!view[i2].hidden) { - if (cm.options.fixedGutter) { - if (view[i2].gutter) { - view[i2].gutter.style.left = left; - } - if (view[i2].gutterBackground) { - view[i2].gutterBackground.style.left = left; - } - } - var align = view[i2].alignable; - if (align) { - for (var j = 0; j < align.length; j++) { - align[j].style.left = left; - } - } - } - } - if (cm.options.fixedGutter) { - display.gutters.style.left = comp + gutterW + "px"; - } - } - __name(alignHorizontally, "alignHorizontally"); - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { - return false; - } - var doc = cm.doc, - last = lineNumberFor(cm.options, doc.first + doc.size - 1), - display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, - padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm.display); - return true; - } - return false; - } - __name(maybeUpdateLineNumberWidth, "maybeUpdateLineNumberWidth"); - function getGutters(gutters, lineNumbers) { - var result = [], - sawLineNumbers = false; - for (var i2 = 0; i2 < gutters.length; i2++) { - var name = gutters[i2], - style = null; - if (typeof name != "string") { - style = name.style; - name = name.className; - } - if (name == "CodeMirror-linenumbers") { - if (!lineNumbers) { - continue; - } else { - sawLineNumbers = true; - } - } - result.push({ - className: name, - style - }); - } - if (lineNumbers && !sawLineNumbers) { - result.push({ - className: "CodeMirror-linenumbers", - style: null - }); - } - return result; - } - __name(getGutters, "getGutters"); - function renderGutters(display) { - var gutters = display.gutters, - specs = display.gutterSpecs; - removeChildren(gutters); - display.lineGutter = null; - for (var i2 = 0; i2 < specs.length; ++i2) { - var ref = specs[i2]; - var className = ref.className; - var style = ref.style; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); - if (style) { - gElt.style.cssText = style; - } - if (className == "CodeMirror-linenumbers") { - display.lineGutter = gElt; - gElt.style.width = (display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = specs.length ? "" : "none"; - updateGutterSpace(display); - } - __name(renderGutters, "renderGutters"); - function updateGutters(cm) { - renderGutters(cm.display); - regChange(cm); - alignHorizontally(cm); - } - __name(updateGutters, "updateGutters"); - function Display(place, doc, input, options) { - var d = this; - this.input = input; - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - d.lineDiv = eltP("div", null, "CodeMirror-code"); - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - d.measure = elt("div", null, "CodeMirror-measure"); - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); - var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); - d.mover = elt("div", [lines], null, "position: relative"); - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - d.wrapper.setAttribute("translate", "no"); - if (ie && ie_version < 8) { - d.gutters.style.zIndex = -1; - d.scroller.style.paddingRight = 0; - } - if (!webkit && !(gecko && mobile)) { - d.scroller.draggable = true; - } - if (place) { - if (place.appendChild) { - place.appendChild(d.wrapper); - } else { - place(d.wrapper); - } - } - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - d.view = []; - d.renderedView = null; - d.externalMeasured = null; - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - d.alignWidgets = false; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - d.shift = false; - d.selForContextMenu = null; - d.activeTouch = null; - d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); - renderGutters(d); - input.init(d); - } - __name(Display, "Display"); - var wheelSamples = 0, - wheelPixelsPerUnit = null; - if (ie) { - wheelPixelsPerUnit = -0.53; - } else if (gecko) { - wheelPixelsPerUnit = 15; - } else if (chrome) { - wheelPixelsPerUnit = -0.7; - } else if (safari) { - wheelPixelsPerUnit = -1 / 3; - } - function wheelEventDelta(e) { - var dx = e.wheelDeltaX, - dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { - dx = e.detail; - } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { - dy = e.detail; - } else if (dy == null) { - dy = e.wheelDelta; - } - return { - x: dx, - y: dy - }; - } - __name(wheelEventDelta, "wheelEventDelta"); - function wheelEventPixels(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta; - } - __name(wheelEventPixels, "wheelEventPixels"); - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), - dx = delta.x, - dy = delta.y; - var pixelsPerUnit = wheelPixelsPerUnit; - if (e.deltaMode === 0) { - dx = e.deltaX; - dy = e.deltaY; - pixelsPerUnit = 1; - } - var display = cm.display, - scroll = display.scroller; - var canScrollX = scroll.scrollWidth > scroll.clientWidth; - var canScrollY = scroll.scrollHeight > scroll.clientHeight; - if (!(dx && canScrollX || dy && canScrollY)) { - return; - } - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i2 = 0; i2 < view.length; i2++) { - if (view[i2].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } - } - } - } - if (dx && !gecko && !presto && pixelsPerUnit != null) { - if (dy && canScrollY) { - updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); - } - setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit)); - if (!dy || dy && canScrollY) { - e_preventDefault(e); - } - display.wheelStartX = null; - return; - } - if (dy && pixelsPerUnit != null) { - var pixels = dy * pixelsPerUnit; - var top = cm.doc.scrollTop, - bot = top + display.wrapper.clientHeight; - if (pixels < 0) { - top = Math.max(0, top + pixels - 50); - } else { - bot = Math.min(cm.doc.height, bot + pixels + 50); - } - updateDisplaySimple(cm, { - top, - bottom: bot - }); - } - if (wheelSamples < 20 && e.deltaMode !== 0) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; - display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; - display.wheelDY = dy; - setTimeout(function () { - if (display.wheelStartX == null) { - return; - } - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = movedY && display.wheelDY && movedY / display.wheelDY || movedX && display.wheelDX && movedX / display.wheelDX; - display.wheelStartX = display.wheelStartY = null; - if (!sample) { - return; - } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; - display.wheelDY += dy; - } - } - } - __name(onScrollWheel, "onScrollWheel"); - var Selection = /* @__PURE__ */__name(function (ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - }, "Selection"); - Selection.prototype.primary = function () { - return this.ranges[this.primIndex]; - }; - Selection.prototype.equals = function (other) { - if (other == this) { - return true; - } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { - return false; - } - for (var i2 = 0; i2 < this.ranges.length; i2++) { - var here = this.ranges[i2], - there = other.ranges[i2]; - if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { - return false; - } - } - return true; - }; - Selection.prototype.deepCopy = function () { - var out = []; - for (var i2 = 0; i2 < this.ranges.length; i2++) { - out[i2] = new Range(copyPos(this.ranges[i2].anchor), copyPos(this.ranges[i2].head)); - } - return new Selection(out, this.primIndex); - }; - Selection.prototype.somethingSelected = function () { - for (var i2 = 0; i2 < this.ranges.length; i2++) { - if (!this.ranges[i2].empty()) { - return true; - } - } - return false; - }; - Selection.prototype.contains = function (pos, end) { - if (!end) { - end = pos; - } - for (var i2 = 0; i2 < this.ranges.length; i2++) { - var range2 = this.ranges[i2]; - if (cmp(end, range2.from()) >= 0 && cmp(pos, range2.to()) <= 0) { - return i2; - } - } - return -1; - }; - var Range = /* @__PURE__ */__name(function (anchor, head) { - this.anchor = anchor; - this.head = head; - }, "Range"); - Range.prototype.from = function () { - return minPos(this.anchor, this.head); - }; - Range.prototype.to = function () { - return maxPos(this.anchor, this.head); - }; - Range.prototype.empty = function () { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - }; - function normalizeSelection(cm, ranges, primIndex) { - var mayTouch = cm && cm.options.selectionsMayTouch; - var prim = ranges[primIndex]; - ranges.sort(function (a, b) { - return cmp(a.from(), b.from()); - }); - primIndex = indexOf(ranges, prim); - for (var i2 = 1; i2 < ranges.length; i2++) { - var cur = ranges[i2], - prev = ranges[i2 - 1]; - var diff = cmp(prev.to(), cur.from()); - if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { - var from = minPos(prev.from(), cur.from()), - to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i2 <= primIndex) { - --primIndex; - } - ranges.splice(--i2, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex); - } - __name(normalizeSelection, "normalizeSelection"); - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - __name(simpleSelection, "simpleSelection"); - function changeEnd(change) { - if (!change.text) { - return change.to; - } - return Pos(change.from.line + change.text.length - 1, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); - } - __name(changeEnd, "changeEnd"); - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) { - return pos; - } - if (cmp(pos, change.to) <= 0) { - return changeEnd(change); - } - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, - ch = pos.ch; - if (pos.line == change.to.line) { - ch += changeEnd(change).ch - change.to.ch; - } - return Pos(line, ch); - } - __name(adjustForChange, "adjustForChange"); - function computeSelAfterChange(doc, change) { - var out = []; - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - var range2 = doc.sel.ranges[i2]; - out.push(new Range(adjustForChange(range2.anchor, change), adjustForChange(range2.head, change))); - } - return normalizeSelection(doc.cm, out, doc.sel.primIndex); - } - __name(computeSelAfterChange, "computeSelAfterChange"); - function offsetPos(pos, old, nw) { - if (pos.line == old.line) { - return Pos(nw.line, pos.ch - old.ch + nw.ch); - } else { - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - } - __name(offsetPos, "offsetPos"); - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), - newPrev = oldPrev; - for (var i2 = 0; i2 < changes.length; i2++) { - var change = changes[i2]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range2 = doc.sel.ranges[i2], - inv = cmp(range2.head, range2.anchor) < 0; - out[i2] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i2] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex); - } - __name(computeReplacedSel, "computeReplacedSel"); - function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - __name(loadMode, "loadMode"); - function resetModeState(cm) { - cm.doc.iter(function (line) { - if (line.stateAfter) { - line.stateAfter = null; - } - if (line.styles) { - line.styles = null; - } - }); - cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) { - regChange(cm); - } - } - __name(resetModeState, "resetModeState"); - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); - } - __name(isWholeLineUpdate, "isWholeLineUpdate"); - function updateDoc(doc, change, markedSpans, estimateHeight2) { - function spansFor(n) { - return markedSpans ? markedSpans[n] : null; - } - __name(spansFor, "spansFor"); - function update(line, text2, spans) { - updateLine(line, text2, spans, estimateHeight2); - signalLater(line, "change", line, change); - } - __name(update, "update"); - function linesFor(start, end) { - var result = []; - for (var i2 = start; i2 < end; ++i2) { - result.push(new Line(text[i2], spansFor(i2), estimateHeight2)); - } - return result; - } - __name(linesFor, "linesFor"); - var from = change.from, - to = change.to, - text = change.text; - var firstLine = getLine(doc, from.line), - lastLine = getLine(doc, to.line); - var lastText = lst(text), - lastSpans = spansFor(text.length - 1), - nlines = to.line - from.line; - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) { - doc.remove(from.line, nlines); - } - if (added.length) { - doc.insert(from.line, added); - } - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added$1 = linesFor(1, text.length - 1); - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight2)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added$1); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added$2 = linesFor(1, text.length - 1); - if (nlines > 1) { - doc.remove(from.line + 1, nlines - 1); - } - doc.insert(from.line + 1, added$2); - } - signalLater(doc, "change", doc, change); - } - __name(updateDoc, "updateDoc"); - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc2, skip, sharedHist) { - if (doc2.linked) { - for (var i2 = 0; i2 < doc2.linked.length; ++i2) { - var rel = doc2.linked[i2]; - if (rel.doc == skip) { - continue; - } - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) { - continue; - } - f(rel.doc, shared); - propagate(rel.doc, doc2, shared); - } - } - } - __name(propagate, "propagate"); - propagate(doc, null, true); - } - __name(linkedDocs, "linkedDocs"); - function attachDoc(cm, doc) { - if (doc.cm) { - throw new Error("This document is already in use."); - } - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - setDirectionClass(cm); - cm.options.direction = doc.direction; - if (!cm.options.lineWrapping) { - findMaxLine(cm); - } - cm.options.mode = doc.modeOption; - regChange(cm); - } - __name(attachDoc, "attachDoc"); - function setDirectionClass(cm) { - (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); - } - __name(setDirectionClass, "setDirectionClass"); - function directionChanged(cm) { - runInOp(cm, function () { - setDirectionClass(cm); - regChange(cm); - }); - } - __name(directionChanged, "directionChanged"); - function History(prev) { - this.done = []; - this.undone = []; - this.undoDepth = prev ? prev.undoDepth : Infinity; - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; - } - __name(History, "History"); - function historyChangeFromChange(doc, change) { - var histChange = { - from: copyPos(change.from), - to: changeEnd(change), - text: getBetween(doc, change.from, change.to) - }; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function (doc2) { - return attachLocalSpans(doc2, histChange, change.from.line, change.to.line + 1); - }, true); - return histChange; - } - __name(historyChangeFromChange, "historyChangeFromChange"); - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) { - array.pop(); - } else { - break; - } - } - } - __name(clearSelectionEvents, "clearSelectionEvents"); - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - __name(lastChangeEvent, "lastChangeEvent"); - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date(), - cur; - var last; - if ((hist.lastOp == opId || hist.lastOrigin == change.origin && change.origin && (change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500) || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - last.to = changeEnd(change); - } else { - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - var before = lst(hist.done); - if (!before || !before.ranges) { - pushSelectionToHistory(doc.sel, hist.done); - } - cur = { - changes: [historyChangeFromChange(doc, change)], - generation: hist.generation - }; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) { - hist.done.shift(); - } - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - if (!last) { - signal(doc, "historyAdded"); - } - } - __name(addChangeToHistory, "addChangeToHistory"); - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || ch == "+" && prev.ranges.length == sel.ranges.length && prev.somethingSelected() == sel.somethingSelected() && new Date() - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); - } - __name(selectionEventCanBeMerged, "selectionEventCanBeMerged"); - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, - origin = options && options.origin; - if (opId == hist.lastSelOp || origin && hist.lastSelOrigin == origin && (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))) { - hist.done[hist.done.length - 1] = sel; - } else { - pushSelectionToHistory(sel, hist.done); - } - hist.lastSelTime = +new Date(); - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) { - clearSelectionEvents(hist.undone); - } - } - __name(addSelectionToHistory, "addSelectionToHistory"); - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) { - dest.push(sel); - } - } - __name(pushSelectionToHistory, "pushSelectionToHistory"); - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], - n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { - if (line.markedSpans) { - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - } - ++n; - }); - } - __name(attachLocalSpans, "attachLocalSpans"); - function removeClearedSpans(spans) { - if (!spans) { - return null; - } - var out; - for (var i2 = 0; i2 < spans.length; ++i2) { - if (spans[i2].marker.explicitlyCleared) { - if (!out) { - out = spans.slice(0, i2); - } - } else if (out) { - out.push(spans[i2]); - } - } - return !out ? spans : out.length ? out : null; - } - __name(removeClearedSpans, "removeClearedSpans"); - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) { - return null; - } - var nw = []; - for (var i2 = 0; i2 < change.text.length; ++i2) { - nw.push(removeClearedSpans(found[i2])); - } - return nw; - } - __name(getOldSpans, "getOldSpans"); - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) { - return stretched; - } - if (!stretched) { - return old; - } - for (var i2 = 0; i2 < old.length; ++i2) { - var oldCur = old[i2], - stretchCur = stretched[i2]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) { - if (oldCur[k].marker == span.marker) { - continue spans; - } - } - oldCur.push(span); - } - } else if (stretchCur) { - old[i2] = stretchCur; - } - } - return old; - } - __name(mergeOldSpans, "mergeOldSpans"); - function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = []; - for (var i2 = 0; i2 < events.length; ++i2) { - var event = events[i2]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, - newChanges = []; - copy.push({ - changes: newChanges - }); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], - m = void 0; - newChanges.push({ - from: change.from, - to: change.to, - text: change.text - }); - if (newGroup) { - for (var prop2 in change) { - if (m = prop2.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop2] = change[prop2]; - delete change[prop2]; - } - } - } - } - } - } - return copy; - } - __name(copyHistoryArray, "copyHistoryArray"); - function extendRange(range2, head, other, extend) { - if (extend) { - var anchor = range2.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != cmp(other, anchor) < 0) { - anchor = head; - head = other; - } else if (posBefore != cmp(head, other) < 0) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - __name(extendRange, "extendRange"); - function extendSelection(doc, head, other, options, extend) { - if (extend == null) { - extend = doc.cm && (doc.cm.display.shift || doc.extend); - } - setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); - } - __name(extendSelection, "extendSelection"); - function extendSelections(doc, heads, options) { - var out = []; - var extend = doc.cm && (doc.cm.display.shift || doc.extend); - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - out[i2] = extendRange(doc.sel.ranges[i2], heads[i2], null, extend); - } - var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - __name(extendSelections, "extendSelections"); - function replaceOneSelection(doc, i2, range2, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i2] = range2; - setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); - } - __name(replaceOneSelection, "replaceOneSelection"); - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - __name(setSimpleSelection, "setSimpleSelection"); - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function (ranges) { - this.ranges = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - this.ranges[i2] = new Range(clipPos(doc, ranges[i2].anchor), clipPos(doc, ranges[i2].head)); - } - }, - origin: options && options.origin - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) { - signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - } - if (obj.ranges != sel.ranges) { - return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1); - } else { - return sel; - } - } - __name(filterSelectionChange, "filterSelectionChange"); - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, - last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - __name(setSelectionReplaceHistory, "setSelectionReplaceHistory"); - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - __name(setSelection, "setSelection"); - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { - sel = filterSelectionChange(doc, sel, options); - } - var bias = options && options.bias || (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") { - ensureCursorVisible(doc.cm); - } - } - __name(setSelectionNoUndo, "setSelectionNoUndo"); - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) { - return; - } - doc.sel = sel; - if (doc.cm) { - doc.cm.curOp.updateInput = 1; - doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - __name(setSelectionInner, "setSelectionInner"); - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); - } - __name(reCheckSelection, "reCheckSelection"); - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i2 = 0; i2 < sel.ranges.length; i2++) { - var range2 = sel.ranges[i2]; - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i2]; - var newAnchor = skipAtomic(doc, range2.anchor, old && old.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range2.head, old && old.head, bias, mayClear); - if (out || newAnchor != range2.anchor || newHead != range2.head) { - if (!out) { - out = sel.ranges.slice(0, i2); - } - out[i2] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel; - } - __name(skipAtomicInSelection, "skipAtomicInSelection"); - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line); - if (line.markedSpans) { - for (var i2 = 0; i2 < line.markedSpans.length; ++i2) { - var sp = line.markedSpans[i2], - m = sp.marker; - var preventCursorLeft = "selectLeft" in m ? !m.selectLeft : m.inclusiveLeft; - var preventCursorRight = "selectRight" in m ? !m.selectRight : m.inclusiveRight; - if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) { - break; - } else { - --i2; - continue; - } - } - } - if (!m.atomic) { - continue; - } - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), - diff = void 0; - if (dir < 0 ? preventCursorRight : preventCursorLeft) { - near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); - } - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) { - return skipAtomicInner(doc, near, pos, dir, mayClear); - } - } - var far = m.find(dir < 0 ? -1 : 1); - if (dir < 0 ? preventCursorLeft : preventCursorRight) { - far = movePos(doc, far, dir, far.line == pos.line ? line : null); - } - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; - } - } - } - return pos; - } - __name(skipAtomicInner, "skipAtomicInner"); - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1; - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, dir, true) || skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || !mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true); - if (!found) { - doc.cantEdit = true; - return Pos(doc.first, 0); - } - return found; - } - __name(skipAtomic, "skipAtomic"); - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) { - return clipPos(doc, Pos(pos.line - 1)); - } else { - return null; - } - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) { - return Pos(pos.line + 1, 0); - } else { - return null; - } - } else { - return new Pos(pos.line, pos.ch + dir); - } - } - __name(movePos, "movePos"); - function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); - } - __name(selectAll, "selectAll"); - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function () { - return obj.canceled = true; - } - }; - if (update) { - obj.update = function (from, to, text, origin) { - if (from) { - obj.from = clipPos(doc, from); - } - if (to) { - obj.to = clipPos(doc, to); - } - if (text) { - obj.text = text; - } - if (origin !== void 0) { - obj.origin = origin; - } - }; - } - signal(doc, "beforeChange", doc, obj); - if (doc.cm) { - signal(doc.cm, "beforeChange", doc.cm, obj); - } - if (obj.canceled) { - if (doc.cm) { - doc.cm.curOp.updateInput = 2; - } - return null; - } - return { - from: obj.from, - to: obj.to, - text: obj.text, - origin: obj.origin - }; - } - __name(filterChange, "filterChange"); - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) { - return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - } - if (doc.cm.state.suppressEdits) { - return; - } - } - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) { - return; - } - } - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i2 = split.length - 1; i2 >= 0; --i2) { - makeChangeInner(doc, { - from: split[i2].from, - to: split[i2].to, - text: i2 ? [""] : change.text, - origin: change.origin - }); - } - } else { - makeChangeInner(doc, change); - } - } - __name(makeChange, "makeChange"); - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { - return; - } - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - linkedDocs(doc, function (doc2, sharedHist) { - if (!sharedHist && indexOf(rebased, doc2.history) == -1) { - rebaseHist(doc2.history, change); - rebased.push(doc2.history); - } - makeChangeSingleDoc(doc2, change, null, stretchSpansOverChange(doc2, change)); - }); - } - __name(makeChangeInner, "makeChangeInner"); - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - var suppress = doc.cm && doc.cm.state.suppressEdits; - if (suppress && !allowSelectionOnly) { - return; - } - var hist = doc.history, - event, - selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, - dest = type == "undo" ? hist.undone : hist.done; - var i2 = 0; - for (; i2 < source.length; i2++) { - event = source[i2]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) { - break; - } - } - if (i2 == source.length) { - return; - } - hist.lastOrigin = hist.lastSelOrigin = null; - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, { - clearRedo: false - }); - return; - } - selAfter = event; - } else if (suppress) { - source.push(event); - return; - } else { - break; - } - } - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({ - changes: antiChanges, - generation: hist.generation - }); - hist.generation = event.generation || ++hist.maxGeneration; - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - var loop = /* @__PURE__ */__name(function (i3) { - var change = event.changes[i3]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return {}; - } - antiChanges.push(historyChangeFromChange(doc, change)); - var after = i3 ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i3 && doc.cm) { - doc.cm.scrollIntoView({ - from: change.from, - to: changeEnd(change) - }); - } - var rebased = []; - linkedDocs(doc, function (doc2, sharedHist) { - if (!sharedHist && indexOf(rebased, doc2.history) == -1) { - rebaseHist(doc2.history, change); - rebased.push(doc2.history); - } - makeChangeSingleDoc(doc2, change, null, mergeOldSpans(doc2, change)); - }); - }, "loop"); - for (var i$12 = event.changes.length - 1; i$12 >= 0; --i$12) { - var returned = loop(i$12); - if (returned) return returned.v; - } - } - __name(makeChangeFromHistory, "makeChangeFromHistory"); - function shiftDoc(doc, distance) { - if (distance == 0) { - return; - } - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function (range2) { - return new Range(Pos(range2.anchor.line + distance, range2.anchor.ch), Pos(range2.head.line + distance, range2.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) { - regLineChange(doc.cm, l, "gutter"); - } - } - } - __name(shiftDoc, "shiftDoc"); - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) { - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - } - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) { - return; - } - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = { - from: Pos(doc.first, 0), - to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], - origin: change.origin - }; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = { - from: change.from, - to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], - origin: change.origin - }; - } - change.removed = getBetween(doc, change.from, change.to); - if (!selAfter) { - selAfter = computeSelAfterChange(doc, change); - } - if (doc.cm) { - makeChangeSingleDocInEditor(doc.cm, change, spans); - } else { - updateDoc(doc, change, spans); - } - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) { - doc.cantEdit = false; - } - } - __name(makeChangeSingleDoc, "makeChangeSingleDoc"); - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, - display = cm.display, - from = change.from, - to = change.to; - var recomputeMaxLength = false, - checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function (line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - if (doc.sel.contains(change.from, change.to) > -1) { - signalCursorActivity(cm); - } - updateDoc(doc, change, spans, estimateHeight(cm)); - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) { - cm.curOp.updateMaxLine = true; - } - } - retreatFrontier(doc, from.line); - startWorker(cm, 400); - var lendiff = change.text.length - (to.line - from.line) - 1; - if (change.full) { - regChange(cm); - } else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) { - regLineChange(cm, from.line, "text"); - } else { - regChange(cm, from.line, to.line + 1, lendiff); - } - var changesHandler = hasHandler(cm, "changes"), - changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from, - to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) { - signalLater(cm, "change", cm, obj); - } - if (changesHandler) { - (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } - } - cm.display.selForContextMenu = null; - } - __name(makeChangeSingleDocInEditor, "makeChangeSingleDocInEditor"); - function replaceRange(doc, code, from, to, origin) { - var assign; - if (!to) { - to = from; - } - if (cmp(to, from) < 0) { - assign = [to, from], from = assign[0], to = assign[1]; - } - if (typeof code == "string") { - code = doc.splitLines(code); - } - makeChange(doc, { - from, - to, - text: code, - origin - }); - } - __name(replaceRange, "replaceRange"); - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - __name(rebaseHistSelSingle, "rebaseHistSelSingle"); - function rebaseHistArray(array, from, to, diff) { - for (var i2 = 0; i2 < array.length; ++i2) { - var sub = array[i2], - ok = true; - if (sub.ranges) { - if (!sub.copied) { - sub = array[i2] = sub.deepCopy(); - sub.copied = true; - } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i2 + 1); - i2 = 0; - } - } - } - __name(rebaseHistArray, "rebaseHistArray"); - function rebaseHist(hist, change) { - var from = change.from.line, - to = change.to.line, - diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - __name(rebaseHist, "rebaseHist"); - function changeLine(doc, handle, changeType, op) { - var no = handle, - line = handle; - if (typeof handle == "number") { - line = getLine(doc, clipLine(doc, handle)); - } else { - no = lineNo(handle); - } - if (no == null) { - return null; - } - if (op(line, no) && doc.cm) { - regLineChange(doc.cm, no, changeType); - } - return line; - } - __name(changeLine, "changeLine"); - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - var height = 0; - for (var i2 = 0; i2 < lines.length; ++i2) { - lines[i2].parent = this; - height += lines[i2].height; - } - this.height = height; - } - __name(LeafChunk, "LeafChunk"); - LeafChunk.prototype = { - chunkSize: function () { - return this.lines.length; - }, - removeInner: function (at, n) { - for (var i2 = at, e = at + n; i2 < e; ++i2) { - var line = this.lines[i2]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - collapse: function (lines) { - lines.push.apply(lines, this.lines); - }, - insertInner: function (at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i2 = 0; i2 < lines.length; ++i2) { - lines[i2].parent = this; - } - }, - iterN: function (at, n, op) { - for (var e = at + n; at < e; ++at) { - if (op(this.lines[at])) { - return true; - } - } - } - }; - function BranchChunk(children) { - this.children = children; - var size = 0, - height = 0; - for (var i2 = 0; i2 < children.length; ++i2) { - var ch = children[i2]; - size += ch.chunkSize(); - height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - __name(BranchChunk, "BranchChunk"); - BranchChunk.prototype = { - chunkSize: function () { - return this.size; - }, - removeInner: function (at, n) { - this.size -= n; - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), - oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { - this.children.splice(i2--, 1); - child.parent = null; - } - if ((n -= rm) == 0) { - break; - } - at = 0; - } else { - at -= sz; - } - } - if (this.size - n < 25 && (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function (lines) { - for (var i2 = 0; i2 < this.children.length; ++i2) { - this.children[i2].collapse(lines); - } - }, - insertInner: function (at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - var remaining = child.lines.length % 25 + 25; - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); - child.height -= leaf.height; - this.children.splice(++i2, 0, leaf); - leaf.parent = this; - } - child.lines = child.lines.slice(0, remaining); - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - maybeSpill: function () { - if (this.children.length <= 10) { - return; - } - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function (at, n, op) { - for (var i2 = 0; i2 < this.children.length; ++i2) { - var child = this.children[i2], - sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) { - return true; - } - if ((n -= used) == 0) { - break; - } - at = 0; - } else { - at -= sz; - } - } - } - }; - var LineWidget = /* @__PURE__ */__name(function (doc, node, options) { - if (options) { - for (var opt in options) { - if (options.hasOwnProperty(opt)) { - this[opt] = options[opt]; - } - } - } - this.doc = doc; - this.node = node; - }, "LineWidget"); - LineWidget.prototype.clear = function () { - var cm = this.doc.cm, - ws = this.line.widgets, - line = this.line, - no = lineNo(line); - if (no == null || !ws) { - return; - } - for (var i2 = 0; i2 < ws.length; ++i2) { - if (ws[i2] == this) { - ws.splice(i2--, 1); - } - } - if (!ws.length) { - line.widgets = null; - } - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) { - runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - signalLater(cm, "lineWidgetCleared", cm, this, no); - } - }; - LineWidget.prototype.changed = function () { - var this$1$1 = this; - var oldH = this.height, - cm = this.doc.cm, - line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) { - return; - } - if (!lineIsHidden(this.doc, line)) { - updateLineHeight(line, line.height + diff); - } - if (cm) { - runInOp(cm, function () { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - signalLater(cm, "lineWidgetChanged", cm, this$1$1, lineNo(line)); - }); - } - }; - eventMixin(LineWidget); - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < (cm.curOp && cm.curOp.scrollTop || cm.doc.scrollTop)) { - addToScrollTop(cm, diff); - } - } - __name(adjustScrollWhenAboveVisible, "adjustScrollWhenAboveVisible"); - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) { - cm.display.alignWidgets = true; - } - changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) { - widgets.push(widget); - } else { - widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); - } - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) { - addToScrollTop(cm, widget.height); - } - cm.curOp.forceUpdate = true; - } - return true; - }); - if (cm) { - signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); - } - return widget; - } - __name(addLineWidget, "addLineWidget"); - var nextMarkerId = 0; - var TextMarker = /* @__PURE__ */__name(function (doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }, "TextMarker"); - TextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { - return; - } - var cm = this.doc.cm, - withOp = cm && !cm.curOp; - if (withOp) { - startOperation(cm); - } - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) { - signalLater(this, "clear", found.from, found.to); - } - } - var min = null, - max = null; - for (var i2 = 0; i2 < this.lines.length; ++i2) { - var line = this.lines[i2]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) { - regLineChange(cm, lineNo(line), "text"); - } else if (cm) { - if (span.to != null) { - max = lineNo(line); - } - if (span.from != null) { - min = lineNo(line); - } - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) { - updateLineHeight(line, textHeight(cm.display)); - } - } - if (cm && this.collapsed && !cm.options.lineWrapping) { - for (var i$12 = 0; i$12 < this.lines.length; ++i$12) { - var visual = visualLine(this.lines[i$12]), - len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - } - if (min != null && cm && this.collapsed) { - regChange(cm, min, max + 1); - } - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) { - reCheckSelection(cm.doc); - } - } - if (cm) { - signalLater(cm, "markerCleared", cm, this, min, max); - } - if (withOp) { - endOperation(cm); - } - if (this.parent) { - this.parent.clear(); - } - }; - TextMarker.prototype.find = function (side, lineObj) { - if (side == null && this.type == "bookmark") { - side = 1; - } - var from, to; - for (var i2 = 0; i2 < this.lines.length; ++i2) { - var line = this.lines[i2]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) { - return from; - } - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) { - return to; - } - } - } - return from && { - from, - to - }; - }; - TextMarker.prototype.changed = function () { - var this$1$1 = this; - var pos = this.find(-1, true), - widget = this, - cm = this.doc.cm; - if (!pos || !cm) { - return; - } - runInOp(cm, function () { - var line = pos.line, - lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) { - updateLineHeight(line, line.height + dHeight); - } - } - signalLater(cm, "markerChanged", cm, this$1$1); - }); - }; - TextMarker.prototype.attachLine = function (line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) { - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function (line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - eventMixin(TextMarker); - function markText(doc, from, to, options, type) { - if (options && options.shared) { - return markTextShared(doc, from, to, options, type); - } - if (doc.cm && !doc.cm.curOp) { - return operation(doc.cm, markText)(doc, from, to, options, type); - } - var marker = new TextMarker(doc, type), - diff = cmp(from, to); - if (options) { - copyObj(options, marker, false); - } - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) { - return marker; - } - if (marker.replacedWith) { - marker.collapsed = true; - marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) { - marker.widgetNode.setAttribute("cm-ignore-events", "true"); - } - if (options.insertLeft) { - marker.widgetNode.insertLeft = true; - } - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) { - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - } - seeCollapsedSpans(); - } - if (marker.addToHistory) { - addChangeToHistory(doc, { - from, - to, - origin: "markText" - }, doc.sel, NaN); - } - var curLine = from.line, - cm = doc.cm, - updateMaxLine; - doc.iter(curLine, to.line + 1, function (line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) { - updateMaxLine = true; - } - if (marker.collapsed && curLine != from.line) { - updateLineHeight(line, 0); - } - addMarkedSpan(line, new MarkedSpan(marker, curLine == from.line ? from.ch : null, curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp); - ++curLine; - }); - if (marker.collapsed) { - doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { - updateLineHeight(line, 0); - } - }); - } - if (marker.clearOnEnter) { - on(marker, "beforeCursorEnter", function () { - return marker.clear(); - }); - } - if (marker.readOnly) { - seeReadOnlySpans(); - if (doc.history.done.length || doc.history.undone.length) { - doc.clearHistory(); - } - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - if (updateMaxLine) { - cm.curOp.updateMaxLine = true; - } - if (marker.collapsed) { - regChange(cm, from.line, to.line + 1); - } else if (marker.className || marker.startStyle || marker.endStyle || marker.css || marker.attributes || marker.title) { - for (var i2 = from.line; i2 <= to.line; i2++) { - regLineChange(cm, i2, "text"); - } - } - if (marker.atomic) { - reCheckSelection(cm.doc); - } - signalLater(cm, "markerAdded", cm, marker); - } - return marker; - } - __name(markText, "markText"); - var SharedTextMarker = /* @__PURE__ */__name(function (markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i2 = 0; i2 < markers.length; ++i2) { - markers[i2].parent = this; - } - }, "SharedTextMarker"); - SharedTextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { - return; - } - this.explicitlyCleared = true; - for (var i2 = 0; i2 < this.markers.length; ++i2) { - this.markers[i2].clear(); - } - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function (side, lineObj) { - return this.primary.find(side, lineObj); - }; - eventMixin(SharedTextMarker); - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], - primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function (doc2) { - if (widget) { - options.widgetNode = widget.cloneNode(true); - } - markers.push(markText(doc2, clipPos(doc2, from), clipPos(doc2, to), options, type)); - for (var i2 = 0; i2 < doc2.linked.length; ++i2) { - if (doc2.linked[i2].isParent) { - return; - } - } - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - __name(markTextShared, "markTextShared"); - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { - return m.parent; - }); - } - __name(findSharedMarkers, "findSharedMarkers"); - function copySharedMarkers(doc, markers) { - for (var i2 = 0; i2 < markers.length; i2++) { - var marker = markers[i2], - pos = marker.find(); - var mFrom = doc.clipPos(pos.from), - mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - __name(copySharedMarkers, "copySharedMarkers"); - function detachSharedMarkers(markers) { - var loop = /* @__PURE__ */__name(function (i3) { - var marker = markers[i3], - linked = [marker.primary.doc]; - linkedDocs(marker.primary.doc, function (d) { - return linked.push(d); - }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - }, "loop"); - for (var i2 = 0; i2 < markers.length; i2++) loop(i2); - } - __name(detachSharedMarkers, "detachSharedMarkers"); - var nextDocId = 0; - var Doc = /* @__PURE__ */__name(function (text, mode, firstLine, lineSep, direction) { - if (!(this instanceof Doc)) { - return new Doc(text, mode, firstLine, lineSep, direction); - } - if (firstLine == null) { - firstLine = 0; - } - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.modeFrontier = this.highlightFrontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - this.direction = direction == "rtl" ? "rtl" : "ltr"; - this.extend = false; - if (typeof text == "string") { - text = this.splitLines(text); - } - updateDoc(this, { - from: start, - to: start, - text - }); - setSelection(this, simpleSelection(start), sel_dontScroll); - }, "Doc"); - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - iter: function (from, to, op) { - if (op) { - this.iterN(from - this.first, to - from, op); - } else { - this.iterN(this.first, this.first + this.size, from); - } - }, - insert: function (at, lines) { - var height = 0; - for (var i2 = 0; i2 < lines.length; ++i2) { - height += lines[i2].height; - } - this.insertInner(at - this.first, lines, height); - }, - remove: function (at, n) { - this.removeInner(at - this.first, n); - }, - getValue: function (lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) { - return lines; - } - return lines.join(lineSep || this.lineSeparator()); - }, - setValue: docMethodOp(function (code) { - var top = Pos(this.first, 0), - last = this.first + this.size - 1; - makeChange(this, { - from: top, - to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), - origin: "setValue", - full: true - }, true); - if (this.cm) { - scrollToCoords(this.cm, 0, 0); - } - setSelection(this, simpleSelection(top), sel_dontScroll); - }), - replaceRange: function (code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function (from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) { - return lines; - } - if (lineSep === "") { - return lines.join(""); - } - return lines.join(lineSep || this.lineSeparator()); - }, - getLine: function (line) { - var l = this.getLineHandle(line); - return l && l.text; - }, - getLineHandle: function (line) { - if (isLine(this, line)) { - return getLine(this, line); - } - }, - getLineNumber: function (line) { - return lineNo(line); - }, - getLineHandleVisualStart: function (line) { - if (typeof line == "number") { - line = getLine(this, line); - } - return visualLine(line); - }, - lineCount: function () { - return this.size; - }, - firstLine: function () { - return this.first; - }, - lastLine: function () { - return this.first + this.size - 1; - }, - clipPos: function (pos) { - return clipPos(this, pos); - }, - getCursor: function (start) { - var range2 = this.sel.primary(), - pos; - if (start == null || start == "head") { - pos = range2.head; - } else if (start == "anchor") { - pos = range2.anchor; - } else if (start == "end" || start == "to" || start === false) { - pos = range2.to(); - } else { - pos = range2.from(); - } - return pos; - }, - listSelections: function () { - return this.sel.ranges; - }, - somethingSelected: function () { - return this.sel.somethingSelected(); - }, - setCursor: docMethodOp(function (line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function (anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function (head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function (heads, options) { - extendSelections(this, clipPosArray(this, heads), options); - }), - extendSelectionsBy: docMethodOp(function (f, options) { - var heads = map(this.sel.ranges, f); - extendSelections(this, clipPosArray(this, heads), options); - }), - setSelections: docMethodOp(function (ranges, primary, options) { - if (!ranges.length) { - return; - } - var out = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - out[i2] = new Range(clipPos(this, ranges[i2].anchor), clipPos(this, ranges[i2].head || ranges[i2].anchor)); - } - if (primary == null) { - primary = Math.min(ranges.length - 1, this.sel.primIndex); - } - setSelection(this, normalizeSelection(this.cm, out, primary), options); - }), - addSelection: docMethodOp(function (anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); - }), - getSelection: function (lineSep) { - var ranges = this.sel.ranges, - lines; - for (var i2 = 0; i2 < ranges.length; i2++) { - var sel = getBetween(this, ranges[i2].from(), ranges[i2].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) { - return lines; - } else { - return lines.join(lineSep || this.lineSeparator()); - } - }, - getSelections: function (lineSep) { - var parts = [], - ranges = this.sel.ranges; - for (var i2 = 0; i2 < ranges.length; i2++) { - var sel = getBetween(this, ranges[i2].from(), ranges[i2].to()); - if (lineSep !== false) { - sel = sel.join(lineSep || this.lineSeparator()); - } - parts[i2] = sel; - } - return parts; - }, - replaceSelection: function (code, collapse, origin) { - var dup = []; - for (var i2 = 0; i2 < this.sel.ranges.length; i2++) { - dup[i2] = code; - } - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function (code, collapse, origin) { - var changes = [], - sel = this.sel; - for (var i2 = 0; i2 < sel.ranges.length; i2++) { - var range2 = sel.ranges[i2]; - changes[i2] = { - from: range2.from(), - to: range2.to(), - text: this.splitLines(code[i2]), - origin - }; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i$12 = changes.length - 1; i$12 >= 0; i$12--) { - makeChange(this, changes[i$12]); - } - if (newSel) { - setSelectionReplaceHistory(this, newSel); - } else if (this.cm) { - ensureCursorVisible(this.cm); - } - }), - undo: docMethodOp(function () { - makeChangeFromHistory(this, "undo"); - }), - redo: docMethodOp(function () { - makeChangeFromHistory(this, "redo"); - }), - undoSelection: docMethodOp(function () { - makeChangeFromHistory(this, "undo", true); - }), - redoSelection: docMethodOp(function () { - makeChangeFromHistory(this, "redo", true); - }), - setExtending: function (val) { - this.extend = val; - }, - getExtending: function () { - return this.extend; - }, - historySize: function () { - var hist = this.history, - done = 0, - undone = 0; - for (var i2 = 0; i2 < hist.done.length; i2++) { - if (!hist.done[i2].ranges) { - ++done; - } - } - for (var i$12 = 0; i$12 < hist.undone.length; i$12++) { - if (!hist.undone[i$12].ranges) { - ++undone; - } - } - return { - undo: done, - redo: undone - }; - }, - clearHistory: function () { - var this$1$1 = this; - this.history = new History(this.history); - linkedDocs(this, function (doc) { - return doc.history = this$1$1.history; - }, true); - }, - markClean: function () { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function (forceSplit) { - if (forceSplit) { - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; - } - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - getHistory: function () { - return { - done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone) - }; - }, - setHistory: function (histData) { - var hist = this.history = new History(this.history); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - setGutterMarker: docMethodOp(function (line, gutterID, value) { - return changeLine(this, line, "gutter", function (line2) { - var markers = line2.gutterMarkers || (line2.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) { - line2.gutterMarkers = null; - } - return true; - }); - }), - clearGutter: docMethodOp(function (gutterID) { - var this$1$1 = this; - this.iter(function (line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - changeLine(this$1$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null; - if (isEmpty(line.gutterMarkers)) { - line.gutterMarkers = null; - } - return true; - }); - } - }); - }), - lineInfo: function (line) { - var n; - if (typeof line == "number") { - if (!isLine(this, line)) { - return null; - } - n = line; - line = getLine(this, line); - if (!line) { - return null; - } - } else { - n = lineNo(line); - if (n == null) { - return null; - } - } - return { - line: n, - handle: line, - text: line.text, - gutterMarkers: line.gutterMarkers, - textClass: line.textClass, - bgClass: line.bgClass, - wrapClass: line.wrapClass, - widgets: line.widgets - }; - }, - addLineClass: docMethodOp(function (handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop2 = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop2]) { - line[prop2] = cls; - } else if (classTest(cls).test(line[prop2])) { - return false; - } else { - line[prop2] += " " + cls; - } - return true; - }); - }), - removeLineClass: docMethodOp(function (handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop2 = where == "text" ? "textClass" : where == "background" ? "bgClass" : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop2]; - if (!cur) { - return false; - } else if (cls == null) { - line[prop2] = null; - } else { - var found = cur.match(classTest(cls)); - if (!found) { - return false; - } - var end = found.index + found[0].length; - line[prop2] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - addLineWidget: docMethodOp(function (handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - removeLineWidget: function (widget) { - widget.clear(); - }, - markText: function (from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); - }, - setBookmark: function (pos, options) { - var realOpts = { - replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, - shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents - }; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function (pos) { - pos = clipPos(this, pos); - var markers = [], - spans = getLine(this, pos.line).markedSpans; - if (spans) { - for (var i2 = 0; i2 < spans.length; ++i2) { - var span = spans[i2]; - if ((span.from == null || span.from <= pos.ch) && (span.to == null || span.to >= pos.ch)) { - markers.push(span.marker.parent || span.marker); - } - } - } - return markers; - }, - findMarks: function (from, to, filter) { - from = clipPos(this, from); - to = clipPos(this, to); - var found = [], - lineNo2 = from.line; - this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans; - if (spans) { - for (var i2 = 0; i2 < spans.length; i2++) { - var span = spans[i2]; - if (!(span.to != null && lineNo2 == from.line && from.ch >= span.to || span.from == null && lineNo2 != from.line || span.from != null && lineNo2 == to.line && span.from >= to.ch) && (!filter || filter(span.marker))) { - found.push(span.marker.parent || span.marker); - } - } - } - ++lineNo2; - }); - return found; - }, - getAllMarks: function () { - var markers = []; - this.iter(function (line) { - var sps = line.markedSpans; - if (sps) { - for (var i2 = 0; i2 < sps.length; ++i2) { - if (sps[i2].from != null) { - markers.push(sps[i2].marker); - } - } - } - }); - return markers; - }, - posFromIndex: function (off2) { - var ch, - lineNo2 = this.first, - sepSize = this.lineSeparator().length; - this.iter(function (line) { - var sz = line.text.length + sepSize; - if (sz > off2) { - ch = off2; - return true; - } - off2 -= sz; - ++lineNo2; - }); - return clipPos(this, Pos(lineNo2, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) { - return 0; - } - var sepSize = this.lineSeparator().length; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + sepSize; - }); - return index; - }, - copy: function (copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction); - doc.scrollTop = this.scrollTop; - doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - linkedDoc: function (options) { - if (!options) { - options = {}; - } - var from = this.first, - to = this.first + this.size; - if (options.from != null && options.from > from) { - from = options.from; - } - if (options.to != null && options.to < to) { - to = options.to; - } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); - if (options.sharedHist) { - copy.history = this.history; - } - (this.linked || (this.linked = [])).push({ - doc: copy, - sharedHist: options.sharedHist - }); - copy.linked = [{ - doc: this, - isParent: true, - sharedHist: options.sharedHist - }]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function (other) { - if (other instanceof CodeMirror2) { - other = other.doc; - } - if (this.linked) { - for (var i2 = 0; i2 < this.linked.length; ++i2) { - var link = this.linked[i2]; - if (link.doc != other) { - continue; - } - this.linked.splice(i2, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - } - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function (doc) { - return splitIds.push(doc.id); - }, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function (f) { - linkedDocs(this, f); - }, - getMode: function () { - return this.mode; - }, - getEditor: function () { - return this.cm; - }, - splitLines: function (str) { - if (this.lineSep) { - return str.split(this.lineSep); - } - return splitLinesAuto(str); - }, - lineSeparator: function () { - return this.lineSep || "\n"; - }, - setDirection: docMethodOp(function (dir) { - if (dir != "rtl") { - dir = "ltr"; - } - if (dir == this.direction) { - return; - } - this.direction = dir; - this.iter(function (line) { - return line.order = null; - }); - if (this.cm) { - directionChanged(this.cm); - } - }) - }); - Doc.prototype.eachLine = Doc.prototype.iter; - var lastDrop = 0; - function onDrop(e) { - var cm = this; - clearDragCursor(cm); - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e_preventDefault(e); - if (ie) { - lastDrop = +new Date(); - } - var pos = posFromMouse(cm, e, true), - files = e.dataTransfer.files; - if (!pos || cm.isReadOnly()) { - return; - } - if (files && files.length && window.FileReader && window.File) { - var n = files.length, - text = Array(n), - read = 0; - var markAsReadAndPasteIfAllFilesAreRead = /* @__PURE__ */__name(function () { - if (++read == n) { - operation(cm, function () { - pos = clipPos(cm.doc, pos); - var change = { - from: pos, - to: pos, - text: cm.doc.splitLines(text.filter(function (t) { - return t != null; - }).join(cm.doc.lineSeparator())), - origin: "paste" - }; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change)))); - })(); - } - }, "markAsReadAndPasteIfAllFilesAreRead"); - var readTextFromFile = /* @__PURE__ */__name(function (file, i3) { - if (cm.options.allowDropFileTypes && indexOf(cm.options.allowDropFileTypes, file.type) == -1) { - markAsReadAndPasteIfAllFilesAreRead(); - return; - } - var reader = new FileReader(); - reader.onerror = function () { - return markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.onload = function () { - var content = reader.result; - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { - markAsReadAndPasteIfAllFilesAreRead(); - return; - } - text[i3] = content; - markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.readAsText(file); - }, "readTextFromFile"); - for (var i2 = 0; i2 < files.length; i2++) { - readTextFromFile(files[i2], i2); - } - } else { - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - setTimeout(function () { - return cm.display.input.focus(); - }, 20); - return; - } - try { - var text$1 = e.dataTransfer.getData("Text"); - if (text$1) { - var selected; - if (cm.state.draggingText && !cm.state.draggingText.copy) { - selected = cm.listSelections(); - } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) { - for (var i$12 = 0; i$12 < selected.length; ++i$12) { - replaceRange(cm.doc, "", selected[i$12].anchor, selected[i$12].head, "drag"); - } - } - cm.replaceSelection(text$1, "around", "paste"); - cm.display.input.focus(); - } - } catch (e$1) {} - } - } - __name(onDrop, "onDrop"); - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date() - lastDrop < 100)) { - e_stop(e); - return; - } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e.dataTransfer.setData("Text", cm.getSelection()); - e.dataTransfer.effectAllowed = "copyMove"; - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) { - img.parentNode.removeChild(img); - } - } - } - __name(onDragStart, "onDragStart"); - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e); - if (!pos) { - return; - } - var frag = document.createDocumentFragment(); - drawSelectionCursor(cm, pos, frag); - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); - } - removeChildrenAndAdd(cm.display.dragCursor, frag); - } - __name(onDragOver, "onDragOver"); - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor); - cm.display.dragCursor = null; - } - } - __name(clearDragCursor, "clearDragCursor"); - function forEachCodeMirror(f) { - if (!document.getElementsByClassName) { - return; - } - var byClass = document.getElementsByClassName("CodeMirror"), - editors = []; - for (var i2 = 0; i2 < byClass.length; i2++) { - var cm = byClass[i2].CodeMirror; - if (cm) { - editors.push(cm); - } - } - if (editors.length) { - editors[0].operation(function () { - for (var i3 = 0; i3 < editors.length; i3++) { - f(editors[i3]); - } - }); - } - } - __name(forEachCodeMirror, "forEachCodeMirror"); - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) { - return; - } - registerGlobalHandlers(); - globalsRegistered = true; - } - __name(ensureGlobalHandlers, "ensureGlobalHandlers"); - function registerGlobalHandlers() { - var resizeTimer; - on(window, "resize", function () { - if (resizeTimer == null) { - resizeTimer = setTimeout(function () { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); - } - }); - on(window, "blur", function () { - return forEachCodeMirror(onBlur); - }); - } - __name(registerGlobalHandlers, "registerGlobalHandlers"); - function onResize(cm) { - var d = cm.display; - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - __name(onResize, "onResize"); - var keyNames = { - 3: "Pause", - 8: "Backspace", - 9: "Tab", - 13: "Enter", - 16: "Shift", - 17: "Ctrl", - 18: "Alt", - 19: "Pause", - 20: "CapsLock", - 27: "Esc", - 32: "Space", - 33: "PageUp", - 34: "PageDown", - 35: "End", - 36: "Home", - 37: "Left", - 38: "Up", - 39: "Right", - 40: "Down", - 44: "PrintScrn", - 45: "Insert", - 46: "Delete", - 59: ";", - 61: "=", - 91: "Mod", - 92: "Mod", - 93: "Mod", - 106: "*", - 107: "=", - 109: "-", - 110: ".", - 111: "/", - 145: "ScrollLock", - 173: "-", - 186: ";", - 187: "=", - 188: ",", - 189: "-", - 190: ".", - 191: "/", - 192: "`", - 219: "[", - 220: "\\", - 221: "]", - 222: "'", - 224: "Mod", - 63232: "Up", - 63233: "Down", - 63234: "Left", - 63235: "Right", - 63272: "Delete", - 63273: "Home", - 63275: "End", - 63276: "PageUp", - 63277: "PageDown", - 63302: "Insert" - }; - for (var i = 0; i < 10; i++) { - keyNames[i + 48] = keyNames[i + 96] = String(i); - } - for (var i$1 = 65; i$1 <= 90; i$1++) { - keyNames[i$1] = String.fromCharCode(i$1); - } - for (var i$2 = 1; i$2 <= 12; i$2++) { - keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; - } - var keyMap = {}; - keyMap.basic = { - "Left": "goCharLeft", - "Right": "goCharRight", - "Up": "goLineUp", - "Down": "goLineDown", - "End": "goLineEnd", - "Home": "goLineStartSmart", - "PageUp": "goPageUp", - "PageDown": "goPageDown", - "Delete": "delCharAfter", - "Backspace": "delCharBefore", - "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", - "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", - "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - keyMap.pcDefault = { - "Ctrl-A": "selectAll", - "Ctrl-D": "deleteLine", - "Ctrl-Z": "undo", - "Shift-Ctrl-Z": "redo", - "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", - "Ctrl-End": "goDocEnd", - "Ctrl-Up": "goLineUp", - "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", - "Ctrl-Right": "goGroupRight", - "Alt-Left": "goLineStart", - "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", - "Ctrl-Delete": "delGroupAfter", - "Ctrl-S": "save", - "Ctrl-F": "find", - "Ctrl-G": "findNext", - "Shift-Ctrl-G": "findPrev", - "Shift-Ctrl-F": "replace", - "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", - "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", - "Shift-Ctrl-U": "redoSelection", - "Alt-U": "redoSelection", - "fallthrough": "basic" - }; - keyMap.emacsy = { - "Ctrl-F": "goCharRight", - "Ctrl-B": "goCharLeft", - "Ctrl-P": "goLineUp", - "Ctrl-N": "goLineDown", - "Ctrl-A": "goLineStart", - "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", - "Shift-Ctrl-V": "goPageUp", - "Ctrl-D": "delCharAfter", - "Ctrl-H": "delCharBefore", - "Alt-Backspace": "delWordBefore", - "Ctrl-K": "killLine", - "Ctrl-T": "transposeChars", - "Ctrl-O": "openLine" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", - "Cmd-D": "deleteLine", - "Cmd-Z": "undo", - "Shift-Cmd-Z": "redo", - "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", - "Cmd-Up": "goDocStart", - "Cmd-End": "goDocEnd", - "Cmd-Down": "goDocEnd", - "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", - "Cmd-Left": "goLineLeft", - "Cmd-Right": "goLineRight", - "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", - "Alt-Delete": "delGroupAfter", - "Cmd-S": "save", - "Cmd-F": "find", - "Cmd-G": "findNext", - "Shift-Cmd-G": "findPrev", - "Cmd-Alt-F": "replace", - "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", - "Cmd-]": "indentMore", - "Cmd-Backspace": "delWrappedLineLeft", - "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", - "Shift-Cmd-U": "redoSelection", - "Ctrl-Up": "goDocStart", - "Ctrl-Down": "goDocEnd", - "fallthrough": ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/); - name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i2 = 0; i2 < parts.length - 1; i2++) { - var mod = parts[i2]; - if (/^(cmd|meta|m)$/i.test(mod)) { - cmd = true; - } else if (/^a(lt)?$/i.test(mod)) { - alt = true; - } else if (/^(c|ctrl|control)$/i.test(mod)) { - ctrl = true; - } else if (/^s(hift)?$/i.test(mod)) { - shift = true; - } else { - throw new Error("Unrecognized modifier name: " + mod); - } - } - if (alt) { - name = "Alt-" + name; - } - if (ctrl) { - name = "Ctrl-" + name; - } - if (cmd) { - name = "Cmd-" + name; - } - if (shift) { - name = "Shift-" + name; - } - return name; - } - __name(normalizeKeyName, "normalizeKeyName"); - function normalizeKeyMap(keymap) { - var copy = {}; - for (var keyname in keymap) { - if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { - continue; - } - if (value == "...") { - delete keymap[keyname]; - continue; - } - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i2 = 0; i2 < keys.length; i2++) { - var val = void 0, - name = void 0; - if (i2 == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i2 + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) { - copy[name] = val; - } else if (prev != val) { - throw new Error("Inconsistent bindings for " + name); - } - } - delete keymap[keyname]; - } - } - for (var prop2 in copy) { - keymap[prop2] = copy[prop2]; - } - return keymap; - } - __name(normalizeKeyMap, "normalizeKeyMap"); - function lookupKey(key, map2, handle, context) { - map2 = getKeyMap(map2); - var found = map2.call ? map2.call(key, context) : map2[key]; - if (found === false) { - return "nothing"; - } - if (found === "...") { - return "multi"; - } - if (found != null && handle(found)) { - return "handled"; - } - if (map2.fallthrough) { - if (Object.prototype.toString.call(map2.fallthrough) != "[object Array]") { - return lookupKey(key, map2.fallthrough, handle, context); - } - for (var i2 = 0; i2 < map2.fallthrough.length; i2++) { - var result = lookupKey(key, map2.fallthrough[i2], handle, context); - if (result) { - return result; - } - } - } - } - __name(lookupKey, "lookupKey"); - function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - } - __name(isModifierKey, "isModifierKey"); - function addModifierNames(name, event, noShift) { - var base = name; - if (event.altKey && base != "Alt") { - name = "Alt-" + name; - } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { - name = "Ctrl-" + name; - } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { - name = "Cmd-" + name; - } - if (!noShift && event.shiftKey && base != "Shift") { - name = "Shift-" + name; - } - return name; - } - __name(addModifierNames, "addModifierNames"); - function keyName(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) { - return false; - } - var name = keyNames[event.keyCode]; - if (name == null || event.altGraphKey) { - return false; - } - if (event.keyCode == 3 && event.code) { - name = event.code; - } - return addModifierNames(name, event, noShift); - } - __name(keyName, "keyName"); - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val; - } - __name(getKeyMap, "getKeyMap"); - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, - kill = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - var toKill = compute(ranges[i2]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - runInOp(cm, function () { - for (var i3 = kill.length - 1; i3 >= 0; i3--) { - replaceRange(cm.doc, "", kill[i3].from, kill[i3].to, "+delete"); - } - ensureCursorVisible(cm); - }); - } - __name(deleteNearSelection, "deleteNearSelection"); - function moveCharLogically(line, ch, dir) { - var target = skipExtendingChars(line.text, ch + dir, dir); - return target < 0 || target > line.text.length ? null : target; - } - __name(moveCharLogically, "moveCharLogically"); - function moveLogically(line, start, dir) { - var ch = moveCharLogically(line, start.ch, dir); - return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before"); - } - __name(moveLogically, "moveLogically"); - function endOfLine(visually, cm, lineObj, lineNo2, dir) { - if (visually) { - if (cm.doc.direction == "rtl") { - dir = -dir; - } - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = dir < 0 ? lst(order) : order[0]; - var moveInStorageOrder = dir < 0 == (part.level == 1); - var sticky = moveInStorageOrder ? "after" : "before"; - var ch; - if (part.level > 0 || cm.doc.direction == "rtl") { - var prep = prepareMeasureForLine(cm, lineObj); - ch = dir < 0 ? lineObj.text.length - 1 : 0; - var targetTop = measureCharPrepared(cm, prep, ch).top; - ch = findFirst(function (ch2) { - return measureCharPrepared(cm, prep, ch2).top == targetTop; - }, dir < 0 == (part.level == 1) ? part.from : part.to - 1, ch); - if (sticky == "before") { - ch = moveCharLogically(lineObj, ch, 1); - } - } else { - ch = dir < 0 ? part.to : part.from; - } - return new Pos(lineNo2, ch, sticky); - } - } - return new Pos(lineNo2, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after"); - } - __name(endOfLine, "endOfLine"); - function moveVisually(cm, line, start, dir) { - var bidi = getOrder(line, cm.doc.direction); - if (!bidi) { - return moveLogically(line, start, dir); - } - if (start.ch >= line.text.length) { - start.ch = line.text.length; - start.sticky = "before"; - } else if (start.ch <= 0) { - start.ch = 0; - start.sticky = "after"; - } - var partPos = getBidiPartAt(bidi, start.ch, start.sticky), - part = bidi[partPos]; - if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { - return moveLogically(line, start, dir); - } - var mv = /* @__PURE__ */__name(function (pos, dir2) { - return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir2); - }, "mv"); - var prep; - var getWrappedLineExtent = /* @__PURE__ */__name(function (ch2) { - if (!cm.options.lineWrapping) { - return { - begin: 0, - end: line.text.length - }; - } - prep = prep || prepareMeasureForLine(cm, line); - return wrappedLineExtentChar(cm, line, prep, ch2); - }, "getWrappedLineExtent"); - var wrappedLineExtent2 = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); - if (cm.doc.direction == "rtl" || part.level == 1) { - var moveInStorageOrder = part.level == 1 == dir < 0; - var ch = mv(start, moveInStorageOrder ? 1 : -1); - if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent2.begin : ch <= part.to && ch <= wrappedLineExtent2.end)) { - var sticky = moveInStorageOrder ? "before" : "after"; - return new Pos(start.line, ch, sticky); - } - } - var searchInVisualLine = /* @__PURE__ */__name(function (partPos2, dir2, wrappedLineExtent3) { - var getRes = /* @__PURE__ */__name(function (ch3, moveInStorageOrder3) { - return moveInStorageOrder3 ? new Pos(start.line, mv(ch3, 1), "before") : new Pos(start.line, ch3, "after"); - }, "getRes"); - for (; partPos2 >= 0 && partPos2 < bidi.length; partPos2 += dir2) { - var part2 = bidi[partPos2]; - var moveInStorageOrder2 = dir2 > 0 == (part2.level != 1); - var ch2 = moveInStorageOrder2 ? wrappedLineExtent3.begin : mv(wrappedLineExtent3.end, -1); - if (part2.from <= ch2 && ch2 < part2.to) { - return getRes(ch2, moveInStorageOrder2); - } - ch2 = moveInStorageOrder2 ? part2.from : mv(part2.to, -1); - if (wrappedLineExtent3.begin <= ch2 && ch2 < wrappedLineExtent3.end) { - return getRes(ch2, moveInStorageOrder2); - } - } - }, "searchInVisualLine"); - var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent2); - if (res) { - return res; - } - var nextCh = dir > 0 ? wrappedLineExtent2.end : mv(wrappedLineExtent2.begin, -1); - if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { - res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); - if (res) { - return res; - } - } - return null; - } - __name(moveVisually, "moveVisually"); - var commands = { - selectAll, - singleSelection: function (cm) { - return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function (cm) { - return deleteNearSelection(cm, function (range2) { - if (range2.empty()) { - var len = getLine(cm.doc, range2.head.line).text.length; - if (range2.head.ch == len && range2.head.line < cm.lastLine()) { - return { - from: range2.head, - to: Pos(range2.head.line + 1, 0) - }; - } else { - return { - from: range2.head, - to: Pos(range2.head.line, len) - }; - } - } else { - return { - from: range2.from(), - to: range2.to() - }; - } - }); - }, - deleteLine: function (cm) { - return deleteNearSelection(cm, function (range2) { - return { - from: Pos(range2.from().line, 0), - to: clipPos(cm.doc, Pos(range2.to().line + 1, 0)) - }; - }); - }, - delLineLeft: function (cm) { - return deleteNearSelection(cm, function (range2) { - return { - from: Pos(range2.from().line, 0), - to: range2.from() - }; - }); - }, - delWrappedLineLeft: function (cm) { - return deleteNearSelection(cm, function (range2) { - var top = cm.charCoords(range2.head, "div").top + 5; - var leftPos = cm.coordsChar({ - left: 0, - top - }, "div"); - return { - from: leftPos, - to: range2.from() - }; - }); - }, - delWrappedLineRight: function (cm) { - return deleteNearSelection(cm, function (range2) { - var top = cm.charCoords(range2.head, "div").top + 5; - var rightPos = cm.coordsChar({ - left: cm.display.lineDiv.offsetWidth + 100, - top - }, "div"); - return { - from: range2.from(), - to: rightPos - }; - }); - }, - undo: function (cm) { - return cm.undo(); - }, - redo: function (cm) { - return cm.redo(); - }, - undoSelection: function (cm) { - return cm.undoSelection(); - }, - redoSelection: function (cm) { - return cm.redoSelection(); - }, - goDocStart: function (cm) { - return cm.extendSelection(Pos(cm.firstLine(), 0)); - }, - goDocEnd: function (cm) { - return cm.extendSelection(Pos(cm.lastLine())); - }, - goLineStart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineStart(cm, range2.head.line); - }, { - origin: "+move", - bias: 1 - }); - }, - goLineStartSmart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineStartSmart(cm, range2.head); - }, { - origin: "+move", - bias: 1 - }); - }, - goLineEnd: function (cm) { - return cm.extendSelectionsBy(function (range2) { - return lineEnd(cm, range2.head.line); - }, { - origin: "+move", - bias: -1 - }); - }, - goLineRight: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - return cm.coordsChar({ - left: cm.display.lineDiv.offsetWidth + 100, - top - }, "div"); - }, sel_move); - }, - goLineLeft: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - return cm.coordsChar({ - left: 0, - top - }, "div"); - }, sel_move); - }, - goLineLeftSmart: function (cm) { - return cm.extendSelectionsBy(function (range2) { - var top = cm.cursorCoords(range2.head, "div").top + 5; - var pos = cm.coordsChar({ - left: 0, - top - }, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) { - return lineStartSmart(cm, range2.head); - } - return pos; - }, sel_move); - }, - goLineUp: function (cm) { - return cm.moveV(-1, "line"); - }, - goLineDown: function (cm) { - return cm.moveV(1, "line"); - }, - goPageUp: function (cm) { - return cm.moveV(-1, "page"); - }, - goPageDown: function (cm) { - return cm.moveV(1, "page"); - }, - goCharLeft: function (cm) { - return cm.moveH(-1, "char"); - }, - goCharRight: function (cm) { - return cm.moveH(1, "char"); - }, - goColumnLeft: function (cm) { - return cm.moveH(-1, "column"); - }, - goColumnRight: function (cm) { - return cm.moveH(1, "column"); - }, - goWordLeft: function (cm) { - return cm.moveH(-1, "word"); - }, - goGroupRight: function (cm) { - return cm.moveH(1, "group"); - }, - goGroupLeft: function (cm) { - return cm.moveH(-1, "group"); - }, - goWordRight: function (cm) { - return cm.moveH(1, "word"); - }, - delCharBefore: function (cm) { - return cm.deleteH(-1, "codepoint"); - }, - delCharAfter: function (cm) { - return cm.deleteH(1, "char"); - }, - delWordBefore: function (cm) { - return cm.deleteH(-1, "word"); - }, - delWordAfter: function (cm) { - return cm.deleteH(1, "word"); - }, - delGroupBefore: function (cm) { - return cm.deleteH(-1, "group"); - }, - delGroupAfter: function (cm) { - return cm.deleteH(1, "group"); - }, - indentAuto: function (cm) { - return cm.indentSelection("smart"); - }, - indentMore: function (cm) { - return cm.indentSelection("add"); - }, - indentLess: function (cm) { - return cm.indentSelection("subtract"); - }, - insertTab: function (cm) { - return cm.replaceSelection(" "); - }, - insertSoftTab: function (cm) { - var spaces = [], - ranges = cm.listSelections(), - tabSize = cm.options.tabSize; - for (var i2 = 0; i2 < ranges.length; i2++) { - var pos = ranges[i2].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(spaceStr(tabSize - col % tabSize)); - } - cm.replaceSelections(spaces); - }, - defaultTab: function (cm) { - if (cm.somethingSelected()) { - cm.indentSelection("add"); - } else { - cm.execCommand("insertTab"); - } - }, - transposeChars: function (cm) { - return runInOp(cm, function () { - var ranges = cm.listSelections(), - newSel = []; - for (var i2 = 0; i2 < ranges.length; i2++) { - if (!ranges[i2].empty()) { - continue; - } - var cur = ranges[i2].head, - line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) { - cur = new Pos(cur.line, cur.ch - 1); - } - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) { - cur = new Pos(cur.line, 1); - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + prev.charAt(prev.length - 1), Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); - } - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function (cm) { - return runInOp(cm, function () { - var sels = cm.listSelections(); - for (var i2 = sels.length - 1; i2 >= 0; i2--) { - cm.replaceRange(cm.doc.lineSeparator(), sels[i2].anchor, sels[i2].head, "+input"); - } - sels = cm.listSelections(); - for (var i$12 = 0; i$12 < sels.length; i$12++) { - cm.indentLine(sels[i$12].from().line, null, true); - } - ensureCursorVisible(cm); - }); - }, - openLine: function (cm) { - return cm.replaceSelection("\n", "start"); - }, - toggleOverwrite: function (cm) { - return cm.toggleOverwrite(); - } - }; - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) { - lineN = lineNo(visual); - } - return endOfLine(true, cm, visual, lineN, 1); - } - __name(lineStart, "lineStart"); - function lineEnd(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLineEnd(line); - if (visual != line) { - lineN = lineNo(visual); - } - return endOfLine(true, cm, line, lineN, -1); - } - __name(lineEnd, "lineEnd"); - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line, cm.doc.direction); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(start.ch, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky); - } - return start; - } - __name(lineStartSmart, "lineStartSmart"); - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) { - return false; - } - } - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, - done = false; - try { - if (cm.isReadOnly()) { - cm.state.suppressEdits = true; - } - if (dropShift) { - cm.display.shift = false; - } - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - __name(doHandleBinding, "doHandleBinding"); - function lookupKeyForEditor(cm, name, handle) { - for (var i2 = 0; i2 < cm.state.keyMaps.length; i2++) { - var result = lookupKey(name, cm.state.keyMaps[i2], handle, cm); - if (result) { - return result; - } - } - return cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm) || lookupKey(name, cm.options.keyMap, handle, cm); - } - __name(lookupKeyForEditor, "lookupKeyForEditor"); - var stopSeq = new Delayed(); - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) { - return "handled"; - } - if (/\'$/.test(name)) { - cm.state.keySeq = null; - } else { - stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); - } - if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { - return true; - } - } - return dispatchKeyInner(cm, name, e, handle); - } - __name(dispatchKey, "dispatchKey"); - function dispatchKeyInner(cm, name, e, handle) { - var result = lookupKeyForEditor(cm, name, handle); - if (result == "multi") { - cm.state.keySeq = name; - } - if (result == "handled") { - signalLater(cm, "keyHandled", cm, name, e); - } - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - return !!result; - } - __name(dispatchKeyInner, "dispatchKeyInner"); - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) { - return false; - } - if (e.shiftKey && !cm.state.keySeq) { - return dispatchKey(cm, "Shift-" + name, e, function (b) { - return doHandleBinding(cm, b, true); - }) || dispatchKey(cm, name, e, function (b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) { - return doHandleBinding(cm, b); - } - }); - } else { - return dispatchKey(cm, name, e, function (b) { - return doHandleBinding(cm, b); - }); - } - } - __name(handleKeyBinding, "handleKeyBinding"); - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, function (b) { - return doHandleBinding(cm, b, true); - }); - } - __name(handleCharBinding, "handleCharBinding"); - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { - return; - } - cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) { - return; - } - if (ie && ie_version < 11 && e.keyCode == 27) { - e.returnValue = false; - } - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) { - cm.replaceSelection("", null, "cut"); - } - } - if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand) { - document.execCommand("cut"); - } - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) { - showCrossHair(cm); - } - } - __name(onKeyDown, "onKeyDown"); - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - __name(up, "up"); - on(document, "keyup", up); - on(document, "mouseover", up); - } - __name(showCrossHair, "showCrossHair"); - function onKeyUp(e) { - if (e.keyCode == 16) { - this.doc.sel.shift = false; - } - signalDOMEvent(this, e); - } - __name(onKeyUp, "onKeyUp"); - function onKeyPress(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { - return; - } - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { - return; - } - var keyCode = e.keyCode, - charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) { - lastStoppedKey = null; - e_preventDefault(e); - return; - } - if (presto && (!e.which || e.which < 10) && handleKeyBinding(cm, e)) { - return; - } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (ch == "\b") { - return; - } - if (handleCharBinding(cm, e, ch)) { - return; - } - cm.display.input.onKeyPress(e); - } - __name(onKeyPress, "onKeyPress"); - var DOUBLECLICK_DELAY = 400; - var PastClick = /* @__PURE__ */__name(function (time, pos, button) { - this.time = time; - this.pos = pos; - this.button = button; - }, "PastClick"); - PastClick.prototype.compare = function (time, pos, button) { - return this.time + DOUBLECLICK_DELAY > time && cmp(pos, this.pos) == 0 && button == this.button; - }; - var lastClick, lastDoubleClick; - function clickRepeat(pos, button) { - var now = +new Date(); - if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { - lastClick = lastDoubleClick = null; - return "triple"; - } else if (lastClick && lastClick.compare(now, pos, button)) { - lastDoubleClick = new PastClick(now, pos, button); - lastClick = null; - return "double"; - } else { - lastClick = new PastClick(now, pos, button); - lastDoubleClick = null; - return "single"; - } - } - __name(clickRepeat, "clickRepeat"); - function onMouseDown(e) { - var cm = this, - display = cm.display; - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { - return; - } - display.input.ensurePolled(); - display.shift = e.shiftKey; - if (eventInWidget(display, e)) { - if (!webkit) { - display.scroller.draggable = false; - setTimeout(function () { - return display.scroller.draggable = true; - }, 100); - } - return; - } - if (clickInGutter(cm, e)) { - return; - } - var pos = posFromMouse(cm, e), - button = e_button(e), - repeat = pos ? clickRepeat(pos, button) : "single"; - window.focus(); - if (button == 1 && cm.state.selectingText) { - cm.state.selectingText(e); - } - if (pos && handleMappedButton(cm, button, pos, repeat, e)) { - return; - } - if (button == 1) { - if (pos) { - leftButtonDown(cm, pos, repeat, e); - } else if (e_target(e) == display.scroller) { - e_preventDefault(e); - } - } else if (button == 2) { - if (pos) { - extendSelection(cm.doc, pos); - } - setTimeout(function () { - return display.input.focus(); - }, 20); - } else if (button == 3) { - if (captureRightClick) { - cm.display.input.onContextMenu(e); - } else { - delayBlurEvent(cm); - } - } - } - __name(onMouseDown, "onMouseDown"); - function handleMappedButton(cm, button, pos, repeat, event) { - var name = "Click"; - if (repeat == "double") { - name = "Double" + name; - } else if (repeat == "triple") { - name = "Triple" + name; - } - name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; - return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { - if (typeof bound == "string") { - bound = commands[bound]; - } - if (!bound) { - return false; - } - var done = false; - try { - if (cm.isReadOnly()) { - cm.state.suppressEdits = true; - } - done = bound(cm, pos) != Pass; - } finally { - cm.state.suppressEdits = false; - } - return done; - }); - } - __name(handleMappedButton, "handleMappedButton"); - function configureMouse(cm, repeat, event) { - var option = cm.getOption("configureMouse"); - var value = option ? option(cm, repeat, event) : {}; - if (value.unit == null) { - var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; - value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; - } - if (value.extend == null || cm.doc.extend) { - value.extend = cm.doc.extend || event.shiftKey; - } - if (value.addNew == null) { - value.addNew = mac ? event.metaKey : event.ctrlKey; - } - if (value.moveOnDrag == null) { - value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); - } - return value; - } - __name(configureMouse, "configureMouse"); - function leftButtonDown(cm, pos, repeat, event) { - if (ie) { - setTimeout(bind(ensureFocus, cm), 0); - } else { - cm.curOp.focus = activeElt(); - } - var behavior = configureMouse(cm, repeat, event); - var sel = cm.doc.sel, - contained; - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && repeat == "single" && (contained = sel.contains(pos)) > -1 && (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) { - leftButtonStartDrag(cm, event, pos, behavior); - } else { - leftButtonSelect(cm, event, pos, behavior); - } - } - __name(leftButtonDown, "leftButtonDown"); - function leftButtonStartDrag(cm, event, pos, behavior) { - var display = cm.display, - moved = false; - var dragEnd = operation(cm, function (e) { - if (webkit) { - display.scroller.draggable = false; - } - cm.state.draggingText = false; - if (cm.state.delayingBlurEvent) { - if (cm.hasFocus()) { - cm.state.delayingBlurEvent = false; - } else { - delayBlurEvent(cm); - } - } - off(display.wrapper.ownerDocument, "mouseup", dragEnd); - off(display.wrapper.ownerDocument, "mousemove", mouseMove); - off(display.scroller, "dragstart", dragStart); - off(display.scroller, "drop", dragEnd); - if (!moved) { - e_preventDefault(e); - if (!behavior.addNew) { - extendSelection(cm.doc, pos, null, null, behavior.extend); - } - if (webkit && !safari || ie && ie_version == 9) { - setTimeout(function () { - display.wrapper.ownerDocument.body.focus({ - preventScroll: true - }); - display.input.focus(); - }, 20); - } else { - display.input.focus(); - } - } - }); - var mouseMove = /* @__PURE__ */__name(function (e2) { - moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; - }, "mouseMove"); - var dragStart = /* @__PURE__ */__name(function () { - return moved = true; - }, "dragStart"); - if (webkit) { - display.scroller.draggable = true; - } - cm.state.draggingText = dragEnd; - dragEnd.copy = !behavior.moveOnDrag; - on(display.wrapper.ownerDocument, "mouseup", dragEnd); - on(display.wrapper.ownerDocument, "mousemove", mouseMove); - on(display.scroller, "dragstart", dragStart); - on(display.scroller, "drop", dragEnd); - cm.state.delayingBlurEvent = true; - setTimeout(function () { - return display.input.focus(); - }, 20); - if (display.scroller.dragDrop) { - display.scroller.dragDrop(); - } - } - __name(leftButtonStartDrag, "leftButtonStartDrag"); - function rangeForUnit(cm, pos, unit) { - if (unit == "char") { - return new Range(pos, pos); - } - if (unit == "word") { - return cm.findWordAt(pos); - } - if (unit == "line") { - return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); - } - var result = unit(cm, pos); - return new Range(result.from, result.to); - } - __name(rangeForUnit, "rangeForUnit"); - function leftButtonSelect(cm, event, start, behavior) { - if (ie) { - delayBlurEvent(cm); - } - var display = cm.display, - doc = cm.doc; - e_preventDefault(event); - var ourRange, - ourIndex, - startSel = doc.sel, - ranges = startSel.ranges; - if (behavior.addNew && !behavior.extend) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) { - ourRange = ranges[ourIndex]; - } else { - ourRange = new Range(start, start); - } - } else { - ourRange = doc.sel.primary(); - ourIndex = doc.sel.primIndex; - } - if (behavior.unit == "rectangle") { - if (!behavior.addNew) { - ourRange = new Range(start, start); - } - start = posFromMouse(cm, event, true, true); - ourIndex = -1; - } else { - var range2 = rangeForUnit(cm, start, behavior.unit); - if (behavior.extend) { - ourRange = extendRange(ourRange, range2.anchor, range2.head, behavior.extend); - } else { - ourRange = range2; - } - } - if (!behavior.addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), { - scroll: false, - origin: "*mouse" - }); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), { - scroll: false, - origin: "*mouse" - }); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) { - return; - } - lastPos = pos; - if (behavior.unit == "rectangle") { - var ranges2 = [], - tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), - right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); line <= end; line++) { - var text = getLine(doc, line).text, - leftPos = findColumn(text, left, tabSize); - if (left == right) { - ranges2.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - } else if (text.length > leftPos) { - ranges2.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - } - if (!ranges2.length) { - ranges2.push(new Range(start, start)); - } - setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges2), ourIndex), { - origin: "*mouse", - scroll: false - }); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var range3 = rangeForUnit(cm, pos, behavior.unit); - var anchor = oldRange.anchor, - head; - if (cmp(range3.anchor, anchor) > 0) { - head = range3.head; - anchor = minPos(oldRange.from(), range3.anchor); - } else { - head = range3.anchor; - anchor = maxPos(oldRange.to(), range3.head); - } - var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); - setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); - } - } - __name(extendTo, "extendTo"); - var editorSize = display.wrapper.getBoundingClientRect(); - var counter = 0; - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); - if (!cur) { - return; - } - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) { - setTimeout(operation(cm, function () { - if (counter == curCount) { - extend(e); - } - }), 150); - } - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) { - setTimeout(operation(cm, function () { - if (counter != curCount) { - return; - } - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - } - __name(extend, "extend"); - function done(e) { - cm.state.selectingText = false; - counter = Infinity; - if (e) { - e_preventDefault(e); - display.input.focus(); - } - off(display.wrapper.ownerDocument, "mousemove", move); - off(display.wrapper.ownerDocument, "mouseup", up); - doc.history.lastSelOrigin = null; - } - __name(done, "done"); - var move = operation(cm, function (e) { - if (e.buttons === 0 || !e_button(e)) { - done(e); - } else { - extend(e); - } - }); - var up = operation(cm, done); - cm.state.selectingText = up; - on(display.wrapper.ownerDocument, "mousemove", move); - on(display.wrapper.ownerDocument, "mouseup", up); - } - __name(leftButtonSelect, "leftButtonSelect"); - function bidiSimplify(cm, range2) { - var anchor = range2.anchor; - var head = range2.head; - var anchorLine = getLine(cm.doc, anchor.line); - if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { - return range2; - } - var order = getOrder(anchorLine); - if (!order) { - return range2; - } - var index = getBidiPartAt(order, anchor.ch, anchor.sticky), - part = order[index]; - if (part.from != anchor.ch && part.to != anchor.ch) { - return range2; - } - var boundary = index + (part.from == anchor.ch == (part.level != 1) ? 0 : 1); - if (boundary == 0 || boundary == order.length) { - return range2; - } - var leftSide; - if (head.line != anchor.line) { - leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; - } else { - var headIndex = getBidiPartAt(order, head.ch, head.sticky); - var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); - if (headIndex == boundary - 1 || headIndex == boundary) { - leftSide = dir < 0; - } else { - leftSide = dir > 0; - } - } - var usePart = order[boundary + (leftSide ? -1 : 0)]; - var from = leftSide == (usePart.level == 1); - var ch = from ? usePart.from : usePart.to, - sticky = from ? "after" : "before"; - return anchor.ch == ch && anchor.sticky == sticky ? range2 : new Range(new Pos(anchor.line, ch, sticky), head); - } - __name(bidiSimplify, "bidiSimplify"); - function gutterEvent(cm, e, type, prevent) { - var mX, mY; - if (e.touches) { - mX = e.touches[0].clientX; - mY = e.touches[0].clientY; - } else { - try { - mX = e.clientX; - mY = e.clientY; - } catch (e$1) { - return false; - } - } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { - return false; - } - if (prevent) { - e_preventDefault(e); - } - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - if (mY > lineBox.bottom || !hasHandler(cm, type)) { - return e_defaultPrevented(e); - } - mY -= lineBox.top - display.viewOffset; - for (var i2 = 0; i2 < cm.display.gutterSpecs.length; ++i2) { - var g = display.gutters.childNodes[i2]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.display.gutterSpecs[i2]; - signal(cm, type, cm, line, gutter.className, e); - return e_defaultPrevented(e); - } - } - } - __name(gutterEvent, "gutterEvent"); - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true); - } - __name(clickInGutter, "clickInGutter"); - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { - return; - } - if (signalDOMEvent(cm, e, "contextmenu")) { - return; - } - if (!captureRightClick) { - cm.display.input.onContextMenu(e); - } - } - __name(onContextMenu, "onContextMenu"); - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) { - return false; - } - return gutterEvent(cm, e, "gutterContextMenu", false); - } - __name(contextMenuInGutter, "contextMenuInGutter"); - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - __name(themeChanged, "themeChanged"); - var Init = { - toString: function () { - return "CodeMirror.Init"; - } - }; - var defaults = {}; - var optionHandlers = {}; - function defineOptions(CodeMirror3) { - var optionHandlers2 = CodeMirror3.optionHandlers; - function option(name, deflt, handle, notOnInit) { - CodeMirror3.defaults[name] = deflt; - if (handle) { - optionHandlers2[name] = notOnInit ? function (cm, val, old) { - if (old != Init) { - handle(cm, val, old); - } - } : handle; - } - } - __name(option, "option"); - CodeMirror3.defineOption = option; - CodeMirror3.Init = Init; - option("value", "", function (cm, val) { - return cm.setValue(val); - }, true); - option("mode", null, function (cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function (cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val; - if (!val) { - return; - } - var newBreaks = [], - lineNo2 = cm.doc.first; - cm.doc.iter(function (line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) { - break; - } - pos = found + val.length; - newBreaks.push(Pos(lineNo2, found)); - } - lineNo2++; - }); - for (var i2 = newBreaks.length - 1; i2 >= 0; i2--) { - replaceRange(cm.doc, val, newBreaks[i2], Pos(newBreaks[i2].line, newBreaks[i2].ch + val.length)); - } - }); - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test(" ") ? "" : "| "), "g"); - if (old != Init) { - cm.refresh(); - } - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { - return cm.refresh(); - }, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function () { - throw new Error("inputStyle can not (yet) be changed in a running editor"); - }, true); - option("spellcheck", false, function (cm, val) { - return cm.getInputField().spellcheck = val; - }, true); - option("autocorrect", false, function (cm, val) { - return cm.getInputField().autocorrect = val; - }, true); - option("autocapitalize", false, function (cm, val) { - return cm.getInputField().autocapitalize = val; - }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - option("theme", "default", function (cm) { - themeChanged(cm); - updateGutters(cm); - }, true); - option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val); - var prev = old != Init && getKeyMap(old); - if (prev && prev.detach) { - prev.detach(cm, next); - } - if (next.attach) { - next.attach(cm, prev || null); - } - }); - option("extraKeys", null); - option("configureMouse", null); - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function (cm, val) { - cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); - updateGutters(cm); - }, true); - option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function (cm) { - return updateScrollbars(cm); - }, true); - option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function (cm, val) { - cm.display.gutterSpecs = getGutters(cm.options.gutters, val); - updateGutters(cm); - }, true); - option("firstLineNumber", 1, updateGutters, true); - option("lineNumberFormatter", function (integer) { - return integer; - }, updateGutters, true); - option("showCursorWhenSelecting", false, updateSelection, true); - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - option("pasteLinesPerSelection", true); - option("selectionsMayTouch", false); - option("readOnly", false, function (cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - } - cm.display.input.readOnlyChanged(val); - }); - option("screenReaderLabel", null, function (cm, val) { - val = val === "" ? null : val; - cm.display.input.screenReaderLabelChanged(val); - }); - option("disableInput", false, function (cm, val) { - if (!val) { - cm.display.input.reset(); - } - }, true); - option("dragDrop", true, dragDropChanged); - option("allowDropFileTypes", null); - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function (cm, val) { - return cm.doc.history.undoDepth = val; - }); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function (cm) { - return cm.refresh(); - }, true); - option("maxHighlightLength", 1e4, resetModeState, true); - option("moveInputWithCursor", true, function (cm, val) { - if (!val) { - cm.display.input.resetPosition(); - } - }); - option("tabindex", null, function (cm, val) { - return cm.display.input.getField().tabIndex = val || ""; - }); - option("autofocus", null); - option("direction", "ltr", function (cm, val) { - return cm.doc.setDirection(val); - }, true); - option("phrases", null); - } - __name(defineOptions, "defineOptions"); - function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.enter); - toggle(cm.display.scroller, "dragover", funcs.over); - toggle(cm.display.scroller, "dragleave", funcs.leave); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - __name(dragDropChanged, "dragDropChanged"); - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function () { - return updateScrollbars(cm); - }, 100); - } - __name(wrappingChanged, "wrappingChanged"); - function CodeMirror2(place, options) { - var this$1$1 = this; - if (!(this instanceof CodeMirror2)) { - return new CodeMirror2(place, options); - } - this.options = options = options ? copyObj(options) : {}; - copyObj(defaults, options, false); - var doc = options.value; - if (typeof doc == "string") { - doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); - } else if (options.mode) { - doc.modeOption = options.mode; - } - this.doc = doc; - var input = new CodeMirror2.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input, options); - display.wrapper.CodeMirror = this; - themeChanged(this); - if (options.lineWrapping) { - this.display.wrapper.className += " CodeMirror-wrap"; - } - initScrollbars(this); - this.state = { - keyMaps: [], - overlays: [], - modeGen: 0, - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, - pasteIncoming: -1, - cutIncoming: -1, - selectingText: false, - draggingText: false, - highlight: new Delayed(), - keySeq: null, - specialChars: null - }; - if (options.autofocus && !mobile) { - display.input.focus(); - } - if (ie && ie_version < 11) { - setTimeout(function () { - return this$1$1.display.input.reset(true); - }, 20); - } - registerEventHandlers(this); - ensureGlobalHandlers(); - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - if (options.autofocus && !mobile || this.hasFocus()) { - setTimeout(function () { - if (this$1$1.hasFocus() && !this$1$1.state.focused) { - onFocus(this$1$1); - } - }, 20); - } else { - onBlur(this); - } - for (var opt in optionHandlers) { - if (optionHandlers.hasOwnProperty(opt)) { - optionHandlers[opt](this, options[opt], Init); - } - } - maybeUpdateLineNumberWidth(this); - if (options.finishInit) { - options.finishInit(this); - } - for (var i2 = 0; i2 < initHooks.length; ++i2) { - initHooks[i2](this); - } - endOperation(this); - if (webkit && options.lineWrapping && getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") { - display.lineDiv.style.textRendering = "auto"; - } - } - __name(CodeMirror2, "CodeMirror"); - CodeMirror2.defaults = defaults; - CodeMirror2.optionHandlers = optionHandlers; - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - if (ie && ie_version < 11) { - on(d.scroller, "dblclick", operation(cm, function (e) { - if (signalDOMEvent(cm, e)) { - return; - } - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { - return; - } - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - } else { - on(d.scroller, "dblclick", function (e) { - return signalDOMEvent(cm, e) || e_preventDefault(e); - }); - } - on(d.scroller, "contextmenu", function (e) { - return onContextMenu(cm, e); - }); - on(d.input.getField(), "contextmenu", function (e) { - if (!d.scroller.contains(e.target)) { - onContextMenu(cm, e); - } - }); - var touchFinished, - prevTouch = { - end: 0 - }; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function () { - return d.activeTouch = null; - }, 1e3); - prevTouch = d.activeTouch; - prevTouch.end = +new Date(); - } - } - __name(finishTouch, "finishTouch"); - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) { - return false; - } - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1; - } - __name(isMouseLikeTouchEvent, "isMouseLikeTouchEvent"); - function farAway(touch, other) { - if (other.left == null) { - return true; - } - var dx = other.left - touch.left, - dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20; - } - __name(farAway, "farAway"); - on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { - d.input.ensurePolled(); - clearTimeout(touchFinished); - var now = +new Date(); - d.activeTouch = { - start: now, - moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null - }; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function () { - if (d.activeTouch) { - d.activeTouch.moved = true; - } - }); - on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && !touch.moved && new Date() - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), - range2; - if (!touch.prev || farAway(touch, touch.prev)) { - range2 = new Range(pos, pos); - } else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) { - range2 = cm.findWordAt(pos); - } else { - range2 = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); - } - cm.setSelection(range2.anchor, range2.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - on(d.scroller, "scroll", function () { - if (d.scroller.clientHeight) { - updateScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - on(d.scroller, "mousewheel", function (e) { - return onScrollWheel(cm, e); - }); - on(d.scroller, "DOMMouseScroll", function (e) { - return onScrollWheel(cm, e); - }); - on(d.wrapper, "scroll", function () { - return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; - }); - d.dragFunctions = { - enter: function (e) { - if (!signalDOMEvent(cm, e)) { - e_stop(e); - } - }, - over: function (e) { - if (!signalDOMEvent(cm, e)) { - onDragOver(cm, e); - e_stop(e); - } - }, - start: function (e) { - return onDragStart(cm, e); - }, - drop: operation(cm, onDrop), - leave: function (e) { - if (!signalDOMEvent(cm, e)) { - clearDragCursor(cm); - } - } - }; - var inp = d.input.getField(); - on(inp, "keyup", function (e) { - return onKeyUp.call(cm, e); - }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", function (e) { - return onFocus(cm, e); - }); - on(inp, "blur", function (e) { - return onBlur(cm, e); - }); - } - __name(registerEventHandlers, "registerEventHandlers"); - var initHooks = []; - CodeMirror2.defineInitHook = function (f) { - return initHooks.push(f); - }; - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, - state; - if (how == null) { - how = "add"; - } - if (how == "smart") { - if (!doc.mode.indent) { - how = "prev"; - } else { - state = getContextBefore(cm, n).state; - } - } - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), - curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) { - line.stateAfter = null; - } - var curSpaceString = line.text.match(/^\s*/)[0], - indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) { - return; - } - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) { - indentation = countColumn(getLine(doc, n - 1).text, null, tabSize); - } else { - indentation = 0; - } - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - var indentString = "", - pos = 0; - if (cm.options.indentWithTabs) { - for (var i2 = Math.floor(indentation / tabSize); i2; --i2) { - pos += tabSize; - indentString += " "; - } - } - if (pos < indentation) { - indentString += spaceStr(indentation - pos); - } - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true; - } else { - for (var i$12 = 0; i$12 < doc.sel.ranges.length; i$12++) { - var range2 = doc.sel.ranges[i$12]; - if (range2.head.line == n && range2.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i$12, new Range(pos$1, pos$1)); - break; - } - } - } - } - __name(indentLine, "indentLine"); - var lastCopied = null; - function setLastCopied(newLastCopied) { - lastCopied = newLastCopied; - } - __name(setLastCopied, "setLastCopied"); - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) { - sel = doc.sel; - } - var recent = +new Date() - 200; - var paste = origin == "paste" || cm.state.pasteIncoming > recent; - var textLines = splitLinesAuto(inserted), - multiPaste = null; - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = []; - for (var i2 = 0; i2 < lastCopied.text.length; i2++) { - multiPaste.push(doc.splitLines(lastCopied.text[i2])); - } - } - } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { - multiPaste = map(textLines, function (l) { - return [l]; - }); - } - } - var updateInput = cm.curOp.updateInput; - for (var i$12 = sel.ranges.length - 1; i$12 >= 0; i$12--) { - var range2 = sel.ranges[i$12]; - var from = range2.from(), - to = range2.to(); - if (range2.empty()) { - if (deleted && deleted > 0) { - from = Pos(from.line, from.ch - deleted); - } else if (cm.state.overwrite && !paste) { - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - } else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) { - from = to = Pos(from.line, 0); - } - } - var changeEvent = { - from, - to, - text: multiPaste ? multiPaste[i$12 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input") - }; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) { - triggerElectric(cm, inserted); - } - ensureCursorVisible(cm); - if (cm.curOp.updateInput < 2) { - cm.curOp.updateInput = updateInput; - } - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = -1; - } - __name(applyTextInput, "applyTextInput"); - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text"); - if (pasted) { - e.preventDefault(); - if (!cm.isReadOnly() && !cm.options.disableInput) { - runInOp(cm, function () { - return applyTextInput(cm, pasted, 0, null, "paste"); - }); - } - return true; - } - } - __name(handlePaste, "handlePaste"); - function triggerElectric(cm, inserted) { - if (!cm.options.electricChars || !cm.options.smartIndent) { - return; - } - var sel = cm.doc.sel; - for (var i2 = sel.ranges.length - 1; i2 >= 0; i2--) { - var range2 = sel.ranges[i2]; - if (range2.head.ch > 100 || i2 && sel.ranges[i2 - 1].head.line == range2.head.line) { - continue; - } - var mode = cm.getModeAt(range2.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) { - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range2.head.line, "smart"); - break; - } - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range2.head.line).text.slice(0, range2.head.ch))) { - indented = indentLine(cm, range2.head.line, "smart"); - } - } - if (indented) { - signalLater(cm, "electricInput", cm, range2.head.line); - } - } - } - __name(triggerElectric, "triggerElectric"); - function copyableRanges(cm) { - var text = [], - ranges = []; - for (var i2 = 0; i2 < cm.doc.sel.ranges.length; i2++) { - var line = cm.doc.sel.ranges[i2].head.line; - var lineRange = { - anchor: Pos(line, 0), - head: Pos(line + 1, 0) - }; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return { - text, - ranges - }; - } - __name(copyableRanges, "copyableRanges"); - function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { - field.setAttribute("autocorrect", autocorrect ? "" : "off"); - field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); - field.setAttribute("spellcheck", !!spellcheck); - } - __name(disableBrowserMagic, "disableBrowserMagic"); - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - if (webkit) { - te.style.width = "1000px"; - } else { - te.setAttribute("wrap", "off"); - } - if (ios) { - te.style.border = "1px solid black"; - } - disableBrowserMagic(te); - return div; - } - __name(hiddenTextarea, "hiddenTextarea"); - function addEditorMethods(CodeMirror3) { - var optionHandlers2 = CodeMirror3.optionHandlers; - var helpers = CodeMirror3.helpers = {}; - CodeMirror3.prototype = { - constructor: CodeMirror3, - focus: function () { - window.focus(); - this.display.input.focus(); - }, - setOption: function (option, value) { - var options = this.options, - old = options[option]; - if (options[option] == value && option != "mode") { - return; - } - options[option] = value; - if (optionHandlers2.hasOwnProperty(option)) { - operation(this, optionHandlers2[option])(this, value, old); - } - signal(this, "optionChange", this, option); - }, - getOption: function (option) { - return this.options[option]; - }, - getDoc: function () { - return this.doc; - }, - addKeyMap: function (map2, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map2)); - }, - removeKeyMap: function (map2) { - var maps = this.state.keyMaps; - for (var i2 = 0; i2 < maps.length; ++i2) { - if (maps[i2] == map2 || maps[i2].name == map2) { - maps.splice(i2, 1); - return true; - } - } - }, - addOverlay: methodOp(function (spec, options) { - var mode = spec.token ? spec : CodeMirror3.getMode(this.options, spec); - if (mode.startState) { - throw new Error("Overlays may not be stateful."); - } - insertSorted(this.state.overlays, { - mode, - modeSpec: spec, - opaque: options && options.opaque, - priority: options && options.priority || 0 - }, function (overlay) { - return overlay.priority; - }); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function (spec) { - var overlays = this.state.overlays; - for (var i2 = 0; i2 < overlays.length; ++i2) { - var cur = overlays[i2].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i2, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - indentLine: methodOp(function (n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { - dir = this.options.smartIndent ? "smart" : "prev"; - } else { - dir = dir ? "add" : "subtract"; - } - } - if (isLine(this.doc, n)) { - indentLine(this, n, dir, aggressive); - } - }), - indentSelection: methodOp(function (how) { - var ranges = this.doc.sel.ranges, - end = -1; - for (var i2 = 0; i2 < ranges.length; i2++) { - var range2 = ranges[i2]; - if (!range2.empty()) { - var from = range2.from(), - to = range2.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) { - indentLine(this, j, how); - } - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i2].from().ch > 0) { - replaceOneSelection(this.doc, i2, new Range(from, newRanges[i2].to()), sel_dontScroll); - } - } else if (range2.head.line > end) { - indentLine(this, range2.head.line, how, true); - end = range2.head.line; - if (i2 == this.doc.sel.primIndex) { - ensureCursorVisible(this); - } - } - } - }), - getTokenAt: function (pos, precise) { - return takeToken(this, pos, precise); - }, - getLineTokens: function (line, precise) { - return takeToken(this, Pos(line), precise, true); - }, - getTokenTypeAt: function (pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, - after = (styles.length - 1) / 2, - ch = pos.ch; - var type; - if (ch == 0) { - type = styles[2]; - } else { - for (;;) { - var mid = before + after >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { - after = mid; - } else if (styles[mid * 2 + 1] < ch) { - before = mid + 1; - } else { - type = styles[mid * 2 + 2]; - break; - } - } - } - var cut = type ? type.indexOf("overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - getModeAt: function (pos) { - var mode = this.doc.mode; - if (!mode.innerMode) { - return mode; - } - return CodeMirror3.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - getHelper: function (pos, type) { - return this.getHelpers(pos, type)[0]; - }, - getHelpers: function (pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) { - return found; - } - var help = helpers[type], - mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) { - found.push(help[mode[type]]); - } - } else if (mode[type]) { - for (var i2 = 0; i2 < mode[type].length; i2++) { - var val = help[mode[type][i2]]; - if (val) { - found.push(val); - } - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i$12 = 0; i$12 < help._global.length; i$12++) { - var cur = help._global[i$12]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) { - found.push(cur.val); - } - } - return found; - }, - getStateAfter: function (line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line); - return getContextBefore(this, line + 1, precise).state; - }, - cursorCoords: function (start, mode) { - var pos, - range2 = this.doc.sel.primary(); - if (start == null) { - pos = range2.head; - } else if (typeof start == "object") { - pos = clipPos(this.doc, start); - } else { - pos = start ? range2.from() : range2.to(); - } - return cursorCoords(this, pos, mode || "page"); - }, - charCoords: function (pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - coordsChar: function (coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - lineAtHeight: function (height, mode) { - height = fromCoordSystem(this, { - top: height, - left: 0 - }, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function (line, mode, includeWidgets) { - var end = false, - lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) { - line = this.doc.first; - } else if (line > last) { - line = last; - end = true; - } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, { - top: 0, - left: 0 - }, mode || "page", includeWidgets || end).top + (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - defaultTextHeight: function () { - return textHeight(this.display); - }, - defaultCharWidth: function () { - return charWidth(this.display); - }, - getViewport: function () { - return { - from: this.display.viewFrom, - to: this.display.viewTo - }; - }, - addWidget: function (pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, - left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - if ((vert == "above" || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) { - top = pos.top - node.offsetHeight; - } else if (pos.bottom + node.offsetHeight <= vspace) { - top = pos.bottom; - } - if (left + node.offsetWidth > hspace) { - left = hspace - node.offsetWidth; - } - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") { - left = 0; - } else if (horiz == "middle") { - left = (display.sizer.clientWidth - node.offsetWidth) / 2; - } - node.style.left = left + "px"; - } - if (scroll) { - scrollIntoView(this, { - left, - top, - right: left + node.offsetWidth, - bottom: top + node.offsetHeight - }); - } - }, - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - triggerOnMouseDown: methodOp(onMouseDown), - execCommand: function (cmd) { - if (commands.hasOwnProperty(cmd)) { - return commands[cmd].call(null, this); - } - }, - triggerElectric: methodOp(function (text) { - triggerElectric(this, text); - }), - findPosH: function (from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { - dir = -1; - amount = -amount; - } - var cur = clipPos(this.doc, from); - for (var i2 = 0; i2 < amount; ++i2) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) { - break; - } - } - return cur; - }, - moveH: methodOp(function (dir, unit) { - var this$1$1 = this; - this.extendSelectionsBy(function (range2) { - if (this$1$1.display.shift || this$1$1.doc.extend || range2.empty()) { - return findPosH(this$1$1.doc, range2.head, dir, unit, this$1$1.options.rtlMoveVisually); - } else { - return dir < 0 ? range2.from() : range2.to(); - } - }, sel_move); - }), - deleteH: methodOp(function (dir, unit) { - var sel = this.doc.sel, - doc = this.doc; - if (sel.somethingSelected()) { - doc.replaceSelection("", null, "+delete"); - } else { - deleteNearSelection(this, function (range2) { - var other = findPosH(doc, range2.head, dir, unit, false); - return dir < 0 ? { - from: other, - to: range2.head - } : { - from: range2.head, - to: other - }; - }); - } - }), - findPosV: function (from, amount, unit, goalColumn) { - var dir = 1, - x = goalColumn; - if (amount < 0) { - dir = -1; - amount = -amount; - } - var cur = clipPos(this.doc, from); - for (var i2 = 0; i2 < amount; ++i2) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) { - x = coords.left; - } else { - coords.left = x; - } - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) { - break; - } - } - return cur; - }, - moveV: methodOp(function (dir, unit) { - var this$1$1 = this; - var doc = this.doc, - goals = []; - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function (range2) { - if (collapse) { - return dir < 0 ? range2.from() : range2.to(); - } - var headPos = cursorCoords(this$1$1, range2.head, "div"); - if (range2.goalColumn != null) { - headPos.left = range2.goalColumn; - } - goals.push(headPos.left); - var pos = findPosV(this$1$1, headPos, dir, unit); - if (unit == "page" && range2 == doc.sel.primary()) { - addToScrollTop(this$1$1, charCoords(this$1$1, pos, "div").top - headPos.top); - } - return pos; - }, sel_move); - if (goals.length) { - for (var i2 = 0; i2 < doc.sel.ranges.length; i2++) { - doc.sel.ranges[i2].goalColumn = goals[i2]; - } - } - }), - findWordAt: function (pos) { - var doc = this.doc, - line = getLine(doc, pos.line).text; - var start = pos.ch, - end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.sticky == "before" || end == line.length) && start) { - --start; - } else { - ++end; - } - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) ? function (ch) { - return isWordChar(ch, helper); - } : /\s/.test(startChar) ? function (ch) { - return /\s/.test(ch); - } : function (ch) { - return !/\s/.test(ch) && !isWordChar(ch); - }; - while (start > 0 && check(line.charAt(start - 1))) { - --start; - } - while (end < line.length && check(line.charAt(end))) { - ++end; - } - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - toggleOverwrite: function (value) { - if (value != null && value == this.state.overwrite) { - return; - } - if (this.state.overwrite = !this.state.overwrite) { - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - } else { - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - } - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function () { - return this.display.input.getField() == activeElt(); - }, - isReadOnly: function () { - return !!(this.options.readOnly || this.doc.cantEdit); - }, - scrollTo: methodOp(function (x, y) { - scrollToCoords(this, x, y); - }), - getScrollInfo: function () { - var scroller = this.display.scroller; - return { - left: scroller.scrollLeft, - top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), - clientWidth: displayWidth(this) - }; - }, - scrollIntoView: methodOp(function (range2, margin) { - if (range2 == null) { - range2 = { - from: this.doc.sel.primary().head, - to: null - }; - if (margin == null) { - margin = this.options.cursorScrollMargin; - } - } else if (typeof range2 == "number") { - range2 = { - from: Pos(range2, 0), - to: null - }; - } else if (range2.from == null) { - range2 = { - from: range2, - to: null - }; - } - if (!range2.to) { - range2.to = range2.from; - } - range2.margin = margin || 0; - if (range2.from.line != null) { - scrollToRange(this, range2); - } else { - scrollToCoordsRange(this, range2.from, range2.to, range2.margin); - } - }), - setSize: methodOp(function (width, height) { - var this$1$1 = this; - var interpret = /* @__PURE__ */__name(function (val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - }, "interpret"); - if (width != null) { - this.display.wrapper.style.width = interpret(width); - } - if (height != null) { - this.display.wrapper.style.height = interpret(height); - } - if (this.options.lineWrapping) { - clearLineMeasurementCache(this); - } - var lineNo2 = this.display.viewFrom; - this.doc.iter(lineNo2, this.display.viewTo, function (line) { - if (line.widgets) { - for (var i2 = 0; i2 < line.widgets.length; i2++) { - if (line.widgets[i2].noHScroll) { - regLineChange(this$1$1, lineNo2, "widget"); - break; - } - } - } - ++lineNo2; - }); - this.curOp.forceUpdate = true; - signal(this, "refresh", this); - }), - operation: function (f) { - return runInOp(this, f); - }, - startOperation: function () { - return startOperation(this); - }, - endOperation: function () { - return endOperation(this); - }, - refresh: methodOp(function () { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this.display); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > 0.5 || this.options.lineWrapping) { - estimateLineHeights(this); - } - signal(this, "refresh", this); - }), - swapDoc: methodOp(function (doc) { - var old = this.doc; - old.cm = null; - if (this.state.selectingText) { - this.state.selectingText(); - } - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - scrollToCoords(this, doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - phrase: function (phraseText) { - var phrases = this.options.phrases; - return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText; - }, - getInputField: function () { - return this.display.input.getField(); - }, - getWrapperElement: function () { - return this.display.wrapper; - }, - getScrollerElement: function () { - return this.display.scroller; - }, - getGutterElement: function () { - return this.display.gutters; - } - }; - eventMixin(CodeMirror3); - CodeMirror3.registerHelper = function (type, name, value) { - if (!helpers.hasOwnProperty(type)) { - helpers[type] = CodeMirror3[type] = { - _global: [] - }; - } - helpers[type][name] = value; - }; - CodeMirror3.registerGlobalHelper = function (type, name, predicate, value) { - CodeMirror3.registerHelper(type, name, value); - helpers[type]._global.push({ - pred: predicate, - val: value - }); - }; - } - __name(addEditorMethods, "addEditorMethods"); - function findPosH(doc, pos, dir, unit, visually) { - var oldPos = pos; - var origDir = dir; - var lineObj = getLine(doc, pos.line); - var lineDir = visually && doc.direction == "rtl" ? -dir : dir; - function findNextLine() { - var l = pos.line + lineDir; - if (l < doc.first || l >= doc.first + doc.size) { - return false; - } - pos = new Pos(l, pos.ch, pos.sticky); - return lineObj = getLine(doc, l); - } - __name(findNextLine, "findNextLine"); - function moveOnce(boundToLine) { - var next; - if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); - if (isNaN(ch)) { - next = null; - } else { - var astral = dir > 0 ? ch >= 55296 && ch < 56320 : ch >= 56320 && ch < 57343; - next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir); - } - } else if (visually) { - next = moveVisually(doc.cm, lineObj, pos, dir); - } else { - next = moveLogically(lineObj, pos, dir); - } - if (next == null) { - if (!boundToLine && findNextLine()) { - pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); - } else { - return false; - } - } else { - pos = next; - } - return true; - } - __name(moveOnce, "moveOnce"); - if (unit == "char" || unit == "codepoint") { - moveOnce(); - } else if (unit == "column") { - moveOnce(true); - } else if (unit == "word" || unit == "group") { - var sawType = null, - group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) { - break; - } - var cur = lineObj.text.charAt(pos.ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" : group && cur == "\n" ? "n" : !group || /\s/.test(cur) ? null : "p"; - if (group && !first && !type) { - type = "s"; - } - if (sawType && sawType != type) { - if (dir < 0) { - dir = 1; - moveOnce(); - pos.sticky = "after"; - } - break; - } - if (type) { - sawType = type; - } - if (dir > 0 && !moveOnce(!first)) { - break; - } - } - } - var result = skipAtomic(doc, pos, oldPos, origDir, true); - if (equalCursorPos(oldPos, result)) { - result.hitSide = true; - } - return result; - } - __name(findPosH, "findPosH"); - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, - x = pos.left, - y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - var moveAmount = Math.max(pageSize - 0.5 * textHeight(cm.display), 3); - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - var target; - for (;;) { - target = coordsChar(cm, x, y); - if (!target.outside) { - break; - } - if (dir < 0 ? y <= 0 : y >= doc.height) { - target.hitSide = true; - break; - } - y += dir * 5; - } - return target; - } - __name(findPosV, "findPosV"); - var ContentEditableInput = /* @__PURE__ */__name(function (cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.composing = null; - this.gracePeriod = false; - this.readDOMTimeout = null; - }, "ContentEditableInput"); - ContentEditableInput.prototype.init = function (display) { - var this$1$1 = this; - var input = this, - cm = input.cm; - var div = input.div = display.lineDiv; - div.contentEditable = true; - disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); - function belongsToInput(e) { - for (var t = e.target; t; t = t.parentNode) { - if (t == div) { - return true; - } - if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { - break; - } - } - return false; - } - __name(belongsToInput, "belongsToInput"); - on(div, "paste", function (e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { - return; - } - if (ie_version <= 11) { - setTimeout(operation(cm, function () { - return this$1$1.updateFromDOM(); - }), 20); - } - }); - on(div, "compositionstart", function (e) { - this$1$1.composing = { - data: e.data, - done: false - }; - }); - on(div, "compositionupdate", function (e) { - if (!this$1$1.composing) { - this$1$1.composing = { - data: e.data, - done: false - }; - } - }); - on(div, "compositionend", function (e) { - if (this$1$1.composing) { - if (e.data != this$1$1.composing.data) { - this$1$1.readFromDOMSoon(); - } - this$1$1.composing.done = true; - } - }); - on(div, "touchstart", function () { - return input.forceCompositionEnd(); - }); - on(div, "input", function () { - if (!this$1$1.composing) { - this$1$1.readFromDOMSoon(); - } - }); - function onCopyCut(e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e)) { - return; - } - if (cm.somethingSelected()) { - setLastCopied({ - lineWise: false, - text: cm.getSelections() - }); - if (e.type == "cut") { - cm.replaceSelection("", null, "cut"); - } - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - setLastCopied({ - lineWise: true, - text: ranges.text - }); - if (e.type == "cut") { - cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - if (e.clipboardData) { - e.clipboardData.clearData(); - var content = lastCopied.text.join("\n"); - e.clipboardData.setData("Text", content); - if (e.clipboardData.getData("Text") == content) { - e.preventDefault(); - return; - } - } - var kludge = hiddenTextarea(), - te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(); - selectInput(te); - setTimeout(function () { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - if (hadFocus == div) { - input.showPrimarySelection(); - } - }, 50); - } - __name(onCopyCut, "onCopyCut"); - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }; - ContentEditableInput.prototype.screenReaderLabelChanged = function (label) { - if (label) { - this.div.setAttribute("aria-label", label); - } else { - this.div.removeAttribute("aria-label"); - } - }; - ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false); - result.focus = activeElt() == this.div; - return result; - }; - ContentEditableInput.prototype.showSelection = function (info, takeFocus) { - if (!info || !this.cm.display.view.length) { - return; - } - if (info.focus || takeFocus) { - this.showPrimarySelection(); - } - this.showMultipleSelections(info); - }; - ContentEditableInput.prototype.getSelection = function () { - return this.cm.display.wrapper.ownerDocument.getSelection(); - }; - ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = this.getSelection(), - cm = this.cm, - prim = cm.doc.sel.primary(); - var from = prim.from(), - to = prim.to(); - if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { - sel.removeAllRanges(); - return; - } - var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && cmp(minPos(curAnchor, curFocus), from) == 0 && cmp(maxPos(curAnchor, curFocus), to) == 0) { - return; - } - var view = cm.display.view; - var start = from.line >= cm.display.viewFrom && posToDOM(cm, from) || { - node: view[0].measure.map[2], - offset: 0 - }; - var end = to.line < cm.display.viewTo && posToDOM(cm, to); - if (!end) { - var measure = view[view.length - 1].measure; - var map2 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = { - node: map2[map2.length - 1], - offset: map2[map2.length - 2] - map2[map2.length - 3] - }; - } - if (!start || !end) { - sel.removeAllRanges(); - return; - } - var old = sel.rangeCount && sel.getRangeAt(0), - rng; - try { - rng = range(start.node, start.offset, end.offset, end.node); - } catch (e) {} - if (rng) { - if (!gecko && cm.state.focused) { - sel.collapse(start.node, start.offset); - if (!rng.collapsed) { - sel.removeAllRanges(); - sel.addRange(rng); - } - } else { - sel.removeAllRanges(); - sel.addRange(rng); - } - if (old && sel.anchorNode == null) { - sel.addRange(old); - } else if (gecko) { - this.startGracePeriod(); - } - } - this.rememberSelection(); - }; - ContentEditableInput.prototype.startGracePeriod = function () { - var this$1$1 = this; - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function () { - this$1$1.gracePeriod = false; - if (this$1$1.selectionChanged()) { - this$1$1.cm.operation(function () { - return this$1$1.cm.curOp.selectionChanged = true; - }); - } - }, 20); - }; - ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }; - ContentEditableInput.prototype.rememberSelection = function () { - var sel = this.getSelection(); - this.lastAnchorNode = sel.anchorNode; - this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; - this.lastFocusOffset = sel.focusOffset; - }; - ContentEditableInput.prototype.selectionInEditor = function () { - var sel = this.getSelection(); - if (!sel.rangeCount) { - return false; - } - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node); - }; - ContentEditableInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt() != this.div) { - this.showSelection(this.prepareSelection(), true); - } - this.div.focus(); - } - }; - ContentEditableInput.prototype.blur = function () { - this.div.blur(); - }; - ContentEditableInput.prototype.getField = function () { - return this.div; - }; - ContentEditableInput.prototype.supportsTouch = function () { - return true; - }; - ContentEditableInput.prototype.receivedFocus = function () { - var this$1$1 = this; - var input = this; - if (this.selectionInEditor()) { - setTimeout(function () { - return this$1$1.pollSelection(); - }, 20); - } else { - runInOp(this.cm, function () { - return input.cm.curOp.selectionChanged = true; - }); - } - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - __name(poll, "poll"); - this.polling.set(this.cm.options.pollInterval, poll); - }; - ContentEditableInput.prototype.selectionChanged = function () { - var sel = this.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; - }; - ContentEditableInput.prototype.pollSelection = function () { - if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { - return; - } - var sel = this.getSelection(), - cm = this.cm; - if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { - this.cm.triggerOnKeyDown({ - type: "keydown", - keyCode: 8, - preventDefault: Math.abs - }); - this.blur(); - this.focus(); - return; - } - if (this.composing) { - return; - } - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) { - runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) { - cm.curOp.selectionChanged = true; - } - }); - } - }; - ContentEditableInput.prototype.pollContent = function () { - if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout); - this.readDOMTimeout = null; - } - var cm = this.cm, - display = cm.display, - sel = cm.doc.sel.primary(); - var from = sel.from(), - to = sel.to(); - if (from.ch == 0 && from.line > cm.firstLine()) { - from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); - } - if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) { - to = Pos(to.line + 1, 0); - } - if (from.line < display.viewFrom || to.line > display.viewTo - 1) { - return false; - } - var fromIndex, fromLine, fromNode; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line); - fromNode = display.view[0].node; - } else { - fromLine = lineNo(display.view[fromIndex].line); - fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - var toLine, toNode; - if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1; - toNode = display.lineDiv.lastChild; - } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1; - toNode = display.view[toIndex + 1].node.previousSibling; - } - if (!fromNode) { - return false; - } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { - newText.pop(); - oldText.pop(); - toLine--; - } else if (newText[0] == oldText[0]) { - newText.shift(); - oldText.shift(); - fromLine++; - } else { - break; - } - } - var cutFront = 0, - cutEnd = 0; - var newTop = newText[0], - oldTop = oldText[0], - maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) { - ++cutFront; - } - var newBot = lst(newText), - oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - ++cutEnd; - } - if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { - while (cutFront && cutFront > from.ch && newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - cutFront--; - cutEnd++; - } - } - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true; - } - }; - ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.forceCompositionEnd = function () { - if (!this.composing) { - return; - } - clearTimeout(this.readDOMTimeout); - this.composing = null; - this.updateFromDOM(); - this.div.blur(); - this.div.focus(); - }; - ContentEditableInput.prototype.readFromDOMSoon = function () { - var this$1$1 = this; - if (this.readDOMTimeout != null) { - return; - } - this.readDOMTimeout = setTimeout(function () { - this$1$1.readDOMTimeout = null; - if (this$1$1.composing) { - if (this$1$1.composing.done) { - this$1$1.composing = null; - } else { - return; - } - } - this$1$1.updateFromDOM(); - }, 80); - }; - ContentEditableInput.prototype.updateFromDOM = function () { - var this$1$1 = this; - if (this.cm.isReadOnly() || !this.pollContent()) { - runInOp(this.cm, function () { - return regChange(this$1$1.cm); - }); - } - }; - ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false"; - }; - ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0 || this.composing) { - return; - } - e.preventDefault(); - if (!this.cm.isReadOnly()) { - operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); - } - }; - ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor"); - }; - ContentEditableInput.prototype.onContextMenu = function () {}; - ContentEditableInput.prototype.resetPosition = function () {}; - ContentEditableInput.prototype.needsContentAttribute = true; - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) { - return null; - } - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - var order = getOrder(line, cm.doc.direction), - side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result; - } - __name(posToDOM, "posToDOM"); - function isInGutter(node) { - for (var scan = node; scan; scan = scan.parentNode) { - if (/CodeMirror-gutter-wrapper/.test(scan.className)) { - return true; - } - } - return false; - } - __name(isInGutter, "isInGutter"); - function badPos(pos, bad) { - if (bad) { - pos.bad = true; - } - return pos; - } - __name(badPos, "badPos"); - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", - closing = false, - lineSep = cm.doc.lineSeparator(), - extraLinebreak = false; - function recognizeMarker(id) { - return function (marker) { - return marker.id == id; - }; - } - __name(recognizeMarker, "recognizeMarker"); - function close() { - if (closing) { - text += lineSep; - if (extraLinebreak) { - text += lineSep; - } - closing = extraLinebreak = false; - } - } - __name(close, "close"); - function addText(str) { - if (str) { - close(); - text += str; - } - } - __name(addText, "addText"); - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText) { - addText(cmText); - return; - } - var markerID = node.getAttribute("cm-marker"), - range2; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range2 = found[0].find(0))) { - addText(getBetween(cm.doc, range2.from, range2.to).join(lineSep)); - } - return; - } - if (node.getAttribute("contenteditable") == "false") { - return; - } - var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); - if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { - return; - } - if (isBlock) { - close(); - } - for (var i2 = 0; i2 < node.childNodes.length; i2++) { - walk(node.childNodes[i2]); - } - if (/^(pre|p)$/i.test(node.nodeName)) { - extraLinebreak = true; - } - if (isBlock) { - closing = true; - } - } else if (node.nodeType == 3) { - addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); - } - } - __name(walk, "walk"); - for (;;) { - walk(from); - if (from == to) { - break; - } - from = from.nextSibling; - extraLinebreak = false; - } - return text; - } - __name(domTextBetween, "domTextBetween"); - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) { - return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); - } - node = null; - offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) { - return null; - } - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { - break; - } - } - } - for (var i2 = 0; i2 < cm.display.view.length; i2++) { - var lineView = cm.display.view[i2]; - if (lineView.node == lineNode) { - return locateNodeInLineView(lineView, node, offset); - } - } - } - __name(domToPos, "domToPos"); - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, - bad = false; - if (!node || !contains(wrapper, node)) { - return badPos(Pos(lineNo(lineView.line), 0), true); - } - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad); - } - } - var textNode = node.nodeType == 3 ? node : null, - topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) { - offset = textNode.nodeValue.length; - } - } - while (topNode.parentNode != wrapper) { - topNode = topNode.parentNode; - } - var measure = lineView.measure, - maps = measure.maps; - function find(textNode2, topNode2, offset2) { - for (var i2 = -1; i2 < (maps ? maps.length : 0); i2++) { - var map2 = i2 < 0 ? measure.map : maps[i2]; - for (var j = 0; j < map2.length; j += 3) { - var curNode = map2[j + 2]; - if (curNode == textNode2 || curNode == topNode2) { - var line2 = lineNo(i2 < 0 ? lineView.line : lineView.rest[i2]); - var ch = map2[j] + offset2; - if (offset2 < 0 || curNode != textNode2) { - ch = map2[j + (offset2 ? 1 : 0)]; - } - return Pos(line2, ch); - } - } - } - } - __name(find, "find"); - var found = find(textNode, topNode, offset); - if (found) { - return badPos(found, bad); - } - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) { - return badPos(Pos(found.line, found.ch - dist), bad); - } else { - dist += after.textContent.length; - } - } - for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) { - return badPos(Pos(found.line, found.ch + dist$1), bad); - } else { - dist$1 += before.textContent.length; - } - } - } - __name(locateNodeInLineView, "locateNodeInLineView"); - var TextareaInput = /* @__PURE__ */__name(function (cm) { - this.cm = cm; - this.prevInput = ""; - this.pollingFast = false; - this.polling = new Delayed(); - this.hasSelection = false; - this.composing = null; - }, "TextareaInput"); - TextareaInput.prototype.init = function (display) { - var this$1$1 = this; - var input = this, - cm = this.cm; - this.createField(display); - var te = this.textarea; - display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); - if (ios) { - te.style.width = "0px"; - } - on(te, "input", function () { - if (ie && ie_version >= 9 && this$1$1.hasSelection) { - this$1$1.hasSelection = null; - } - input.poll(); - }); - on(te, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { - return; - } - cm.state.pasteIncoming = +new Date(); - input.fastPoll(); - }); - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) { - return; - } - if (cm.somethingSelected()) { - setLastCopied({ - lineWise: false, - text: cm.getSelections() - }); - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - setLastCopied({ - lineWise: true, - text: ranges.text - }); - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") { - cm.state.cutIncoming = +new Date(); - } - } - __name(prepareCopyCut, "prepareCopyCut"); - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - on(display.scroller, "paste", function (e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { - return; - } - if (!te.dispatchEvent) { - cm.state.pasteIncoming = +new Date(); - input.focus(); - return; - } - var event = new Event("paste"); - event.clipboardData = e.clipboardData; - te.dispatchEvent(event); - }); - on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { - e_preventDefault(e); - } - }); - on(te, "compositionstart", function () { - var start = cm.getCursor("from"); - if (input.composing) { - input.composing.range.clear(); - } - input.composing = { - start, - range: cm.markText(start, cm.getCursor("to"), { - className: "CodeMirror-composing" - }) - }; - }); - on(te, "compositionend", function () { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }; - TextareaInput.prototype.createField = function (_display) { - this.wrapper = hiddenTextarea(); - this.textarea = this.wrapper.firstChild; - }; - TextareaInput.prototype.screenReaderLabelChanged = function (label) { - if (label) { - this.textarea.setAttribute("aria-label", label); - } else { - this.textarea.removeAttribute("aria-label"); - } - }; - TextareaInput.prototype.prepareSelection = function () { - var cm = this.cm, - display = cm.display, - doc = cm.doc; - var result = prepareSelection(cm); - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), - lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, headPos.left + lineOff.left - wrapOff.left)); - } - return result; - }; - TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, - display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }; - TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending || this.composing) { - return; - } - var cm = this.cm; - if (cm.somethingSelected()) { - this.prevInput = ""; - var content = cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) { - selectInput(this.textarea); - } - if (ie && ie_version >= 9) { - this.hasSelection = content; - } - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) { - this.hasSelection = null; - } - } - }; - TextareaInput.prototype.getField = function () { - return this.textarea; - }; - TextareaInput.prototype.supportsTouch = function () { - return false; - }; - TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { - this.textarea.focus(); - } catch (e) {} - } - }; - TextareaInput.prototype.blur = function () { - this.textarea.blur(); - }; - TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0; - }; - TextareaInput.prototype.receivedFocus = function () { - this.slowPoll(); - }; - TextareaInput.prototype.slowPoll = function () { - var this$1$1 = this; - if (this.pollingFast) { - return; - } - this.polling.set(this.cm.options.pollInterval, function () { - this$1$1.poll(); - if (this$1$1.cm.state.focused) { - this$1$1.slowPoll(); - } - }); - }; - TextareaInput.prototype.fastPoll = function () { - var missed = false, - input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) { - missed = true; - input.polling.set(60, p); - } else { - input.pollingFast = false; - input.slowPoll(); - } - } - __name(p, "p"); - input.polling.set(20, p); - }; - TextareaInput.prototype.poll = function () { - var this$1$1 = this; - var cm = this.cm, - input = this.textarea, - prevInput = this.prevInput; - if (this.contextMenuPending || !cm.state.focused || hasSelection(input) && !prevInput && !this.composing || cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) { - return false; - } - var text = input.value; - if (text == prevInput && !cm.somethingSelected()) { - return false; - } - if (ie && ie_version >= 9 && this.hasSelection === text || mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false; - } - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 8203 && !prevInput) { - prevInput = "\u200B"; - } - if (first == 8666) { - this.reset(); - return this.cm.execCommand("undo"); - } - } - var same = 0, - l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { - ++same; - } - runInOp(cm, function () { - applyTextInput(cm, text.slice(same), prevInput.length - same, null, this$1$1.composing ? "*compose" : null); - if (text.length > 1e3 || text.indexOf("\n") > -1) { - input.value = this$1$1.prevInput = ""; - } else { - this$1$1.prevInput = text; - } - if (this$1$1.composing) { - this$1$1.composing.range.clear(); - this$1$1.composing.range = cm.markText(this$1$1.composing.start, cm.getCursor("to"), { - className: "CodeMirror-composing" - }); - } - }); - return true; - }; - TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { - this.pollingFast = false; - } - }; - TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { - this.hasSelection = null; - } - this.fastPoll(); - }; - TextareaInput.prototype.onContextMenu = function (e) { - var input = this, - cm = input.cm, - display = cm.display, - te = input.textarea; - if (input.contextMenuPending) { - input.contextMenuPending(); - } - var pos = posFromMouse(cm, e), - scrollPos = display.scroller.scrollTop; - if (!pos || presto) { - return; - } - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) { - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - } - var oldCSS = te.style.cssText, - oldWrapperCSS = input.wrapper.style.cssText; - var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); - input.wrapper.style.cssText = "position: static"; - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - var oldScrollY; - if (webkit) { - oldScrollY = window.scrollY; - } - display.input.focus(); - if (webkit) { - window.scrollTo(null, oldScrollY); - } - display.input.reset(); - if (!cm.somethingSelected()) { - te.value = input.prevInput = " "; - } - input.contextMenuPending = rehide; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "\u200B" + (selected ? te.value : ""); - te.value = "\u21DA"; - te.value = extval; - input.prevInput = selected ? "" : "\u200B"; - te.selectionStart = 1; - te.selectionEnd = extval.length; - display.selForContextMenu = cm.doc.sel; - } - } - __name(prepareSelectAllHack, "prepareSelectAllHack"); - function rehide() { - if (input.contextMenuPending != rehide) { - return; - } - input.contextMenuPending = false; - input.wrapper.style.cssText = oldWrapperCSS; - te.style.cssText = oldCSS; - if (ie && ie_version < 9) { - display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - } - if (te.selectionStart != null) { - if (!ie || ie && ie_version < 9) { - prepareSelectAllHack(); - } - var i2 = 0, - poll = /* @__PURE__ */__name(function () { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && te.selectionEnd > 0 && input.prevInput == "\u200B") { - operation(cm, selectAll)(cm); - } else if (i2++ < 10) { - display.detectingSelectAll = setTimeout(poll, 500); - } else { - display.selForContextMenu = null; - display.input.reset(); - } - }, "poll"); - display.detectingSelectAll = setTimeout(poll, 200); - } - } - __name(rehide, "rehide"); - if (ie && ie_version >= 9) { - prepareSelectAllHack(); - } - if (captureRightClick) { - e_stop(e); - var mouseup = /* @__PURE__ */__name(function () { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }, "mouseup"); - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }; - TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { - this.reset(); - } - this.textarea.disabled = val == "nocursor"; - this.textarea.readOnly = !!val; - }; - TextareaInput.prototype.setUneditable = function () {}; - TextareaInput.prototype.needsContentAttribute = false; - function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) { - options.tabindex = textarea.tabIndex; - } - if (!options.placeholder && textarea.placeholder) { - options.placeholder = textarea.placeholder; - } - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - function save() { - textarea.value = cm.getValue(); - } - __name(save, "save"); - var realSubmit; - if (textarea.form) { - on(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form; - realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function () { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch (e) {} - } - } - options.finishInit = function (cm2) { - cm2.save = save; - cm2.getTextArea = function () { - return textarea; - }; - cm2.toTextArea = function () { - cm2.toTextArea = isNaN; - save(); - textarea.parentNode.removeChild(cm2.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function") { - textarea.form.submit = realSubmit; - } - } - }; - }; - textarea.style.display = "none"; - var cm = CodeMirror2(function (node) { - return textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - return cm; - } - __name(fromTextArea, "fromTextArea"); - function addLegacyProps(CodeMirror3) { - CodeMirror3.off = off; - CodeMirror3.on = on; - CodeMirror3.wheelEventPixels = wheelEventPixels; - CodeMirror3.Doc = Doc; - CodeMirror3.splitLines = splitLinesAuto; - CodeMirror3.countColumn = countColumn; - CodeMirror3.findColumn = findColumn; - CodeMirror3.isWordChar = isWordCharBasic; - CodeMirror3.Pass = Pass; - CodeMirror3.signal = signal; - CodeMirror3.Line = Line; - CodeMirror3.changeEnd = changeEnd; - CodeMirror3.scrollbarModel = scrollbarModel; - CodeMirror3.Pos = Pos; - CodeMirror3.cmpPos = cmp; - CodeMirror3.modes = modes; - CodeMirror3.mimeModes = mimeModes; - CodeMirror3.resolveMode = resolveMode; - CodeMirror3.getMode = getMode; - CodeMirror3.modeExtensions = modeExtensions; - CodeMirror3.extendMode = extendMode; - CodeMirror3.copyState = copyState; - CodeMirror3.startState = startState; - CodeMirror3.innerMode = innerMode; - CodeMirror3.commands = commands; - CodeMirror3.keyMap = keyMap; - CodeMirror3.keyName = keyName; - CodeMirror3.isModifierKey = isModifierKey; - CodeMirror3.lookupKey = lookupKey; - CodeMirror3.normalizeKeyMap = normalizeKeyMap; - CodeMirror3.StringStream = StringStream; - CodeMirror3.SharedTextMarker = SharedTextMarker; - CodeMirror3.TextMarker = TextMarker; - CodeMirror3.LineWidget = LineWidget; - CodeMirror3.e_preventDefault = e_preventDefault; - CodeMirror3.e_stopPropagation = e_stopPropagation; - CodeMirror3.e_stop = e_stop; - CodeMirror3.addClass = addClass; - CodeMirror3.contains = contains; - CodeMirror3.rmClass = rmClass; - CodeMirror3.keyNames = keyNames; - } - __name(addLegacyProps, "addLegacyProps"); - defineOptions(CodeMirror2); - addEditorMethods(CodeMirror2); - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) { - if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) { - CodeMirror2.prototype[prop] = function (method) { - return function () { - return method.apply(this.doc, arguments); - }; - }(Doc.prototype[prop]); - } - } - eventMixin(Doc); - CodeMirror2.inputStyles = { - "textarea": TextareaInput, - "contenteditable": ContentEditableInput - }; - CodeMirror2.defineMode = function (name) { - if (!CodeMirror2.defaults.mode && name != "null") { - CodeMirror2.defaults.mode = name; - } - defineMode.apply(this, arguments); - }; - CodeMirror2.defineMIME = defineMIME; - CodeMirror2.defineMode("null", function () { - return { - token: function (stream) { - return stream.skipToEnd(); - } - }; - }); - CodeMirror2.defineMIME("text/plain", "null"); - CodeMirror2.defineExtension = function (name, func) { - CodeMirror2.prototype[name] = func; - }; - CodeMirror2.defineDocExtension = function (name, func) { - Doc.prototype[name] = func; - }; - CodeMirror2.fromTextArea = fromTextArea; - addLegacyProps(CodeMirror2); - CodeMirror2.version = "5.65.3"; - return CodeMirror2; - }); - })(codemirror$1); - var CodeMirror = codemirror$1.exports; - _exports.C = CodeMirror; - var codemirror = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": CodeMirror - }, [codemirror$1.exports]); - _exports.c = codemirror; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/comment.es.js": -/*!***********************************************!*\ - !*** ../../graphiql-react/dist/comment.es.js ***! - \***********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.c = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var comment$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var noOptions = {}; - var nonWS = /[^\s\u00a0]/; - var Pos = CodeMirror.Pos, - cmp = CodeMirror.cmpPos; - function firstNonWS(str) { - var found = str.search(nonWS); - return found == -1 ? 0 : found; - } - __name(firstNonWS, "firstNonWS"); - CodeMirror.commands.toggleComment = function (cm) { - cm.toggleComment(); - }; - CodeMirror.defineExtension("toggleComment", function (options) { - if (!options) options = noOptions; - var cm = this; - var minLine = Infinity, - ranges = this.listSelections(), - mode = null; - for (var i = ranges.length - 1; i >= 0; i--) { - var from = ranges[i].from(), - to = ranges[i].to(); - if (from.line >= minLine) continue; - if (to.line >= minLine) to = Pos(minLine, 0); - minLine = from.line; - if (mode == null) { - if (cm.uncomment(from, to, options)) mode = "un";else { - cm.lineComment(from, to, options); - mode = "line"; - } - } else if (mode == "un") { - cm.uncomment(from, to, options); - } else { - cm.lineComment(from, to, options); - } - } - }); - function probablyInsideString(cm, pos, line) { - return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line); - } - __name(probablyInsideString, "probablyInsideString"); - function getMode(cm, pos) { - var mode = cm.getMode(); - return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos); - } - __name(getMode, "getMode"); - CodeMirror.defineExtension("lineComment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var firstLine = self.getLine(from.line); - if (firstLine == null || probablyInsideString(self, from, firstLine)) return; - var commentString = options.lineComment || mode.lineComment; - if (!commentString) { - if (options.blockCommentStart || mode.blockCommentStart) { - options.fullLines = true; - self.blockComment(from, to, options); - } - return; - } - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); - var pad = options.padding == null ? " " : options.padding; - var blankLines = options.commentBlankLines || from.line == to.line; - self.operation(function () { - if (options.indent) { - var baseString = null; - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i); - var whitespace = line.slice(0, firstNonWS(line)); - if (baseString == null || baseString.length > whitespace.length) { - baseString = whitespace; - } - } - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i), - cut = baseString.length; - if (!blankLines && !nonWS.test(line)) continue; - if (line.slice(0, cut) != baseString) cut = firstNonWS(line); - self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut)); - } - } else { - for (var i = from.line; i < end; ++i) { - if (blankLines || nonWS.test(self.getLine(i))) self.replaceRange(commentString + pad, Pos(i, 0)); - } - } - }); - }); - CodeMirror.defineExtension("blockComment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) { - if ((options.lineComment || mode.lineComment) && options.fullLines != false) self.lineComment(from, to, options); - return; - } - if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return; - var end = Math.min(to.line, self.lastLine()); - if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; - var pad = options.padding == null ? " " : options.padding; - if (from.line > end) return; - self.operation(function () { - if (options.fullLines != false) { - var lastLineHasText = nonWS.test(self.getLine(end)); - self.replaceRange(pad + endString, Pos(end)); - self.replaceRange(startString + pad, Pos(from.line, 0)); - var lead = options.blockCommentLead || mode.blockCommentLead; - if (lead != null) { - for (var i = from.line + 1; i <= end; ++i) if (i != end || lastLineHasText) self.replaceRange(lead + pad, Pos(i, 0)); - } - } else { - var atCursor = cmp(self.getCursor("to"), to) == 0, - empty = !self.somethingSelected(); - self.replaceRange(endString, to); - if (atCursor) self.setSelection(empty ? to : self.getCursor("from"), to); - self.replaceRange(startString, from); - } - }); - }); - CodeMirror.defineExtension("uncomment", function (from, to, options) { - if (!options) options = noOptions; - var self = this, - mode = getMode(self, from); - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), - start = Math.min(from.line, end); - var lineString = options.lineComment || mode.lineComment, - lines = []; - var pad = options.padding == null ? " " : options.padding, - didSomething; - lineComment: { - if (!lineString) break lineComment; - for (var i = start; i <= end; ++i) { - var line = self.getLine(i); - var found = line.indexOf(lineString); - if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; - if (found == -1 && nonWS.test(line)) break lineComment; - if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; - lines.push(line); - } - self.operation(function () { - for (var i2 = start; i2 <= end; ++i2) { - var line2 = lines[i2 - start]; - var pos = line2.indexOf(lineString), - endPos = pos + lineString.length; - if (pos < 0) continue; - if (line2.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; - didSomething = true; - self.replaceRange("", Pos(i2, pos), Pos(i2, endPos)); - } - }); - if (didSomething) return true; - } - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) return false; - var lead = options.blockCommentLead || mode.blockCommentLead; - var startLine = self.getLine(start), - open = startLine.indexOf(startString); - if (open == -1) return false; - var endLine = end == start ? startLine : self.getLine(end); - var close = endLine.indexOf(endString, end == start ? open + startString.length : 0); - var insideStart = Pos(start, open + 1), - insideEnd = Pos(end, close + 1); - if (close == -1 || !/comment/.test(self.getTokenTypeAt(insideStart)) || !/comment/.test(self.getTokenTypeAt(insideEnd)) || self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1) return false; - var lastStart = startLine.lastIndexOf(startString, from.ch); - var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length); - if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false; - firstEnd = endLine.indexOf(endString, to.ch); - var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch); - lastStart = firstEnd == -1 || almostLastStart == -1 ? -1 : to.ch + almostLastStart; - if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false; - self.operation(function () { - self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), Pos(end, close + endString.length)); - var openEnd = open + startString.length; - if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length; - self.replaceRange("", Pos(start, open), Pos(start, openEnd)); - if (lead) for (var i2 = start + 1; i2 <= end; ++i2) { - var line2 = self.getLine(i2), - found2 = line2.indexOf(lead); - if (found2 == -1 || nonWS.test(line2.slice(0, found2))) continue; - var foundEnd = found2 + lead.length; - if (pad && line2.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length; - self.replaceRange("", Pos(i2, found2), Pos(i2, foundEnd)); - } - }); - return true; - }); - }); - })(); - var comment = comment$2.exports; - var comment$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": comment - }, [comment$2.exports]); - _exports.c = comment$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/dialog.es.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/dialog.es.js ***! - \**********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.d = _exports.a = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var dialog$2 = { - exports: {} - }; - _exports.a = dialog$2; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - function dialogDiv(cm, template, bottom) { - var wrap = cm.getWrapperElement(); - var dialog2; - dialog2 = wrap.appendChild(document.createElement("div")); - if (bottom) dialog2.className = "CodeMirror-dialog CodeMirror-dialog-bottom";else dialog2.className = "CodeMirror-dialog CodeMirror-dialog-top"; - if (typeof template == "string") { - dialog2.innerHTML = template; - } else { - dialog2.appendChild(template); - } - CodeMirror.addClass(wrap, "dialog-opened"); - return dialog2; - } - __name(dialogDiv, "dialogDiv"); - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - __name(closeNotification, "closeNotification"); - CodeMirror.defineExtension("openDialog", function (template, callback, options) { - if (!options) options = {}; - closeNotification(this, null); - var dialog2 = dialogDiv(this, template, options.bottom); - var closed = false, - me = this; - function close(newVal) { - if (typeof newVal == "string") { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - me.focus(); - if (options.onClose) options.onClose(dialog2); - } - } - __name(close, "close"); - var inp = dialog2.getElementsByTagName("input")[0], - button; - if (inp) { - inp.focus(); - if (options.value) { - inp.value = options.value; - if (options.selectValueOnOpen !== false) { - inp.select(); - } - } - if (options.onInput) CodeMirror.on(inp, "input", function (e) { - options.onInput(e, inp.value, close); - }); - if (options.onKeyUp) CodeMirror.on(inp, "keyup", function (e) { - options.onKeyUp(e, inp.value, close); - }); - CodeMirror.on(inp, "keydown", function (e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { - return; - } - if (e.keyCode == 27 || options.closeOnEnter !== false && e.keyCode == 13) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value, e); - }); - if (options.closeOnBlur !== false) CodeMirror.on(dialog2, "focusout", function (evt) { - if (evt.relatedTarget !== null) close(); - }); - } else if (button = dialog2.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function () { - close(); - me.focus(); - }); - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - button.focus(); - } - return close; - }); - CodeMirror.defineExtension("openConfirm", function (template, callbacks, options) { - closeNotification(this, null); - var dialog2 = dialogDiv(this, template, options && options.bottom); - var buttons = dialog2.getElementsByTagName("button"); - var closed = false, - me = this, - blurring = 1; - function close() { - if (closed) return; - closed = true; - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - me.focus(); - } - __name(close, "close"); - buttons[0].focus(); - for (var i = 0; i < buttons.length; ++i) { - var b = buttons[i]; - (function (callback) { - CodeMirror.on(b, "click", function (e) { - CodeMirror.e_preventDefault(e); - close(); - if (callback) callback(me); - }); - })(callbacks[i]); - CodeMirror.on(b, "blur", function () { - --blurring; - setTimeout(function () { - if (blurring <= 0) close(); - }, 200); - }); - CodeMirror.on(b, "focus", function () { - ++blurring; - }); - } - }); - CodeMirror.defineExtension("openNotification", function (template, options) { - closeNotification(this, close); - var dialog2 = dialogDiv(this, template, options && options.bottom); - var closed = false, - doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5e3; - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - CodeMirror.rmClass(dialog2.parentNode, "dialog-opened"); - dialog2.parentNode.removeChild(dialog2); - } - __name(close, "close"); - CodeMirror.on(dialog2, "click", function (e) { - CodeMirror.e_preventDefault(e); - close(); - }); - if (duration) doneTimer = setTimeout(close, duration); - return close; - }); - }); - })(); - var dialog = dialog$2.exports; - var dialog$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": dialog - }, [dialog$2.exports]); - _exports.d = dialog$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/foldgutter.es.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/foldgutter.es.js ***! - \**************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.f = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var foldgutter$2 = { - exports: {} - }; - var foldcode = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - function doFold(cm, pos, options, force) { - if (options && options.call) { - var finder = options; - options = null; - } else { - var finder = getOption(cm, options, "rangeFinder"); - } - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = getOption(cm, options, "minFoldSize"); - function getRange(allowFolded) { - var range2 = finder(cm, pos); - if (!range2 || range2.to.line - range2.from.line < minSize) return null; - if (force === "fold") return range2; - var marks = cm.findMarksAt(range2.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold) { - if (!allowFolded) return null; - range2.cleared = true; - marks[i].clear(); - } - } - return range2; - } - __name(getRange, "getRange"); - var range = getRange(true); - if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - var myWidget = makeWidget(cm, options, range); - CodeMirror.on(myWidget, "mousedown", function (e) { - myRange.clear(); - CodeMirror.e_preventDefault(e); - }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: getOption(cm, options, "clearOnEnter"), - __isFold: true - }); - myRange.on("clear", function (from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - __name(doFold, "doFold"); - function makeWidget(cm, options, range) { - var widget = getOption(cm, options, "widget"); - if (typeof widget == "function") { - widget = widget(range.from, range.to); - } - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } else if (widget) { - widget = widget.cloneNode(true); - } - return widget; - } - __name(makeWidget, "makeWidget"); - CodeMirror.newFoldFunction = function (rangeFinder, widget) { - return function (cm, pos) { - doFold(cm, pos, { - rangeFinder, - widget - }); - }; - }; - CodeMirror.defineExtension("foldCode", function (pos, options, force) { - doFold(this, pos, options, force); - }); - CodeMirror.defineExtension("isFolded", function (pos) { - var marks = this.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) if (marks[i].__isFold) return true; - }); - CodeMirror.commands.toggleFold = function (cm) { - cm.foldCode(cm.getCursor()); - }; - CodeMirror.commands.fold = function (cm) { - cm.foldCode(cm.getCursor(), null, "fold"); - }; - CodeMirror.commands.unfold = function (cm) { - cm.foldCode(cm.getCursor(), { - scanUp: false - }, "unfold"); - }; - CodeMirror.commands.foldAll = function (cm) { - cm.operation(function () { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { - scanUp: false - }, "fold"); - }); - }; - CodeMirror.commands.unfoldAll = function (cm) { - cm.operation(function () { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) cm.foldCode(CodeMirror.Pos(i, 0), { - scanUp: false - }, "unfold"); - }); - }; - CodeMirror.registerHelper("fold", "combine", function () { - var funcs = Array.prototype.slice.call(arguments, 0); - return function (cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - CodeMirror.registerHelper("fold", "auto", function (cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - var defaultOptions = { - rangeFinder: CodeMirror.fold.auto, - widget: "\u2194", - minFoldSize: 0, - scanUp: false, - clearOnEnter: true - }; - CodeMirror.defineOption("foldOptions", null); - function getOption(cm, options, name) { - if (options && options[name] !== void 0) return options[name]; - var editorOptions = cm.options.foldOptions; - if (editorOptions && editorOptions[name] !== void 0) return editorOptions[name]; - return defaultOptions[name]; - } - __name(getOption, "getOption"); - CodeMirror.defineExtension("foldOption", function (options, name) { - return getOption(this, options, name); - }); - }); - })(); - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports, foldcode.exports); - })(function (CodeMirror) { - CodeMirror.defineOption("foldGutter", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("changes", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", onChange); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("changes", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", onChange); - } - }); - var Pos = CodeMirror.Pos; - function State(options) { - this.options = options; - this.from = this.to = 0; - } - __name(State, "State"); - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - __name(parseOptions, "parseOptions"); - function isFolded(cm, line) { - var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0)); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold) { - var fromPos = marks[i].find(-1); - if (fromPos && fromPos.line === line) return marks[i]; - } - } - } - __name(isFolded, "isFolded"); - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec + " CodeMirror-guttermarker-subtle"; - return elt; - } else { - return spec.cloneNode(true); - } - } - __name(marker, "marker"); - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, - cur = from - 1; - var minSize = cm.foldOption(opts, "minFoldSize"); - var func = cm.foldOption(opts, "rangeFinder"); - var clsFolded = typeof opts.indicatorFolded == "string" && classTest(opts.indicatorFolded); - var clsOpen = typeof opts.indicatorOpen == "string" && classTest(opts.indicatorOpen); - cm.eachLine(from, to, function (line) { - ++cur; - var mark = null; - var old = line.gutterMarkers; - if (old) old = old[opts.gutter]; - if (isFolded(cm, cur)) { - if (clsFolded && old && clsFolded.test(old.className)) return; - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0); - var range = func && func(cm, pos); - if (range && range.to.line - range.from.line >= minSize) { - if (clsOpen && old && clsOpen.test(old.className)) return; - mark = marker(opts.indicatorOpen); - } - } - if (!mark && !old) return; - cm.setGutterMarker(line, opts.gutter, mark); - }); - } - __name(updateFoldInfo, "updateFoldInfo"); - function classTest(cls) { - return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); - } - __name(classTest, "classTest"); - function updateInViewport(cm) { - var vp = cm.getViewport(), - state = cm.state.foldGutter; - if (!state) return; - cm.operation(function () { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; - state.to = vp.to; - } - __name(updateInViewport, "updateInViewport"); - function onGutterClick(cm, line, gutter) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - if (gutter != opts.gutter) return; - var folded = isFolded(cm, line); - if (folded) folded.clear();else cm.foldCode(Pos(line, 0), opts); - } - __name(onGutterClick, "onGutterClick"); - function onChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function () { - updateInViewport(cm); - }, opts.foldOnChangeTimeSpan || 600); - } - __name(onChange, "onChange"); - function onViewportChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function () { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function () { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); - } - __name(onViewportChange, "onViewportChange"); - function onFold(cm, from) { - var state = cm.state.foldGutter; - if (!state) return; - var line = from.line; - if (line >= state.from && line < state.to) updateFoldInfo(cm, line, line + 1); - } - __name(onFold, "onFold"); - }); - })(); - var foldgutter = foldgutter$2.exports; - var foldgutter$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": foldgutter - }, [foldgutter$2.exports]); - _exports.f = foldgutter$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/forEachState.es.js": -/*!****************************************************!*\ - !*** ../../graphiql-react/dist/forEachState.es.js ***! - \****************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.f = forEachState; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function forEachState(stack, fn) { - const reverseStateStack = []; - let state = stack; - while (state === null || state === void 0 ? void 0 : state.kind) { - reverseStateStack.push(state); - state = state.prevState; - } - for (let i = reverseStateStack.length - 1; i >= 0; i--) { - fn(reverseStateStack[i]); - } - } - __name(forEachState, "forEachState"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/graphiql-react.es.js": -/*!******************************************************!*\ - !*** ../../graphiql-react/dist/graphiql-react.es.js ***! - \******************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _indexEs, _react, _graphql, _reactDom) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - Object.defineProperty(_exports, "Argument", { - enumerable: true, - get: function () { - return _indexEs.A; - } - }); - Object.defineProperty(_exports, "ArgumentIcon", { - enumerable: true, - get: function () { - return _indexEs.ac; - } - }); - Object.defineProperty(_exports, "Button", { - enumerable: true, - get: function () { - return _indexEs.aH; - } - }); - Object.defineProperty(_exports, "ButtonGroup", { - enumerable: true, - get: function () { - return _indexEs.aI; - } - }); - Object.defineProperty(_exports, "ChevronDownIcon", { - enumerable: true, - get: function () { - return _indexEs.ad; - } - }); - Object.defineProperty(_exports, "ChevronLeftIcon", { - enumerable: true, - get: function () { - return _indexEs.ae; - } - }); - Object.defineProperty(_exports, "ChevronUpIcon", { - enumerable: true, - get: function () { - return _indexEs.af; - } - }); - Object.defineProperty(_exports, "CloseIcon", { - enumerable: true, - get: function () { - return _indexEs.ag; - } - }); - Object.defineProperty(_exports, "CopyIcon", { - enumerable: true, - get: function () { - return _indexEs.ah; - } - }); - Object.defineProperty(_exports, "DOC_EXPLORER_PLUGIN", { - enumerable: true, - get: function () { - return _indexEs._; - } - }); - Object.defineProperty(_exports, "DefaultValue", { - enumerable: true, - get: function () { - return _indexEs.D; - } - }); - Object.defineProperty(_exports, "DeprecatedArgumentIcon", { - enumerable: true, - get: function () { - return _indexEs.ai; - } - }); - Object.defineProperty(_exports, "DeprecatedEnumValueIcon", { - enumerable: true, - get: function () { - return _indexEs.aj; - } - }); - Object.defineProperty(_exports, "DeprecatedFieldIcon", { - enumerable: true, - get: function () { - return _indexEs.ak; - } - }); - Object.defineProperty(_exports, "DeprecationReason", { - enumerable: true, - get: function () { - return _indexEs.w; - } - }); - Object.defineProperty(_exports, "Dialog", { - enumerable: true, - get: function () { - return _indexEs.aJ; - } - }); - Object.defineProperty(_exports, "Directive", { - enumerable: true, - get: function () { - return _indexEs.x; - } - }); - Object.defineProperty(_exports, "DirectiveIcon", { - enumerable: true, - get: function () { - return _indexEs.al; - } - }); - Object.defineProperty(_exports, "DocExplorer", { - enumerable: true, - get: function () { - return _indexEs.y; - } - }); - Object.defineProperty(_exports, "DocsFilledIcon", { - enumerable: true, - get: function () { - return _indexEs.am; - } - }); - Object.defineProperty(_exports, "DocsIcon", { - enumerable: true, - get: function () { - return _indexEs.an; - } - }); - Object.defineProperty(_exports, "EditorContext", { - enumerable: true, - get: function () { - return _indexEs.E; - } - }); - Object.defineProperty(_exports, "EditorContextProvider", { - enumerable: true, - get: function () { - return _indexEs.d; - } - }); - Object.defineProperty(_exports, "EnumValueIcon", { - enumerable: true, - get: function () { - return _indexEs.ao; - } - }); - Object.defineProperty(_exports, "ExecuteButton", { - enumerable: true, - get: function () { - return _indexEs.aS; - } - }); - Object.defineProperty(_exports, "ExecutionContext", { - enumerable: true, - get: function () { - return _indexEs.r; - } - }); - Object.defineProperty(_exports, "ExecutionContextProvider", { - enumerable: true, - get: function () { - return _indexEs.s; - } - }); - Object.defineProperty(_exports, "ExplorerContext", { - enumerable: true, - get: function () { - return _indexEs.z; - } - }); - Object.defineProperty(_exports, "ExplorerContextProvider", { - enumerable: true, - get: function () { - return _indexEs.B; - } - }); - Object.defineProperty(_exports, "ExplorerSection", { - enumerable: true, - get: function () { - return _indexEs.F; - } - }); - Object.defineProperty(_exports, "FieldDocumentation", { - enumerable: true, - get: function () { - return _indexEs.G; - } - }); - Object.defineProperty(_exports, "FieldIcon", { - enumerable: true, - get: function () { - return _indexEs.ap; - } - }); - Object.defineProperty(_exports, "FieldLink", { - enumerable: true, - get: function () { - return _indexEs.J; - } - }); - Object.defineProperty(_exports, "GraphiQLProvider", { - enumerable: true, - get: function () { - return _indexEs.a3; - } - }); - Object.defineProperty(_exports, "HISTORY_PLUGIN", { - enumerable: true, - get: function () { - return _indexEs.$; - } - }); - Object.defineProperty(_exports, "HeaderEditor", { - enumerable: true, - get: function () { - return _indexEs.H; - } - }); - Object.defineProperty(_exports, "History", { - enumerable: true, - get: function () { - return _indexEs.W; - } - }); - Object.defineProperty(_exports, "HistoryContext", { - enumerable: true, - get: function () { - return _indexEs.X; - } - }); - Object.defineProperty(_exports, "HistoryContextProvider", { - enumerable: true, - get: function () { - return _indexEs.Y; - } - }); - Object.defineProperty(_exports, "HistoryIcon", { - enumerable: true, - get: function () { - return _indexEs.aq; - } - }); - Object.defineProperty(_exports, "ImagePreview", { - enumerable: true, - get: function () { - return _indexEs.I; - } - }); - Object.defineProperty(_exports, "ImplementsIcon", { - enumerable: true, - get: function () { - return _indexEs.ar; - } - }); - Object.defineProperty(_exports, "KeyboardShortcutIcon", { - enumerable: true, - get: function () { - return _indexEs.as; - } - }); - Object.defineProperty(_exports, "Listbox", { - enumerable: true, - get: function () { - return _indexEs.aL; - } - }); - Object.defineProperty(_exports, "MagnifyingGlassIcon", { - enumerable: true, - get: function () { - return _indexEs.at; - } - }); - Object.defineProperty(_exports, "MarkdownContent", { - enumerable: true, - get: function () { - return _indexEs.aM; - } - }); - Object.defineProperty(_exports, "Menu", { - enumerable: true, - get: function () { - return _indexEs.aK; - } - }); - Object.defineProperty(_exports, "MergeIcon", { - enumerable: true, - get: function () { - return _indexEs.au; - } - }); - Object.defineProperty(_exports, "PenIcon", { - enumerable: true, - get: function () { - return _indexEs.av; - } - }); - Object.defineProperty(_exports, "PlayIcon", { - enumerable: true, - get: function () { - return _indexEs.aw; - } - }); - Object.defineProperty(_exports, "PluginContext", { - enumerable: true, - get: function () { - return _indexEs.a0; - } - }); - Object.defineProperty(_exports, "PluginContextProvider", { - enumerable: true, - get: function () { - return _indexEs.a1; - } - }); - Object.defineProperty(_exports, "PlusIcon", { - enumerable: true, - get: function () { - return _indexEs.ax; - } - }); - Object.defineProperty(_exports, "PrettifyIcon", { - enumerable: true, - get: function () { - return _indexEs.ay; - } - }); - Object.defineProperty(_exports, "QueryEditor", { - enumerable: true, - get: function () { - return _indexEs.Q; - } - }); - Object.defineProperty(_exports, "ReloadIcon", { - enumerable: true, - get: function () { - return _indexEs.az; - } - }); - Object.defineProperty(_exports, "ResponseEditor", { - enumerable: true, - get: function () { - return _indexEs.R; - } - }); - Object.defineProperty(_exports, "RootTypeIcon", { - enumerable: true, - get: function () { - return _indexEs.aA; - } - }); - Object.defineProperty(_exports, "SchemaContext", { - enumerable: true, - get: function () { - return _indexEs.a4; - } - }); - Object.defineProperty(_exports, "SchemaContextProvider", { - enumerable: true, - get: function () { - return _indexEs.a5; - } - }); - Object.defineProperty(_exports, "SchemaDocumentation", { - enumerable: true, - get: function () { - return _indexEs.K; - } - }); - Object.defineProperty(_exports, "Search", { - enumerable: true, - get: function () { - return _indexEs.M; - } - }); - Object.defineProperty(_exports, "SettingsIcon", { - enumerable: true, - get: function () { - return _indexEs.aB; - } - }); - Object.defineProperty(_exports, "Spinner", { - enumerable: true, - get: function () { - return _indexEs.aN; - } - }); - Object.defineProperty(_exports, "StarFilledIcon", { - enumerable: true, - get: function () { - return _indexEs.aC; - } - }); - Object.defineProperty(_exports, "StarIcon", { - enumerable: true, - get: function () { - return _indexEs.aD; - } - }); - Object.defineProperty(_exports, "StopIcon", { - enumerable: true, - get: function () { - return _indexEs.aE; - } - }); - Object.defineProperty(_exports, "StorageContext", { - enumerable: true, - get: function () { - return _indexEs.a7; - } - }); - Object.defineProperty(_exports, "StorageContextProvider", { - enumerable: true, - get: function () { - return _indexEs.a8; - } - }); - Object.defineProperty(_exports, "Tab", { - enumerable: true, - get: function () { - return _indexEs.aO; - } - }); - Object.defineProperty(_exports, "Tabs", { - enumerable: true, - get: function () { - return _indexEs.aP; - } - }); - Object.defineProperty(_exports, "ToolbarButton", { - enumerable: true, - get: function () { - return _indexEs.aR; - } - }); - Object.defineProperty(_exports, "ToolbarListbox", { - enumerable: true, - get: function () { - return _indexEs.aT; - } - }); - Object.defineProperty(_exports, "ToolbarMenu", { - enumerable: true, - get: function () { - return _indexEs.aU; - } - }); - Object.defineProperty(_exports, "Tooltip", { - enumerable: true, - get: function () { - return _indexEs.aQ; - } - }); - Object.defineProperty(_exports, "TypeDocumentation", { - enumerable: true, - get: function () { - return _indexEs.N; - } - }); - Object.defineProperty(_exports, "TypeIcon", { - enumerable: true, - get: function () { - return _indexEs.aF; - } - }); - Object.defineProperty(_exports, "TypeLink", { - enumerable: true, - get: function () { - return _indexEs.O; - } - }); - Object.defineProperty(_exports, "UnStyledButton", { - enumerable: true, - get: function () { - return _indexEs.aG; - } - }); - Object.defineProperty(_exports, "VariableEditor", { - enumerable: true, - get: function () { - return _indexEs.V; - } - }); - Object.defineProperty(_exports, "useAutoCompleteLeafs", { - enumerable: true, - get: function () { - return _indexEs.u; - } - }); - Object.defineProperty(_exports, "useCopyQuery", { - enumerable: true, - get: function () { - return _indexEs.e; - } - }); - Object.defineProperty(_exports, "useDragResize", { - enumerable: true, - get: function () { - return _indexEs.ab; - } - }); - Object.defineProperty(_exports, "useEditorContext", { - enumerable: true, - get: function () { - return _indexEs.f; - } - }); - Object.defineProperty(_exports, "useExecutionContext", { - enumerable: true, - get: function () { - return _indexEs.v; - } - }); - Object.defineProperty(_exports, "useExplorerContext", { - enumerable: true, - get: function () { - return _indexEs.U; - } - }); - Object.defineProperty(_exports, "useHeaderEditor", { - enumerable: true, - get: function () { - return _indexEs.h; - } - }); - Object.defineProperty(_exports, "useHistoryContext", { - enumerable: true, - get: function () { - return _indexEs.Z; - } - }); - Object.defineProperty(_exports, "useMergeQuery", { - enumerable: true, - get: function () { - return _indexEs.j; - } - }); - Object.defineProperty(_exports, "usePluginContext", { - enumerable: true, - get: function () { - return _indexEs.a2; - } - }); - Object.defineProperty(_exports, "usePrettifyEditors", { - enumerable: true, - get: function () { - return _indexEs.k; - } - }); - Object.defineProperty(_exports, "useQueryEditor", { - enumerable: true, - get: function () { - return _indexEs.m; - } - }); - Object.defineProperty(_exports, "useResponseEditor", { - enumerable: true, - get: function () { - return _indexEs.n; - } - }); - Object.defineProperty(_exports, "useSchemaContext", { - enumerable: true, - get: function () { - return _indexEs.a6; - } - }); - Object.defineProperty(_exports, "useStorageContext", { - enumerable: true, - get: function () { - return _indexEs.a9; - } - }); - Object.defineProperty(_exports, "useTheme", { - enumerable: true, - get: function () { - return _indexEs.aa; - } - }); - Object.defineProperty(_exports, "useVariableEditor", { - enumerable: true, - get: function () { - return _indexEs.q; - } - }); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/hint.es.js": -/*!********************************************!*\ - !*** ../../graphiql-react/dist/hint.es.js ***! - \********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./show-hint.es.js */ "../../graphiql-react/dist/show-hint.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! ./Range.es.js */ "../../graphiql-react/dist/Range.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _showHintEs, _graphql, _indexEs, _RangeEs, _react, _reactDom) { - "use strict"; - - _codemirrorEs.C.registerHelper("hint", "graphql", (editor, options) => { - const { - schema, - externalFragments - } = options; - if (!schema) { - return; - } - const cur = editor.getCursor(); - const token = editor.getTokenAt(cur); - const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; - const position = new _RangeEs.P(cur.line, tokenStart); - const rawResults = (0, _indexEs.g)(schema, editor.getValue(), position, token, externalFragments); - const results = { - list: rawResults.map(item => ({ - text: item.label, - type: item.type, - description: item.documentation, - isDeprecated: item.isDeprecated, - deprecationReason: item.deprecationReason - })), - from: { - line: cur.line, - ch: tokenStart - }, - to: { - line: cur.line, - ch: token.end - } - }; - if ((results === null || results === void 0 ? void 0 : results.list) && results.list.length > 0) { - results.from = _codemirrorEs.C.Pos(results.from.line, results.from.ch); - results.to = _codemirrorEs.C.Pos(results.to.line, results.to.ch); - _codemirrorEs.C.signal(editor, "hasCompletion", editor, results, token); - } - return results; - }); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/hint.es2.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/hint.es2.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./forEachState.es.js */ "../../graphiql-react/dist/forEachState.es.js"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _forEachStateEs, _indexEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function hintList(cursor, token, list) { - const hints = filterAndSortList(list, normalizeText(token.string)); - if (!hints) { - return; - } - const tokenStart = token.type !== null && /"|\w/.test(token.string[0]) ? token.start : token.end; - return { - list: hints, - from: { - line: cursor.line, - ch: tokenStart - }, - to: { - line: cursor.line, - ch: token.end - } - }; - } - __name(hintList, "hintList"); - function filterAndSortList(list, text) { - if (!text) { - return filterNonEmpty(list, entry => !entry.isDeprecated); - } - const byProximity = list.map(entry => ({ - proximity: getProximity(normalizeText(entry.text), text), - entry - })); - const conciseMatches = filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated); - const sortedMatches = conciseMatches.sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.text.length - b.entry.text.length); - return sortedMatches.map(pair => pair.entry); - } - __name(filterAndSortList, "filterAndSortList"); - function filterNonEmpty(array, predicate) { - const filtered = array.filter(predicate); - return filtered.length === 0 ? array : filtered; - } - __name(filterNonEmpty, "filterNonEmpty"); - function normalizeText(text) { - return text.toLowerCase().replace(/\W/g, ""); - } - __name(normalizeText, "normalizeText"); - function getProximity(suggestion, text) { - let proximity = lexicalDistance(text, suggestion); - if (suggestion.length > text.length) { - proximity -= suggestion.length - text.length - 1; - proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5; - } - return proximity; - } - __name(getProximity, "getProximity"); - function lexicalDistance(a, b) { - let i; - let j; - const d = []; - const aLength = a.length; - const bLength = b.length; - for (i = 0; i <= aLength; i++) { - d[i] = [i]; - } - for (j = 1; j <= bLength; j++) { - d[0][j] = j; - } - for (i = 1; i <= aLength; i++) { - for (j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); - } - } - } - return d[aLength][bLength]; - } - __name(lexicalDistance, "lexicalDistance"); - _codemirrorEs.C.registerHelper("hint", "graphql-variables", (editor, options) => { - const cur = editor.getCursor(); - const token = editor.getTokenAt(cur); - const results = getVariablesHint(cur, token, options); - if ((results === null || results === void 0 ? void 0 : results.list) && results.list.length > 0) { - results.from = _codemirrorEs.C.Pos(results.from.line, results.from.ch); - results.to = _codemirrorEs.C.Pos(results.to.line, results.to.ch); - _codemirrorEs.C.signal(editor, "hasCompletion", editor, results, token); - } - return results; - }); - function getVariablesHint(cur, token, options) { - const state = token.state.kind === "Invalid" ? token.state.prevState : token.state; - const { - kind, - step - } = state; - if (kind === "Document" && step === 0) { - return hintList(cur, token, [{ - text: "{" - }]); - } - const { - variableToType - } = options; - if (!variableToType) { - return; - } - const typeInfo = getTypeInfo(variableToType, token.state); - if (kind === "Document" || kind === "Variable" && step === 0) { - const variableNames = Object.keys(variableToType); - return hintList(cur, token, variableNames.map(name => ({ - text: `"${name}": `, - type: variableToType[name] - }))); - } - if ((kind === "ObjectValue" || kind === "ObjectField" && step === 0) && typeInfo.fields) { - const inputFields = Object.keys(typeInfo.fields).map(fieldName => typeInfo.fields[fieldName]); - return hintList(cur, token, inputFields.map(field => ({ - text: `"${field.name}": `, - type: field.type, - description: field.description - }))); - } - if (kind === "StringValue" || kind === "NumberValue" || kind === "BooleanValue" || kind === "NullValue" || kind === "ListValue" && step === 1 || kind === "ObjectField" && step === 2 || kind === "Variable" && step === 2) { - const namedInputType = typeInfo.type ? (0, _graphql.getNamedType)(typeInfo.type) : void 0; - if (namedInputType instanceof _graphql.GraphQLInputObjectType) { - return hintList(cur, token, [{ - text: "{" - }]); - } - if (namedInputType instanceof _graphql.GraphQLEnumType) { - const values = namedInputType.getValues(); - return hintList(cur, token, values.map(value => ({ - text: `"${value.name}"`, - type: namedInputType, - description: value.description - }))); - } - if (namedInputType === _graphql.GraphQLBoolean) { - return hintList(cur, token, [{ - text: "true", - type: _graphql.GraphQLBoolean, - description: "Not false." - }, { - text: "false", - type: _graphql.GraphQLBoolean, - description: "Not true." - }]); - } - } - } - __name(getVariablesHint, "getVariablesHint"); - function getTypeInfo(variableToType, tokenState) { - const info = { - type: null, - fields: null - }; - (0, _forEachStateEs.f)(tokenState, state => { - if (state.kind === "Variable") { - info.type = variableToType[state.name]; - } else if (state.kind === "ListValue") { - const nullableType = info.type ? (0, _graphql.getNullableType)(info.type) : void 0; - info.type = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; - } else if (state.kind === "ObjectValue") { - const objectType = info.type ? (0, _graphql.getNamedType)(info.type) : void 0; - info.fields = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; - } else if (state.kind === "ObjectField") { - const objectField = state.name && info.fields ? info.fields[state.name] : null; - info.type = objectField === null || objectField === void 0 ? void 0 : objectField.type; - } - }); - return info; - } - __name(getTypeInfo, "getTypeInfo"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/index.es.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/index.es.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! react */ "react"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, React, _graphql, _reactDom) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.$ = void 0; - _exports.A = Argument; - _exports.B = ExplorerContextProvider; - _exports.C = void 0; - _exports.D = DefaultValue; - _exports.E = void 0; - _exports.F = ExplorerSection; - _exports.G = FieldDocumentation; - _exports.H = HeaderEditor; - _exports.I = ImagePreview; - _exports.J = FieldLink; - _exports.K = SchemaDocumentation; - _exports.L = void 0; - _exports.M = Search; - _exports.N = TypeDocumentation; - _exports.O = TypeLink; - _exports.P = void 0; - _exports.Q = QueryEditor; - _exports.R = ResponseEditor; - _exports.U = _exports.T = _exports.S = void 0; - _exports.V = VariableEditor; - _exports.W = History; - _exports.X = void 0; - _exports.Y = HistoryContextProvider; - _exports.a0 = _exports.a = _exports._ = _exports.Z = void 0; - _exports.a1 = PluginContextProvider; - _exports.a2 = void 0; - _exports.a3 = GraphiQLProvider; - _exports.a4 = void 0; - _exports.a5 = SchemaContextProvider; - _exports.a7 = _exports.a6 = void 0; - _exports.a8 = StorageContextProvider; - _exports.aR = _exports.aQ = _exports.aP = _exports.aO = _exports.aN = _exports.aM = _exports.aL = _exports.aK = _exports.aJ = _exports.aI = _exports.aH = _exports.aG = _exports.aF = _exports.aE = _exports.aD = _exports.aC = _exports.aB = _exports.aA = _exports.a9 = void 0; - _exports.aS = ExecuteButton; - _exports.aU = _exports.aT = void 0; - _exports.aa = useTheme; - _exports.ab = useDragResize; - _exports.az = _exports.ay = _exports.ax = _exports.aw = _exports.av = _exports.au = _exports.at = _exports.as = _exports.ar = _exports.aq = _exports.ap = _exports.ao = _exports.an = _exports.am = _exports.al = _exports.ak = _exports.aj = _exports.ai = _exports.ah = _exports.ag = _exports.af = _exports.ae = _exports.ad = _exports.ac = void 0; - _exports.b = opt; - _exports.c = void 0; - _exports.d = EditorContextProvider; - _exports.e = useCopyQuery; - _exports.f = void 0; - _exports.g = getAutocompleteSuggestions; - _exports.h = useHeaderEditor; - _exports.i = void 0; - _exports.j = useMergeQuery; - _exports.k = usePrettifyEditors; - _exports.l = list$1; - _exports.m = useQueryEditor; - _exports.n = useResponseEditor; - _exports.o = onlineParser; - _exports.p = p$1; - _exports.q = useVariableEditor; - _exports.r = void 0; - _exports.s = ExecutionContextProvider; - _exports.t = t$2; - _exports.u = useAutoCompleteLeafs; - _exports.v = void 0; - _exports.w = DeprecationReason; - _exports.x = Directive; - _exports.y = DocExplorer; - _exports.z = void 0; - React = _interopRequireWildcard(React); - _reactDom = _interopRequireWildcard(_reactDom); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - var __defProp = Object.defineProperty; - var __defProps = Object.defineProperties; - var __getOwnPropDescs = Object.getOwnPropertyDescriptors; - var __getOwnPropSymbols = Object.getOwnPropertySymbols; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __propIsEnum = Object.prototype.propertyIsEnumerable; - var __defNormalProp = (obj, key, value3) => key in obj ? __defProp(obj, key, { - enumerable: true, - configurable: true, - writable: true, - value: value3 - }) : obj[key] = value3; - var __spreadValues = (a2, b2) => { - for (var prop2 in b2 || (b2 = {})) if (__hasOwnProp.call(b2, prop2)) __defNormalProp(a2, prop2, b2[prop2]); - if (__getOwnPropSymbols) for (var prop2 of __getOwnPropSymbols(b2)) { - if (__propIsEnum.call(b2, prop2)) __defNormalProp(a2, prop2, b2[prop2]); - } - return a2; - }; - var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2)); - var __name = (target2, value3) => __defProp(target2, "name", { - value: value3, - configurable: true - }); - var __objRest = (source, exclude) => { - var target2 = {}; - for (var prop2 in source) if (__hasOwnProp.call(source, prop2) && exclude.indexOf(prop2) < 0) target2[prop2] = source[prop2]; - if (source != null && __getOwnPropSymbols) for (var prop2 of __getOwnPropSymbols(source)) { - if (exclude.indexOf(prop2) < 0 && __propIsEnum.call(source, prop2)) target2[prop2] = source[prop2]; - } - return target2; - }; - var root = /* @__PURE__ */(() => '.graphiql-container *{box-sizing:border-box}.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal{--color-primary: 320, 95%, 43%;--color-secondary: 242, 51%, 61%;--color-tertiary: 188, 100%, 36%;--color-info: 208, 100%, 46%;--color-success: 158, 60%, 42%;--color-warning: 36, 100%, 41%;--color-error: 13, 93%, 58%;--color-neutral: 219, 28%, 32%;--color-base: 219, 28%, 100%;--alpha-secondary: .76;--alpha-tertiary: .5;--alpha-background-heavy: .15;--alpha-background-medium: .1;--alpha-background-light: .07;--font-family: "Roboto", sans-serif;--font-family-mono: "Fira Code", monospace;--font-size-hint:.75rem;--font-size-inline-code:.8125rem;--font-size-body:.9375rem;--font-size-h4:1.125rem;--font-size-h3:1.375rem;--font-size-h2:1.8125rem;--font-weight-regular: 400;--font-weight-medium: 500;--line-height: 1.5;--px-2: 2px;--px-4: 4px;--px-6: 6px;--px-8: 8px;--px-10: 10px;--px-12: 12px;--px-16: 16px;--px-20: 20px;--px-24: 24px;--border-radius-2: 2px;--border-radius-4: 4px;--border-radius-8: 8px;--border-radius-12: 12px;--popover-box-shadow: 0px 6px 20px rgba(59, 76, 106, .13), 0px 1.34018px 4.46726px rgba(59, 76, 106, .0774939), 0px .399006px 1.33002px rgba(59, 76, 106, .0525061);--popover-border: none;--sidebar-width: 60px;--toolbar-width: 40px;--session-header-height: 51px}@media (prefers-color-scheme: dark){body:not(.graphiql-light) .graphiql-container,body:not(.graphiql-light) .CodeMirror-info,body:not(.graphiql-light) .CodeMirror-lint-tooltip,body:not(.graphiql-light) reach-portal{--color-primary: 338, 100%, 67%;--color-secondary: 243, 100%, 77%;--color-tertiary: 188, 100%, 44%;--color-info: 208, 100%, 72%;--color-success: 158, 100%, 42%;--color-warning: 30, 100%, 80%;--color-error: 13, 100%, 58%;--color-neutral: 219, 29%, 78%;--color-base: 219, 29%, 18%;--popover-box-shadow: none;--popover-border: 1px solid hsl(var(--color-neutral))}}body.graphiql-dark .graphiql-container,body.graphiql-dark .CodeMirror-info,body.graphiql-dark .CodeMirror-lint-tooltip,body.graphiql-dark reach-portal{--color-primary: 338, 100%, 67%;--color-secondary: 243, 100%, 77%;--color-tertiary: 188, 100%, 44%;--color-info: 208, 100%, 72%;--color-success: 158, 100%, 42%;--color-warning: 30, 100%, 80%;--color-error: 13, 100%, 58%;--color-neutral: 219, 29%, 78%;--color-base: 219, 29%, 18%;--popover-box-shadow: none;--popover-border: 1px solid hsl(var(--color-neutral))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal),:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal):is(button){color:hsla(var(--color-neutral),1);font-family:var(--font-family);font-size:var(--font-size-body);font-weight:var(----font-weight-regular);line-height:var(--line-height)}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) input{color:hsla(var(--color-neutral),1);font-family:var(--font-family);font-size:var(--font-size-caption)}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) input::placeholder{color:hsla(var(--color-neutral),var(--alpha-secondary))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) a{color:hsl(var(--color-primary))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) a:focus{outline:hsl(var(--color-primary)) auto 1px}\n')(); - function r$2(e2) { - var t2, - f2, - n2 = ""; - if (typeof e2 == "string" || typeof e2 == "number") n2 += e2;else if (typeof e2 == "object") if (Array.isArray(e2)) for (t2 = 0; t2 < e2.length; t2++) e2[t2] && (f2 = r$2(e2[t2])) && (n2 && (n2 += " "), n2 += f2);else for (t2 in e2) e2[t2] && (n2 && (n2 += " "), n2 += t2); - return n2; - } - __name(r$2, "r$2"); - function clsx() { - for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length;) (e2 = arguments[f2++]) && (t2 = r$2(e2)) && (n2 && (n2 += " "), n2 += t2); - return n2; - } - __name(clsx, "clsx"); - function isPromise(value3) { - return typeof value3 === "object" && value3 !== null && typeof value3.then === "function"; - } - __name(isPromise, "isPromise"); - function observableToPromise(observable) { - return new Promise((resolve, reject) => { - const subscription = observable.subscribe({ - next: v2 => { - resolve(v2); - subscription.unsubscribe(); - }, - error: reject, - complete: () => { - reject(new Error("no value resolved")); - } - }); - }); - } - __name(observableToPromise, "observableToPromise"); - function isObservable(value3) { - return typeof value3 === "object" && value3 !== null && "subscribe" in value3 && typeof value3.subscribe === "function"; - } - __name(isObservable, "isObservable"); - function isAsyncIterable(input) { - return typeof input === "object" && input !== null && (input[Symbol.toStringTag] === "AsyncGenerator" || Symbol.asyncIterator in input); - } - __name(isAsyncIterable, "isAsyncIterable"); - function asyncIterableToPromise(input) { - return new Promise((resolve, reject) => { - var _a; - const iteratorReturn = (_a = ("return" in input ? input : input[Symbol.asyncIterator]()).return) === null || _a === void 0 ? void 0 : _a.bind(input); - const iteratorNext = ("next" in input ? input : input[Symbol.asyncIterator]()).next.bind(input); - iteratorNext().then(result => { - resolve(result.value); - iteratorReturn === null || iteratorReturn === void 0 ? void 0 : iteratorReturn(); - }).catch(err => { - reject(err); - }); - }); - } - __name(asyncIterableToPromise, "asyncIterableToPromise"); - function fetcherReturnToPromise(fetcherResult) { - return Promise.resolve(fetcherResult).then(result => { - if (isAsyncIterable(result)) { - return asyncIterableToPromise(result); - } - if (isObservable(result)) { - return observableToPromise(result); - } - return result; - }); - } - __name(fetcherReturnToPromise, "fetcherReturnToPromise"); - globalThis && globalThis.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value3) { - return value3 instanceof P ? value3 : new P(function (resolve) { - resolve(value3); - }); - } - __name(adopt, "adopt"); - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value3) { - try { - step(generator.next(value3)); - } catch (e2) { - reject(e2); - } - } - __name(fulfilled, "fulfilled"); - function rejected(value3) { - try { - step(generator["throw"](value3)); - } catch (e2) { - reject(e2); - } - } - __name(rejected, "rejected"); - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - __name(step, "step"); - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __await = globalThis && globalThis.__await || function (v2) { - return this instanceof __await ? (this.v = v2, this) : new __await(v2); - }; - globalThis && globalThis.__asyncValues || function (o2) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m2 = o2[Symbol.asyncIterator], - i; - return m2 ? m2.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i); - function verb(n2) { - i[n2] = o2[n2] && function (v2) { - return new Promise(function (resolve, reject) { - v2 = o2[n2](v2), settle(resolve, reject, v2.done, v2.value); - }); - }; - } - __name(verb, "verb"); - function settle(resolve, reject, d2, v2) { - Promise.resolve(v2).then(function (v3) { - resolve({ - value: v3, - done: d2 - }); - }, reject); - } - __name(settle, "settle"); - }; - globalThis && globalThis.__asyncGenerator || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g2 = generator.apply(thisArg, _arguments || []), - i, - q2 = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i; - function verb(n2) { - if (g2[n2]) i[n2] = function (v2) { - return new Promise(function (a2, b2) { - q2.push([n2, v2, a2, b2]) > 1 || resume(n2, v2); - }); - }; - } - __name(verb, "verb"); - function resume(n2, v2) { - try { - step(g2[n2](v2)); - } catch (e2) { - settle(q2[0][3], e2); - } - } - __name(resume, "resume"); - function step(r2) { - r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q2[0][2], r2); - } - __name(step, "step"); - function fulfill(value3) { - resume("next", value3); - } - __name(fulfill, "fulfill"); - function reject(value3) { - resume("throw", value3); - } - __name(reject, "reject"); - function settle(f2, v2) { - if (f2(v2), q2.shift(), q2.length) resume(q2[0][0], q2[0][1]); - } - __name(settle, "settle"); - }; - function stringify(obj) { - return JSON.stringify(obj, null, 2); - } - __name(stringify, "stringify"); - function formatSingleError(error2) { - return Object.assign(Object.assign({}, error2), { - message: error2.message, - stack: error2.stack - }); - } - __name(formatSingleError, "formatSingleError"); - function handleSingleError(error2) { - if (error2 instanceof Error) { - return formatSingleError(error2); - } - return error2; - } - __name(handleSingleError, "handleSingleError"); - function formatError(error2) { - if (Array.isArray(error2)) { - return stringify({ - errors: error2.map(e2 => handleSingleError(e2)) - }); - } - return stringify({ - errors: [handleSingleError(error2)] - }); - } - __name(formatError, "formatError"); - function formatResult(result) { - return stringify(result); - } - __name(formatResult, "formatResult"); - function fillLeafs(schema, docString, getDefaultFieldNames) { - const insertions = []; - if (!schema || !docString) { - return { - insertions, - result: docString - }; - } - let ast2; - try { - ast2 = (0, _graphql.parse)(docString); - } catch (_a) { - return { - insertions, - result: docString - }; - } - const fieldNameFn = getDefaultFieldNames || defaultGetDefaultFieldNames; - const typeInfo = new _graphql.TypeInfo(schema); - (0, _graphql.visit)(ast2, { - leave(node) { - typeInfo.leave(node); - }, - enter(node) { - typeInfo.enter(node); - if (node.kind === "Field" && !node.selectionSet) { - const fieldType = typeInfo.getType(); - const selectionSet = buildSelectionSet(isFieldType(fieldType), fieldNameFn); - if (selectionSet && node.loc) { - const indent2 = getIndentation(docString, node.loc.start); - insertions.push({ - index: node.loc.end, - string: " " + (0, _graphql.print)(selectionSet).replace(/\n/g, "\n" + indent2) - }); - } - } - } - }); - return { - insertions, - result: withInsertions(docString, insertions) - }; - } - __name(fillLeafs, "fillLeafs"); - function defaultGetDefaultFieldNames(type2) { - if (!("getFields" in type2)) { - return []; - } - const fields = type2.getFields(); - if (fields.id) { - return ["id"]; - } - if (fields.edges) { - return ["edges"]; - } - if (fields.node) { - return ["node"]; - } - const leafFieldNames = []; - Object.keys(fields).forEach(fieldName => { - if ((0, _graphql.isLeafType)(fields[fieldName].type)) { - leafFieldNames.push(fieldName); - } - }); - return leafFieldNames; - } - __name(defaultGetDefaultFieldNames, "defaultGetDefaultFieldNames"); - function buildSelectionSet(type2, getDefaultFieldNames) { - const namedType = (0, _graphql.getNamedType)(type2); - if (!type2 || (0, _graphql.isLeafType)(type2)) { - return; - } - const fieldNames = getDefaultFieldNames(namedType); - if (!Array.isArray(fieldNames) || fieldNames.length === 0 || !("getFields" in namedType)) { - return; - } - return { - kind: _graphql.Kind.SELECTION_SET, - selections: fieldNames.map(fieldName => { - const fieldDef = namedType.getFields()[fieldName]; - const fieldType = fieldDef ? fieldDef.type : null; - return { - kind: _graphql.Kind.FIELD, - name: { - kind: _graphql.Kind.NAME, - value: fieldName - }, - selectionSet: buildSelectionSet(fieldType, getDefaultFieldNames) - }; - }) - }; - } - __name(buildSelectionSet, "buildSelectionSet"); - function withInsertions(initial, insertions) { - if (insertions.length === 0) { - return initial; - } - let edited = ""; - let prevIndex = 0; - insertions.forEach(_ref9 => { - let { - index, - string - } = _ref9; - edited += initial.slice(prevIndex, index) + string; - prevIndex = index; - }); - edited += initial.slice(prevIndex); - return edited; - } - __name(withInsertions, "withInsertions"); - function getIndentation(str, index) { - let indentStart = index; - let indentEnd = index; - while (indentStart) { - const c2 = str.charCodeAt(indentStart - 1); - if (c2 === 10 || c2 === 13 || c2 === 8232 || c2 === 8233) { - break; - } - indentStart--; - if (c2 !== 9 && c2 !== 11 && c2 !== 12 && c2 !== 32 && c2 !== 160) { - indentEnd = indentStart; - } - } - return str.substring(indentStart, indentEnd); - } - __name(getIndentation, "getIndentation"); - function isFieldType(fieldType) { - if (fieldType) { - return fieldType; - } - } - __name(isFieldType, "isFieldType"); - function uniqueBy(array, iteratee) { - var _a; - const FilteredMap = /* @__PURE__ */new Map(); - const result = []; - for (const item of array) { - if (item.kind === "Field") { - const uniqueValue = iteratee(item); - const existing = FilteredMap.get(uniqueValue); - if ((_a = item.directives) === null || _a === void 0 ? void 0 : _a.length) { - const itemClone = Object.assign({}, item); - result.push(itemClone); - } else if ((existing === null || existing === void 0 ? void 0 : existing.selectionSet) && item.selectionSet) { - existing.selectionSet.selections = [...existing.selectionSet.selections, ...item.selectionSet.selections]; - } else if (!existing) { - const itemClone = Object.assign({}, item); - FilteredMap.set(uniqueValue, itemClone); - result.push(itemClone); - } - } else { - result.push(item); - } - } - return result; - } - __name(uniqueBy, "uniqueBy"); - function inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType) { - var _a; - const selectionSetTypeName = selectionSetType ? (0, _graphql.getNamedType)(selectionSetType).name : null; - const outputSelections = []; - const seenSpreads = []; - for (let selection of selections) { - if (selection.kind === "FragmentSpread") { - const fragmentName = selection.name.value; - if (!selection.directives || selection.directives.length === 0) { - if (seenSpreads.includes(fragmentName)) { - continue; - } else { - seenSpreads.push(fragmentName); - } - } - const fragmentDefinition = fragmentDefinitions[selection.name.value]; - if (fragmentDefinition) { - const { - typeCondition, - directives, - selectionSet - } = fragmentDefinition; - selection = { - kind: _graphql.Kind.INLINE_FRAGMENT, - typeCondition, - directives, - selectionSet - }; - } - } - if (selection.kind === _graphql.Kind.INLINE_FRAGMENT && (!selection.directives || ((_a = selection.directives) === null || _a === void 0 ? void 0 : _a.length) === 0)) { - const fragmentTypeName = selection.typeCondition ? selection.typeCondition.name.value : null; - if (!fragmentTypeName || fragmentTypeName === selectionSetTypeName) { - outputSelections.push(...inlineRelevantFragmentSpreads(fragmentDefinitions, selection.selectionSet.selections, selectionSetType)); - continue; - } - } - outputSelections.push(selection); - } - return outputSelections; - } - __name(inlineRelevantFragmentSpreads, "inlineRelevantFragmentSpreads"); - function mergeAst(documentAST, schema) { - const typeInfo = schema ? new _graphql.TypeInfo(schema) : null; - const fragmentDefinitions = /* @__PURE__ */Object.create(null); - for (const definition of documentAST.definitions) { - if (definition.kind === _graphql.Kind.FRAGMENT_DEFINITION) { - fragmentDefinitions[definition.name.value] = definition; - } - } - const visitors = { - SelectionSet(node) { - const selectionSetType = typeInfo ? typeInfo.getParentType() : null; - let { - selections - } = node; - selections = inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType); - selections = uniqueBy(selections, selection => selection.alias ? selection.alias.value : selection.name.value); - return Object.assign(Object.assign({}, node), { - selections - }); - }, - FragmentDefinition() { - return null; - } - }; - return (0, _graphql.visit)(documentAST, typeInfo ? (0, _graphql.visitWithTypeInfo)(typeInfo, visitors) : visitors); - } - __name(mergeAst, "mergeAst"); - function getSelectedOperationName(prevOperations, prevSelectedOperationName, operations) { - if (!operations || operations.length < 1) { - return; - } - const names = operations.map(op => { - var _a; - return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; - }); - if (prevSelectedOperationName && names.includes(prevSelectedOperationName)) { - return prevSelectedOperationName; - } - if (prevSelectedOperationName && prevOperations) { - const prevNames = prevOperations.map(op => { - var _a; - return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; - }); - const prevIndex = prevNames.indexOf(prevSelectedOperationName); - if (prevIndex !== -1 && prevIndex < names.length) { - return names[prevIndex]; - } - } - return names[0]; - } - __name(getSelectedOperationName, "getSelectedOperationName"); - function isQuotaError(storage, e2) { - return e2 instanceof DOMException && (e2.code === 22 || e2.code === 1014 || e2.name === "QuotaExceededError" || e2.name === "NS_ERROR_DOM_QUOTA_REACHED") && storage.length !== 0; - } - __name(isQuotaError, "isQuotaError"); - class StorageAPI { - constructor(storage) { - if (storage) { - this.storage = storage; - } else if (storage === null) { - this.storage = null; - } else if (typeof window === "undefined") { - this.storage = null; - } else { - this.storage = { - getItem: window.localStorage.getItem.bind(window.localStorage), - setItem: window.localStorage.setItem.bind(window.localStorage), - removeItem: window.localStorage.removeItem.bind(window.localStorage), - get length() { - let keys = 0; - for (const key in window.localStorage) { - if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { - keys += 1; - } - } - return keys; - }, - clear: () => { - for (const key in window.localStorage) { - if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { - window.localStorage.removeItem(key); - } - } - } - }; - } - } - get(name2) { - if (!this.storage) { - return null; - } - const key = `${STORAGE_NAMESPACE}:${name2}`; - const value3 = this.storage.getItem(key); - if (value3 === "null" || value3 === "undefined") { - this.storage.removeItem(key); - return null; - } - return value3 || null; - } - set(name2, value3) { - let quotaError = false; - let error2 = null; - if (this.storage) { - const key = `${STORAGE_NAMESPACE}:${name2}`; - if (value3) { - try { - this.storage.setItem(key, value3); - } catch (e2) { - error2 = e2 instanceof Error ? e2 : new Error(`${e2}`); - quotaError = isQuotaError(this.storage, e2); - } - } else { - this.storage.removeItem(key); - } - } - return { - isQuotaError: quotaError, - error: error2 - }; - } - clear() { - if (this.storage) { - this.storage.clear(); - } - } - } - __name(StorageAPI, "StorageAPI"); - const STORAGE_NAMESPACE = "graphiql"; - class QueryStore { - constructor(key, storage) { - let maxSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - this.key = key; - this.storage = storage; - this.maxSize = maxSize; - this.items = this.fetchAll(); - } - get length() { - return this.items.length; - } - contains(item) { - return this.items.some(x2 => x2.query === item.query && x2.variables === item.variables && x2.headers === item.headers && x2.operationName === item.operationName); - } - edit(item) { - const itemIndex = this.items.findIndex(x2 => x2.query === item.query && x2.variables === item.variables && x2.headers === item.headers && x2.operationName === item.operationName); - if (itemIndex !== -1) { - this.items.splice(itemIndex, 1, item); - this.save(); - } - } - delete(item) { - const itemIndex = this.items.findIndex(x2 => x2.query === item.query && x2.variables === item.variables && x2.headers === item.headers && x2.operationName === item.operationName); - if (itemIndex !== -1) { - this.items.splice(itemIndex, 1); - this.save(); - } - } - fetchRecent() { - return this.items[this.items.length - 1]; - } - fetchAll() { - const raw = this.storage.get(this.key); - if (raw) { - return JSON.parse(raw)[this.key]; - } - return []; - } - push(item) { - const items = [...this.items, item]; - if (this.maxSize && items.length > this.maxSize) { - items.shift(); - } - for (let attempts = 0; attempts < 5; attempts++) { - const response = this.storage.set(this.key, JSON.stringify({ - [this.key]: items - })); - if (!response || !response.error) { - this.items = items; - } else if (response.isQuotaError && this.maxSize) { - items.shift(); - } else { - return; - } - } - } - save() { - this.storage.set(this.key, JSON.stringify({ - [this.key]: this.items - })); - } - } - __name(QueryStore, "QueryStore"); - const MAX_QUERY_SIZE = 1e5; - class HistoryStore { - constructor(storage, maxHistoryLength) { - this.storage = storage; - this.maxHistoryLength = maxHistoryLength; - this.updateHistory = (query, variables, headers, operationName) => { - if (this.shouldSaveQuery(query, variables, headers, this.history.fetchRecent())) { - this.history.push({ - query, - variables, - headers, - operationName - }); - const historyQueries = this.history.items; - const favoriteQueries = this.favorite.items; - this.queries = historyQueries.concat(favoriteQueries); - } - }; - this.history = new QueryStore("queries", this.storage, this.maxHistoryLength); - this.favorite = new QueryStore("favorites", this.storage, null); - this.queries = [...this.history.fetchAll(), ...this.favorite.fetchAll()]; - } - shouldSaveQuery(query, variables, headers, lastQuerySaved) { - if (!query) { - return false; - } - try { - (0, _graphql.parse)(query); - } catch (_a) { - return false; - } - if (query.length > MAX_QUERY_SIZE) { - return false; - } - if (!lastQuerySaved) { - return true; - } - if (JSON.stringify(query) === JSON.stringify(lastQuerySaved.query)) { - if (JSON.stringify(variables) === JSON.stringify(lastQuerySaved.variables)) { - if (JSON.stringify(headers) === JSON.stringify(lastQuerySaved.headers)) { - return false; - } - if (headers && !lastQuerySaved.headers) { - return false; - } - } - if (variables && !lastQuerySaved.variables) { - return false; - } - } - return true; - } - toggleFavorite(query, variables, headers, operationName, label, favorite) { - const item = { - query, - variables, - headers, - operationName, - label - }; - if (!this.favorite.contains(item)) { - item.favorite = true; - this.favorite.push(item); - } else if (favorite) { - item.favorite = false; - this.favorite.delete(item); - } - this.queries = [...this.history.items, ...this.favorite.items]; - } - editLabel(query, variables, headers, operationName, label, favorite) { - const item = { - query, - variables, - headers, - operationName, - label - }; - if (favorite) { - this.favorite.edit(Object.assign(Object.assign({}, item), { - favorite - })); - } else { - this.history.edit(item); - } - this.queries = [...this.history.items, ...this.favorite.items]; - } - } - __name(HistoryStore, "HistoryStore"); - var __defProp$G = Object.defineProperty; - var __name$G = /* @__PURE__ */__name((target2, value3) => __defProp$G(target2, "name", { - value: value3, - configurable: true - }), "__name$G"); - function createNullableContext(name2) { - const context = /*#__PURE__*/(0, React.createContext)(null); - context.displayName = name2; - return context; - } - __name(createNullableContext, "createNullableContext"); - __name$G(createNullableContext, "createNullableContext"); - function createContextHook(context) { - function useGivenContext(options) { - var _a; - const value3 = (0, React.useContext)(context); - if (value3 === null && (options == null ? void 0 : options.nonNull)) { - throw new Error(`Tried to use \`${((_a = options.caller) == null ? void 0 : _a.name) || useGivenContext.caller.name}\` without the necessary context. Make sure to render the \`${context.displayName}Provider\` component higher up the tree.`); - } - return value3; - } - __name(useGivenContext, "useGivenContext"); - __name$G(useGivenContext, "useGivenContext"); - Object.defineProperty(useGivenContext, "name", { - value: `use${context.displayName}` - }); - return useGivenContext; - } - __name(createContextHook, "createContextHook"); - __name$G(createContextHook, "createContextHook"); - var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof self !== "undefined" ? self : {}; - _exports.c = commonjsGlobal; - function getDefaultExportFromCjs(x2) { - return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; - } - __name(getDefaultExportFromCjs, "getDefaultExportFromCjs"); - function getAugmentedNamespace(n2) { - if (n2.__esModule) return n2; - var a2 = Object.defineProperty({}, "__esModule", { - value: true - }); - Object.keys(n2).forEach(function (k2) { - var d2 = Object.getOwnPropertyDescriptor(n2, k2); - Object.defineProperty(a2, k2, d2.get ? d2 : { - enumerable: true, - get: function () { - return n2[k2]; - } - }); - }); - return a2; - } - __name(getAugmentedNamespace, "getAugmentedNamespace"); - var jsxRuntime = { - exports: {} - }; - var reactJsxRuntime_production_min = {}; - /* - object-assign - (c) Sindre Sorhus - @license MIT - */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - function toObject(val) { - if (val === null || val === void 0) { - throw new TypeError("Object.assign cannot be called with null or undefined"); - } - return Object(val); - } - __name(toObject, "toObject"); - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - var test1 = new String("abc"); - test1[5] = "de"; - if (Object.getOwnPropertyNames(test1)[0] === "5") { - return false; - } - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2["_" + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n2) { - return test2[n2]; - }); - if (order2.join("") !== "0123456789") { - return false; - } - var test3 = {}; - "abcdefghijklmnopqrst".split("").forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { - return false; - } - return true; - } catch (err) { - return false; - } - } - __name(shouldUseNative, "shouldUseNative"); - shouldUseNative() ? Object.assign : function (target2, source) { - var from; - var to = toObject(target2); - var symbols; - for (var s2 = 1; s2 < arguments.length; s2++) { - from = Object(arguments[s2]); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - return to; - }; - /** @license React v17.0.2 - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var f$2 = React.default, - g$1 = 60103; - reactJsxRuntime_production_min.Fragment = 60107; - if (typeof Symbol === "function" && Symbol.for) { - var h$1 = Symbol.for; - g$1 = h$1("react.element"); - reactJsxRuntime_production_min.Fragment = h$1("react.fragment"); - } - var m$1 = f$2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, - n$2 = Object.prototype.hasOwnProperty, - p$2 = { - key: true, - ref: true, - __self: true, - __source: true - }; - function q$1(c2, a2, k2) { - var b2, - d2 = {}, - e2 = null, - l2 = null; - k2 !== void 0 && (e2 = "" + k2); - a2.key !== void 0 && (e2 = "" + a2.key); - a2.ref !== void 0 && (l2 = a2.ref); - for (b2 in a2) n$2.call(a2, b2) && !p$2.hasOwnProperty(b2) && (d2[b2] = a2[b2]); - if (c2 && c2.defaultProps) for (b2 in a2 = c2.defaultProps, a2) d2[b2] === void 0 && (d2[b2] = a2[b2]); - return { - $$typeof: g$1, - type: c2, - key: e2, - ref: l2, - props: d2, - _owner: m$1.current - }; - } - __name(q$1, "q$1"); - reactJsxRuntime_production_min.jsx = q$1; - reactJsxRuntime_production_min.jsxs = q$1; - { - jsxRuntime.exports = reactJsxRuntime_production_min; - } - const jsx = jsxRuntime.exports.jsx; - const jsxs = jsxRuntime.exports.jsxs; - const Fragment = jsxRuntime.exports.Fragment; - var __defProp$F = Object.defineProperty; - var __name$F = /* @__PURE__ */__name((target2, value3) => __defProp$F(target2, "name", { - value: value3, - configurable: true - }), "__name$F"); - const StorageContext = createNullableContext("StorageContext"); - _exports.a7 = StorageContext; - function StorageContextProvider(props2) { - const isInitialRender = (0, React.useRef)(true); - const [storage, setStorage] = (0, React.useState)(new StorageAPI(props2.storage)); - (0, React.useEffect)(() => { - if (isInitialRender.current) { - isInitialRender.current = false; - } else { - setStorage(new StorageAPI(props2.storage)); - } - }, [props2.storage]); - return /* @__PURE__ */jsx(StorageContext.Provider, { - value: storage, - children: props2.children - }); - } - __name(StorageContextProvider, "StorageContextProvider"); - __name$F(StorageContextProvider, "StorageContextProvider"); - const useStorageContext = createContextHook(StorageContext); - _exports.a9 = useStorageContext; - const MAX_ARRAY_LENGTH = 10; - const MAX_RECURSIVE_DEPTH = 2; - function inspect(value3) { - return formatValue(value3, []); - } - __name(inspect, "inspect"); - function formatValue(value3, seenValues) { - switch (typeof value3) { - case "string": - return JSON.stringify(value3); - case "function": - return value3.name ? `[function ${value3.name}]` : "[function]"; - case "object": - return formatObjectValue(value3, seenValues); - default: - return String(value3); - } - } - __name(formatValue, "formatValue"); - function formatObjectValue(value3, previouslySeenValues) { - if (value3 === null) { - return "null"; - } - if (previouslySeenValues.includes(value3)) { - return "[Circular]"; - } - const seenValues = [...previouslySeenValues, value3]; - if (isJSONable(value3)) { - const jsonValue = value3.toJSON(); - if (jsonValue !== value3) { - return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues); - } - } else if (Array.isArray(value3)) { - return formatArray(value3, seenValues); - } - return formatObject(value3, seenValues); - } - __name(formatObjectValue, "formatObjectValue"); - function isJSONable(value3) { - return typeof value3.toJSON === "function"; - } - __name(isJSONable, "isJSONable"); - function formatObject(object, seenValues) { - const entries = Object.entries(object); - if (entries.length === 0) { - return "{}"; - } - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return "[" + getObjectTag(object) + "]"; - } - const properties = entries.map(_ref10 => { - let [key, value3] = _ref10; - return key + ": " + formatValue(value3, seenValues); - }); - return "{ " + properties.join(", ") + " }"; - } - __name(formatObject, "formatObject"); - function formatArray(array, seenValues) { - if (array.length === 0) { - return "[]"; - } - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return "[Array]"; - } - const len = Math.min(MAX_ARRAY_LENGTH, array.length); - const remaining = array.length - len; - const items = []; - for (let i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - if (remaining === 1) { - items.push("... 1 more item"); - } else if (remaining > 1) { - items.push(`... ${remaining} more items`); - } - return "[" + items.join(", ") + "]"; - } - __name(formatArray, "formatArray"); - function getObjectTag(object) { - const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, ""); - if (tag === "Object" && typeof object.constructor === "function") { - const name2 = object.constructor.name; - if (typeof name2 === "string" && name2 !== "") { - return name2; - } - } - return tag; - } - __name(getObjectTag, "getObjectTag"); - function invariant(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error(message != null ? message : "Unexpected invariant triggered."); - } - } - __name(invariant, "invariant"); - let DirectiveLocation; - (function (DirectiveLocation2) { - DirectiveLocation2["QUERY"] = "QUERY"; - DirectiveLocation2["MUTATION"] = "MUTATION"; - DirectiveLocation2["SUBSCRIPTION"] = "SUBSCRIPTION"; - DirectiveLocation2["FIELD"] = "FIELD"; - DirectiveLocation2["FRAGMENT_DEFINITION"] = "FRAGMENT_DEFINITION"; - DirectiveLocation2["FRAGMENT_SPREAD"] = "FRAGMENT_SPREAD"; - DirectiveLocation2["INLINE_FRAGMENT"] = "INLINE_FRAGMENT"; - DirectiveLocation2["VARIABLE_DEFINITION"] = "VARIABLE_DEFINITION"; - DirectiveLocation2["SCHEMA"] = "SCHEMA"; - DirectiveLocation2["SCALAR"] = "SCALAR"; - DirectiveLocation2["OBJECT"] = "OBJECT"; - DirectiveLocation2["FIELD_DEFINITION"] = "FIELD_DEFINITION"; - DirectiveLocation2["ARGUMENT_DEFINITION"] = "ARGUMENT_DEFINITION"; - DirectiveLocation2["INTERFACE"] = "INTERFACE"; - DirectiveLocation2["UNION"] = "UNION"; - DirectiveLocation2["ENUM"] = "ENUM"; - DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE"; - DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT"; - DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION"; - })(DirectiveLocation || (DirectiveLocation = {})); - function isWhiteSpace$2(code3) { - return code3 === 9 || code3 === 32; - } - __name(isWhiteSpace$2, "isWhiteSpace$2"); - function isDigit$1(code3) { - return code3 >= 48 && code3 <= 57; - } - __name(isDigit$1, "isDigit$1"); - function isLetter$1(code3) { - return code3 >= 97 && code3 <= 122 || code3 >= 65 && code3 <= 90; - } - __name(isLetter$1, "isLetter$1"); - function isNameStart(code3) { - return isLetter$1(code3) || code3 === 95; - } - __name(isNameStart, "isNameStart"); - function isNameContinue(code3) { - return isLetter$1(code3) || isDigit$1(code3) || code3 === 95; - } - __name(isNameContinue, "isNameContinue"); - function printBlockString(value3, options) { - const escapedValue = value3.replace(/"""/g, '\\"""'); - const lines = escapedValue.split(/\r\n|[\n\r]/g); - const isSingleLine = lines.length === 1; - const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every(line => line.length === 0 || isWhiteSpace$2(line.charCodeAt(0))); - const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); - const hasTrailingQuote = value3.endsWith('"') && !hasTrailingTripleQuotes; - const hasTrailingSlash = value3.endsWith("\\"); - const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; - const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && (!isSingleLine || value3.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes); - let result = ""; - const skipLeadingNewLine = isSingleLine && isWhiteSpace$2(value3.charCodeAt(0)); - if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) { - result += "\n"; - } - result += escapedValue; - if (printAsMultipleLines || forceTrailingNewline) { - result += "\n"; - } - return '"""' + result + '"""'; - } - __name(printBlockString, "printBlockString"); - function printString(str) { - return `"${str.replace(escapedRegExp, escapedReplacer)}"`; - } - __name(printString, "printString"); - const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; - function escapedReplacer(str) { - return escapeSequences[str.charCodeAt(0)]; - } - __name(escapedReplacer, "escapedReplacer"); - const escapeSequences = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000B", "\\f", "\\r", "\\u000E", "\\u000F", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001A", "\\u001B", "\\u001C", "\\u001D", "\\u001E", "\\u001F", "", "", '\\"', "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\\\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\\u007F", "\\u0080", "\\u0081", "\\u0082", "\\u0083", "\\u0084", "\\u0085", "\\u0086", "\\u0087", "\\u0088", "\\u0089", "\\u008A", "\\u008B", "\\u008C", "\\u008D", "\\u008E", "\\u008F", "\\u0090", "\\u0091", "\\u0092", "\\u0093", "\\u0094", "\\u0095", "\\u0096", "\\u0097", "\\u0098", "\\u0099", "\\u009A", "\\u009B", "\\u009C", "\\u009D", "\\u009E", "\\u009F"]; - function devAssert(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error(message); - } - } - __name(devAssert, "devAssert"); - const QueryDocumentKeys = { - Name: [], - Document: ["definitions"], - OperationDefinition: ["name", "variableDefinitions", "directives", "selectionSet"], - VariableDefinition: ["variable", "type", "defaultValue", "directives"], - Variable: ["name"], - SelectionSet: ["selections"], - Field: ["alias", "name", "arguments", "directives", "selectionSet"], - Argument: ["name", "value"], - FragmentSpread: ["name", "directives"], - InlineFragment: ["typeCondition", "directives", "selectionSet"], - FragmentDefinition: ["name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], - IntValue: [], - FloatValue: [], - StringValue: [], - BooleanValue: [], - NullValue: [], - EnumValue: [], - ListValue: ["values"], - ObjectValue: ["fields"], - ObjectField: ["name", "value"], - Directive: ["name", "arguments"], - NamedType: ["name"], - ListType: ["type"], - NonNullType: ["type"], - SchemaDefinition: ["description", "directives", "operationTypes"], - OperationTypeDefinition: ["type"], - ScalarTypeDefinition: ["description", "name", "directives"], - ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], - FieldDefinition: ["description", "name", "arguments", "type", "directives"], - InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], - InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], - UnionTypeDefinition: ["description", "name", "directives", "types"], - EnumTypeDefinition: ["description", "name", "directives", "values"], - EnumValueDefinition: ["description", "name", "directives"], - InputObjectTypeDefinition: ["description", "name", "directives", "fields"], - DirectiveDefinition: ["description", "name", "arguments", "locations"], - SchemaExtension: ["directives", "operationTypes"], - ScalarTypeExtension: ["name", "directives"], - ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], - InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], - UnionTypeExtension: ["name", "directives", "types"], - EnumTypeExtension: ["name", "directives", "values"], - InputObjectTypeExtension: ["name", "directives", "fields"] - }; - const kindValues = new Set(Object.keys(QueryDocumentKeys)); - function isNode(maybeNode) { - const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind; - return typeof maybeKind === "string" && kindValues.has(maybeKind); - } - __name(isNode, "isNode"); - let OperationTypeNode; - (function (OperationTypeNode2) { - OperationTypeNode2["QUERY"] = "query"; - OperationTypeNode2["MUTATION"] = "mutation"; - OperationTypeNode2["SUBSCRIPTION"] = "subscription"; - })(OperationTypeNode || (OperationTypeNode = {})); - let Kind; - (function (Kind2) { - Kind2["NAME"] = "Name"; - Kind2["DOCUMENT"] = "Document"; - Kind2["OPERATION_DEFINITION"] = "OperationDefinition"; - Kind2["VARIABLE_DEFINITION"] = "VariableDefinition"; - Kind2["SELECTION_SET"] = "SelectionSet"; - Kind2["FIELD"] = "Field"; - Kind2["ARGUMENT"] = "Argument"; - Kind2["FRAGMENT_SPREAD"] = "FragmentSpread"; - Kind2["INLINE_FRAGMENT"] = "InlineFragment"; - Kind2["FRAGMENT_DEFINITION"] = "FragmentDefinition"; - Kind2["VARIABLE"] = "Variable"; - Kind2["INT"] = "IntValue"; - Kind2["FLOAT"] = "FloatValue"; - Kind2["STRING"] = "StringValue"; - Kind2["BOOLEAN"] = "BooleanValue"; - Kind2["NULL"] = "NullValue"; - Kind2["ENUM"] = "EnumValue"; - Kind2["LIST"] = "ListValue"; - Kind2["OBJECT"] = "ObjectValue"; - Kind2["OBJECT_FIELD"] = "ObjectField"; - Kind2["DIRECTIVE"] = "Directive"; - Kind2["NAMED_TYPE"] = "NamedType"; - Kind2["LIST_TYPE"] = "ListType"; - Kind2["NON_NULL_TYPE"] = "NonNullType"; - Kind2["SCHEMA_DEFINITION"] = "SchemaDefinition"; - Kind2["OPERATION_TYPE_DEFINITION"] = "OperationTypeDefinition"; - Kind2["SCALAR_TYPE_DEFINITION"] = "ScalarTypeDefinition"; - Kind2["OBJECT_TYPE_DEFINITION"] = "ObjectTypeDefinition"; - Kind2["FIELD_DEFINITION"] = "FieldDefinition"; - Kind2["INPUT_VALUE_DEFINITION"] = "InputValueDefinition"; - Kind2["INTERFACE_TYPE_DEFINITION"] = "InterfaceTypeDefinition"; - Kind2["UNION_TYPE_DEFINITION"] = "UnionTypeDefinition"; - Kind2["ENUM_TYPE_DEFINITION"] = "EnumTypeDefinition"; - Kind2["ENUM_VALUE_DEFINITION"] = "EnumValueDefinition"; - Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition"; - Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition"; - Kind2["SCHEMA_EXTENSION"] = "SchemaExtension"; - Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension"; - Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension"; - Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension"; - Kind2["UNION_TYPE_EXTENSION"] = "UnionTypeExtension"; - Kind2["ENUM_TYPE_EXTENSION"] = "EnumTypeExtension"; - Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension"; - })(Kind || (Kind = {})); - const BREAK = Object.freeze({}); - function visit(root2, visitor) { - let visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; - const enterLeaveMap = /* @__PURE__ */new Map(); - for (const kind of Object.values(Kind)) { - enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); - } - let stack = void 0; - let inArray = Array.isArray(root2); - let keys = [root2]; - let index = -1; - let edits = []; - let node = root2; - let key = void 0; - let parent = void 0; - const path = []; - const ancestors = []; - do { - index++; - const isLeaving = index === keys.length; - const isEdited = isLeaving && edits.length !== 0; - if (isLeaving) { - key = ancestors.length === 0 ? void 0 : path[path.length - 1]; - node = parent; - parent = ancestors.pop(); - if (isEdited) { - if (inArray) { - node = node.slice(); - let editOffset = 0; - for (const [editKey, editValue] of edits) { - const arrayKey = editKey - editOffset; - if (editValue === null) { - node.splice(arrayKey, 1); - editOffset++; - } else { - node[arrayKey] = editValue; - } - } - } else { - node = Object.defineProperties({}, Object.getOwnPropertyDescriptors(node)); - for (const [editKey, editValue] of edits) { - node[editKey] = editValue; - } - } - } - index = stack.index; - keys = stack.keys; - edits = stack.edits; - inArray = stack.inArray; - stack = stack.prev; - } else if (parent) { - key = inArray ? index : keys[index]; - node = parent[key]; - if (node === null || node === void 0) { - continue; - } - path.push(key); - } - let result; - if (!Array.isArray(node)) { - var _enterLeaveMap$get, _enterLeaveMap$get2; - isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`); - const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter; - result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors); - if (result === BREAK) { - break; - } - if (result === false) { - if (!isLeaving) { - path.pop(); - continue; - } - } else if (result !== void 0) { - edits.push([key, result]); - if (!isLeaving) { - if (isNode(result)) { - node = result; - } else { - path.pop(); - continue; - } - } - } - } - if (result === void 0 && isEdited) { - edits.push([key, node]); - } - if (isLeaving) { - path.pop(); - } else { - var _node$kind; - stack = { - inArray, - index, - keys, - edits, - prev: stack - }; - inArray = Array.isArray(node); - keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : []; - index = -1; - edits = []; - if (parent) { - ancestors.push(parent); - } - parent = node; - } - } while (stack !== void 0); - if (edits.length !== 0) { - return edits[edits.length - 1][1]; - } - return root2; - } - __name(visit, "visit"); - function getEnterLeaveForKind(visitor, kind) { - const kindVisitor = visitor[kind]; - if (typeof kindVisitor === "object") { - return kindVisitor; - } else if (typeof kindVisitor === "function") { - return { - enter: kindVisitor, - leave: void 0 - }; - } - return { - enter: visitor.enter, - leave: visitor.leave - }; - } - __name(getEnterLeaveForKind, "getEnterLeaveForKind"); - function print(ast2) { - return visit(ast2, printDocASTReducer); - } - __name(print, "print"); - const MAX_LINE_LENGTH = 80; - const printDocASTReducer = { - Name: { - leave: node => node.value - }, - Variable: { - leave: node => "$" + node.name - }, - Document: { - leave: node => join(node.definitions, "\n\n") - }, - OperationDefinition: { - leave(node) { - const varDefs = wrap("(", join(node.variableDefinitions, ", "), ")"); - const prefix = join([node.operation, join([node.name, varDefs]), join(node.directives, " ")], " "); - return (prefix === "query" ? "" : prefix + " ") + node.selectionSet; - } - }, - VariableDefinition: { - leave: _ref12 => { - let { - variable, - type: type2, - defaultValue: defaultValue2, - directives - } = _ref12; - return variable + ": " + type2 + wrap(" = ", defaultValue2) + wrap(" ", join(directives, " ")); - } - }, - SelectionSet: { - leave: _ref13 => { - let { - selections - } = _ref13; - return block$2(selections); - } - }, - Field: { - leave(_ref14) { - let { - alias, - name: name2, - arguments: args, - directives, - selectionSet - } = _ref14; - const prefix = wrap("", alias, ": ") + name2; - let argsLine = prefix + wrap("(", join(args, ", "), ")"); - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)"); - } - return join([argsLine, join(directives, " "), selectionSet], " "); - } - }, - Argument: { - leave: _ref15 => { - let { - name: name2, - value: value3 - } = _ref15; - return name2 + ": " + value3; - } - }, - FragmentSpread: { - leave: _ref16 => { - let { - name: name2, - directives - } = _ref16; - return "..." + name2 + wrap(" ", join(directives, " ")); - } - }, - InlineFragment: { - leave: _ref17 => { - let { - typeCondition, - directives, - selectionSet - } = _ref17; - return join(["...", wrap("on ", typeCondition), join(directives, " "), selectionSet], " "); - } - }, - FragmentDefinition: { - leave: _ref18 => { - let { - name: name2, - typeCondition, - variableDefinitions, - directives, - selectionSet - } = _ref18; - return `fragment ${name2}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet; - } - }, - IntValue: { - leave: _ref19 => { - let { - value: value3 - } = _ref19; - return value3; - } - }, - FloatValue: { - leave: _ref20 => { - let { - value: value3 - } = _ref20; - return value3; - } - }, - StringValue: { - leave: _ref21 => { - let { - value: value3, - block: isBlockString - } = _ref21; - return isBlockString ? printBlockString(value3) : printString(value3); - } - }, - BooleanValue: { - leave: _ref23 => { - let { - value: value3 - } = _ref23; - return value3 ? "true" : "false"; - } - }, - NullValue: { - leave: () => "null" - }, - EnumValue: { - leave: _ref24 => { - let { - value: value3 - } = _ref24; - return value3; - } - }, - ListValue: { - leave: _ref25 => { - let { - values - } = _ref25; - return "[" + join(values, ", ") + "]"; - } - }, - ObjectValue: { - leave: _ref26 => { - let { - fields - } = _ref26; - return "{" + join(fields, ", ") + "}"; - } - }, - ObjectField: { - leave: _ref27 => { - let { - name: name2, - value: value3 - } = _ref27; - return name2 + ": " + value3; - } - }, - Directive: { - leave: _ref28 => { - let { - name: name2, - arguments: args - } = _ref28; - return "@" + name2 + wrap("(", join(args, ", "), ")"); - } - }, - NamedType: { - leave: _ref29 => { - let { - name: name2 - } = _ref29; - return name2; - } - }, - ListType: { - leave: _ref30 => { - let { - type: type2 - } = _ref30; - return "[" + type2 + "]"; - } - }, - NonNullType: { - leave: _ref31 => { - let { - type: type2 - } = _ref31; - return type2 + "!"; - } - }, - SchemaDefinition: { - leave: _ref32 => { - let { - description, - directives, - operationTypes - } = _ref32; - return wrap("", description, "\n") + join(["schema", join(directives, " "), block$2(operationTypes)], " "); - } - }, - OperationTypeDefinition: { - leave: _ref33 => { - let { - operation, - type: type2 - } = _ref33; - return operation + ": " + type2; - } - }, - ScalarTypeDefinition: { - leave: _ref34 => { - let { - description, - name: name2, - directives - } = _ref34; - return wrap("", description, "\n") + join(["scalar", name2, join(directives, " ")], " "); - } - }, - ObjectTypeDefinition: { - leave: _ref35 => { - let { - description, - name: name2, - interfaces, - directives, - fields - } = _ref35; - return wrap("", description, "\n") + join(["type", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block$2(fields)], " "); - } - }, - FieldDefinition: { - leave: _ref36 => { - let { - description, - name: name2, - arguments: args, - type: type2, - directives - } = _ref36; - return wrap("", description, "\n") + name2 + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type2 + wrap(" ", join(directives, " ")); - } - }, - InputValueDefinition: { - leave: _ref37 => { - let { - description, - name: name2, - type: type2, - defaultValue: defaultValue2, - directives - } = _ref37; - return wrap("", description, "\n") + join([name2 + ": " + type2, wrap("= ", defaultValue2), join(directives, " ")], " "); - } - }, - InterfaceTypeDefinition: { - leave: _ref38 => { - let { - description, - name: name2, - interfaces, - directives, - fields - } = _ref38; - return wrap("", description, "\n") + join(["interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block$2(fields)], " "); - } - }, - UnionTypeDefinition: { - leave: _ref39 => { - let { - description, - name: name2, - directives, - types - } = _ref39; - return wrap("", description, "\n") + join(["union", name2, join(directives, " "), wrap("= ", join(types, " | "))], " "); - } - }, - EnumTypeDefinition: { - leave: _ref40 => { - let { - description, - name: name2, - directives, - values - } = _ref40; - return wrap("", description, "\n") + join(["enum", name2, join(directives, " "), block$2(values)], " "); - } - }, - EnumValueDefinition: { - leave: _ref41 => { - let { - description, - name: name2, - directives - } = _ref41; - return wrap("", description, "\n") + join([name2, join(directives, " ")], " "); - } - }, - InputObjectTypeDefinition: { - leave: _ref42 => { - let { - description, - name: name2, - directives, - fields - } = _ref42; - return wrap("", description, "\n") + join(["input", name2, join(directives, " "), block$2(fields)], " "); - } - }, - DirectiveDefinition: { - leave: _ref43 => { - let { - description, - name: name2, - arguments: args, - repeatable, - locations - } = _ref43; - return wrap("", description, "\n") + "directive @" + name2 + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | "); - } - }, - SchemaExtension: { - leave: _ref44 => { - let { - directives, - operationTypes - } = _ref44; - return join(["extend schema", join(directives, " "), block$2(operationTypes)], " "); - } - }, - ScalarTypeExtension: { - leave: _ref45 => { - let { - name: name2, - directives - } = _ref45; - return join(["extend scalar", name2, join(directives, " ")], " "); - } - }, - ObjectTypeExtension: { - leave: _ref46 => { - let { - name: name2, - interfaces, - directives, - fields - } = _ref46; - return join(["extend type", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block$2(fields)], " "); - } - }, - InterfaceTypeExtension: { - leave: _ref47 => { - let { - name: name2, - interfaces, - directives, - fields - } = _ref47; - return join(["extend interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block$2(fields)], " "); - } - }, - UnionTypeExtension: { - leave: _ref48 => { - let { - name: name2, - directives, - types - } = _ref48; - return join(["extend union", name2, join(directives, " "), wrap("= ", join(types, " | "))], " "); - } - }, - EnumTypeExtension: { - leave: _ref49 => { - let { - name: name2, - directives, - values - } = _ref49; - return join(["extend enum", name2, join(directives, " "), block$2(values)], " "); - } - }, - InputObjectTypeExtension: { - leave: _ref50 => { - let { - name: name2, - directives, - fields - } = _ref50; - return join(["extend input", name2, join(directives, " "), block$2(fields)], " "); - } - } - }; - function join(maybeArray) { - let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; - var _maybeArray$filter$jo; - return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(x2 => x2).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ""; - } - __name(join, "join"); - function block$2(array) { - return wrap("{\n", indent(join(array, "\n")), "\n}"); - } - __name(block$2, "block$2"); - function wrap(start, maybeString) { - let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; - return maybeString != null && maybeString !== "" ? start + maybeString + end : ""; - } - __name(wrap, "wrap"); - function indent(str) { - return wrap(" ", str.replace(/\n/g, "\n ")); - } - __name(indent, "indent"); - function hasMultilineItems(maybeArray) { - var _maybeArray$some; - return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some(str => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false; - } - __name(hasMultilineItems, "hasMultilineItems"); - function isIterableObject(maybeIterable) { - return typeof maybeIterable === "object" && typeof (maybeIterable === null || maybeIterable === void 0 ? void 0 : maybeIterable[Symbol.iterator]) === "function"; - } - __name(isIterableObject, "isIterableObject"); - function isObjectLike(value3) { - return typeof value3 == "object" && value3 !== null; - } - __name(isObjectLike, "isObjectLike"); - const MAX_SUGGESTIONS = 5; - function didYouMean(firstArg, secondArg) { - const [subMessage, suggestionsArg] = secondArg ? [firstArg, secondArg] : [void 0, firstArg]; - let message = " Did you mean "; - if (subMessage) { - message += subMessage + " "; - } - const suggestions = suggestionsArg.map(x2 => `"${x2}"`); - switch (suggestions.length) { - case 0: - return ""; - case 1: - return message + suggestions[0] + "?"; - case 2: - return message + suggestions[0] + " or " + suggestions[1] + "?"; - } - const selected = suggestions.slice(0, MAX_SUGGESTIONS); - const lastItem = selected.pop(); - return message + selected.join(", ") + ", or " + lastItem + "?"; - } - __name(didYouMean, "didYouMean"); - function identityFunc(x2) { - return x2; - } - __name(identityFunc, "identityFunc"); - const instanceOf = /* @__PURE__ */__name(function instanceOf2(value3, constructor) { - return value3 instanceof constructor; - }, "instanceOf"); - function keyMap(list3, keyFn) { - const result = /* @__PURE__ */Object.create(null); - for (const item of list3) { - result[keyFn(item)] = item; - } - return result; - } - __name(keyMap, "keyMap"); - function keyValMap(list3, keyFn, valFn) { - const result = /* @__PURE__ */Object.create(null); - for (const item of list3) { - result[keyFn(item)] = valFn(item); - } - return result; - } - __name(keyValMap, "keyValMap"); - function mapValue(map2, fn) { - const result = /* @__PURE__ */Object.create(null); - for (const key of Object.keys(map2)) { - result[key] = fn(map2[key], key); - } - return result; - } - __name(mapValue, "mapValue"); - function naturalCompare(aStr, bStr) { - let aIndex = 0; - let bIndex = 0; - while (aIndex < aStr.length && bIndex < bStr.length) { - let aChar = aStr.charCodeAt(aIndex); - let bChar = bStr.charCodeAt(bIndex); - if (isDigit(aChar) && isDigit(bChar)) { - let aNum = 0; - do { - ++aIndex; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIndex); - } while (isDigit(aChar) && aNum > 0); - let bNum = 0; - do { - ++bIndex; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIndex); - } while (isDigit(bChar) && bNum > 0); - if (aNum < bNum) { - return -1; - } - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - if (aChar > bChar) { - return 1; - } - ++aIndex; - ++bIndex; - } - } - return aStr.length - bStr.length; - } - __name(naturalCompare, "naturalCompare"); - const DIGIT_0 = 48; - const DIGIT_9 = 57; - function isDigit(code3) { - return !isNaN(code3) && DIGIT_0 <= code3 && code3 <= DIGIT_9; - } - __name(isDigit, "isDigit"); - function suggestionList(input, options) { - const optionsByDistance = /* @__PURE__ */Object.create(null); - const lexicalDistance2 = new LexicalDistance(input); - const threshold = Math.floor(input.length * 0.4) + 1; - for (const option of options) { - const distance = lexicalDistance2.measure(option, threshold); - if (distance !== void 0) { - optionsByDistance[option] = distance; - } - } - return Object.keys(optionsByDistance).sort((a2, b2) => { - const distanceDiff = optionsByDistance[a2] - optionsByDistance[b2]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a2, b2); - }); - } - __name(suggestionList, "suggestionList"); - class LexicalDistance { - constructor(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - measure(option, threshold) { - if (this._input === option) { - return 0; - } - const optionLowerCase = option.toLowerCase(); - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - let a2 = stringToArray(optionLowerCase); - let b2 = this._inputArray; - if (a2.length < b2.length) { - const tmp = a2; - a2 = b2; - b2 = tmp; - } - const aLength = a2.length; - const bLength = b2.length; - if (aLength - bLength > threshold) { - return void 0; - } - const rows = this._rows; - for (let j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - for (let i = 1; i <= aLength; i++) { - const upRow = rows[(i - 1) % 3]; - const currentRow = rows[i % 3]; - let smallestCell = currentRow[0] = i; - for (let j = 1; j <= bLength; j++) { - const cost = a2[i - 1] === b2[j - 1] ? 0 : 1; - let currentCell = Math.min(upRow[j] + 1, currentRow[j - 1] + 1, upRow[j - 1] + cost); - if (i > 1 && j > 1 && a2[i - 1] === b2[j - 2] && a2[i - 2] === b2[j - 1]) { - const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - currentRow[j] = currentCell; - } - if (smallestCell > threshold) { - return void 0; - } - } - const distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : void 0; - } - } - __name(LexicalDistance, "LexicalDistance"); - function stringToArray(str) { - const strLength = str.length; - const array = new Array(strLength); - for (let i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - return array; - } - __name(stringToArray, "stringToArray"); - function toObjMap(obj) { - if (obj == null) { - return /* @__PURE__ */Object.create(null); - } - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - const map2 = /* @__PURE__ */Object.create(null); - for (const [key, value3] of Object.entries(obj)) { - map2[key] = value3; - } - return map2; - } - __name(toObjMap, "toObjMap"); - const LineRegExp = /\r\n|[\n\r]/g; - function getLocation(source, position) { - let lastLineStart = 0; - let line = 1; - for (const match2 of source.body.matchAll(LineRegExp)) { - typeof match2.index === "number" || invariant(false); - if (match2.index >= position) { - break; - } - lastLineStart = match2.index + match2[0].length; - line += 1; - } - return { - line, - column: position + 1 - lastLineStart - }; - } - __name(getLocation, "getLocation"); - function printLocation(location) { - return printSourceLocation(location.source, getLocation(location.source, location.start)); - } - __name(printLocation, "printLocation"); - function printSourceLocation(source, sourceLocation) { - const firstLineColumnOffset = source.locationOffset.column - 1; - const body = "".padStart(firstLineColumnOffset) + source.body; - const lineIndex = sourceLocation.line - 1; - const lineOffset = source.locationOffset.line - 1; - const lineNum = sourceLocation.line + lineOffset; - const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; - const columnNum = sourceLocation.column + columnOffset; - const locationStr = `${source.name}:${lineNum}:${columnNum} -`; - const lines = body.split(/\r\n|[\n\r]/g); - const locationLine = lines[lineIndex]; - if (locationLine.length > 120) { - const subLineIndex = Math.floor(columnNum / 80); - const subLineColumnNum = columnNum % 80; - const subLines = []; - for (let i = 0; i < locationLine.length; i += 80) { - subLines.push(locationLine.slice(i, i + 80)); - } - return locationStr + printPrefixedLines([[`${lineNum} |`, subLines[0]], ...subLines.slice(1, subLineIndex + 1).map(subLine => ["|", subLine]), ["|", "^".padStart(subLineColumnNum)], ["|", subLines[subLineIndex + 1]]]); - } - return locationStr + printPrefixedLines([[`${lineNum - 1} |`, lines[lineIndex - 1]], [`${lineNum} |`, locationLine], ["|", "^".padStart(columnNum)], [`${lineNum + 1} |`, lines[lineIndex + 1]]]); - } - __name(printSourceLocation, "printSourceLocation"); - function printPrefixedLines(lines) { - const existingLines = lines.filter(_ref51 => { - let [_, line] = _ref51; - return line !== void 0; - }); - const padLen = Math.max(...existingLines.map(_ref52 => { - let [prefix] = _ref52; - return prefix.length; - })); - return existingLines.map(_ref53 => { - let [prefix, line] = _ref53; - return prefix.padStart(padLen) + (line ? " " + line : ""); - }).join("\n"); - } - __name(printPrefixedLines, "printPrefixedLines"); - function toNormalizedOptions(args) { - const firstArg = args[0]; - if (firstArg == null || "kind" in firstArg || "length" in firstArg) { - return { - nodes: firstArg, - source: args[1], - positions: args[2], - path: args[3], - originalError: args[4], - extensions: args[5] - }; - } - return firstArg; - } - __name(toNormalizedOptions, "toNormalizedOptions"); - class GraphQLError extends Error { - constructor(message) { - var _this$nodes, _nodeLocations$, _ref2; - for (var _len2 = arguments.length, rawArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - rawArgs[_key2 - 1] = arguments[_key2]; - } - const { - nodes, - source, - positions, - path, - originalError, - extensions - } = toNormalizedOptions(rawArgs); - super(message); - this.name = "GraphQLError"; - this.path = path !== null && path !== void 0 ? path : void 0; - this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0; - this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0); - const nodeLocations = undefinedIfEmpty((_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map(node => node.loc).filter(loc => loc != null)); - this.source = source !== null && source !== void 0 ? source : nodeLocations === null || nodeLocations === void 0 ? void 0 : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source; - this.positions = positions !== null && positions !== void 0 ? positions : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map(loc => loc.start); - this.locations = positions && source ? positions.map(pos => getLocation(source, pos)) : nodeLocations === null || nodeLocations === void 0 ? void 0 : nodeLocations.map(loc => getLocation(loc.source, loc.start)); - const originalExtensions = isObjectLike(originalError === null || originalError === void 0 ? void 0 : originalError.extensions) ? originalError === null || originalError === void 0 ? void 0 : originalError.extensions : void 0; - this.extensions = (_ref2 = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref2 !== void 0 ? _ref2 : /* @__PURE__ */Object.create(null); - Object.defineProperties(this, { - message: { - writable: true, - enumerable: true - }, - name: { - enumerable: false - }, - nodes: { - enumerable: false - }, - source: { - enumerable: false - }, - positions: { - enumerable: false - }, - originalError: { - enumerable: false - } - }); - if (originalError !== null && originalError !== void 0 && originalError.stack) { - Object.defineProperty(this, "stack", { - value: originalError.stack, - writable: true, - configurable: true - }); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, GraphQLError); - } else { - Object.defineProperty(this, "stack", { - value: Error().stack, - writable: true, - configurable: true - }); - } - } - get [Symbol.toStringTag]() { - return "GraphQLError"; - } - toString() { - let output = this.message; - if (this.nodes) { - for (const node of this.nodes) { - if (node.loc) { - output += "\n\n" + printLocation(node.loc); - } - } - } else if (this.source && this.locations) { - for (const location of this.locations) { - output += "\n\n" + printSourceLocation(this.source, location); - } - } - return output; - } - toJSON() { - const formattedError = { - message: this.message - }; - if (this.locations != null) { - formattedError.locations = this.locations; - } - if (this.path != null) { - formattedError.path = this.path; - } - if (this.extensions != null && Object.keys(this.extensions).length > 0) { - formattedError.extensions = this.extensions; - } - return formattedError; - } - } - __name(GraphQLError, "GraphQLError"); - function undefinedIfEmpty(array) { - return array === void 0 || array.length === 0 ? void 0 : array; - } - __name(undefinedIfEmpty, "undefinedIfEmpty"); - function valueFromASTUntyped(valueNode, variables) { - switch (valueNode.kind) { - case Kind.NULL: - return null; - case Kind.INT: - return parseInt(valueNode.value, 10); - case Kind.FLOAT: - return parseFloat(valueNode.value); - case Kind.STRING: - case Kind.ENUM: - case Kind.BOOLEAN: - return valueNode.value; - case Kind.LIST: - return valueNode.values.map(node => valueFromASTUntyped(node, variables)); - case Kind.OBJECT: - return keyValMap(valueNode.fields, field => field.name.value, field => valueFromASTUntyped(field.value, variables)); - case Kind.VARIABLE: - return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value]; - } - } - __name(valueFromASTUntyped, "valueFromASTUntyped"); - function assertName(name2) { - name2 != null || devAssert(false, "Must provide name."); - typeof name2 === "string" || devAssert(false, "Expected name to be a string."); - if (name2.length === 0) { - throw new GraphQLError("Expected name to be a non-empty string."); - } - for (let i = 1; i < name2.length; ++i) { - if (!isNameContinue(name2.charCodeAt(i))) { - throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name2}" does not.`); - } - } - if (!isNameStart(name2.charCodeAt(0))) { - throw new GraphQLError(`Names must start with [_a-zA-Z] but "${name2}" does not.`); - } - return name2; - } - __name(assertName, "assertName"); - function assertEnumValueName(name2) { - if (name2 === "true" || name2 === "false" || name2 === "null") { - throw new GraphQLError(`Enum values cannot be named: ${name2}`); - } - return assertName(name2); - } - __name(assertEnumValueName, "assertEnumValueName"); - function isType(type2) { - return isScalarType(type2) || isObjectType(type2) || isInterfaceType(type2) || isUnionType(type2) || isEnumType(type2) || isInputObjectType(type2) || isListType(type2) || isNonNullType(type2); - } - __name(isType, "isType"); - function isScalarType(type2) { - return instanceOf(type2, GraphQLScalarType); - } - __name(isScalarType, "isScalarType"); - function isObjectType(type2) { - return instanceOf(type2, GraphQLObjectType); - } - __name(isObjectType, "isObjectType"); - function isInterfaceType(type2) { - return instanceOf(type2, GraphQLInterfaceType); - } - __name(isInterfaceType, "isInterfaceType"); - function isUnionType(type2) { - return instanceOf(type2, GraphQLUnionType); - } - __name(isUnionType, "isUnionType"); - function isEnumType(type2) { - return instanceOf(type2, GraphQLEnumType); - } - __name(isEnumType, "isEnumType"); - function isInputObjectType(type2) { - return instanceOf(type2, GraphQLInputObjectType); - } - __name(isInputObjectType, "isInputObjectType"); - function isListType(type2) { - return instanceOf(type2, GraphQLList); - } - __name(isListType, "isListType"); - function isNonNullType(type2) { - return instanceOf(type2, GraphQLNonNull); - } - __name(isNonNullType, "isNonNullType"); - function isLeafType(type2) { - return isScalarType(type2) || isEnumType(type2); - } - __name(isLeafType, "isLeafType"); - function isAbstractType(type2) { - return isInterfaceType(type2) || isUnionType(type2); - } - __name(isAbstractType, "isAbstractType"); - class GraphQLList { - constructor(ofType) { - isType(ofType) || devAssert(false, `Expected ${inspect(ofType)} to be a GraphQL type.`); - this.ofType = ofType; - } - get [Symbol.toStringTag]() { - return "GraphQLList"; - } - toString() { - return "[" + String(this.ofType) + "]"; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLList, "GraphQLList"); - class GraphQLNonNull { - constructor(ofType) { - isNullableType(ofType) || devAssert(false, `Expected ${inspect(ofType)} to be a GraphQL nullable type.`); - this.ofType = ofType; - } - get [Symbol.toStringTag]() { - return "GraphQLNonNull"; - } - toString() { - return String(this.ofType) + "!"; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLNonNull, "GraphQLNonNull"); - function isNullableType(type2) { - return isType(type2) && !isNonNullType(type2); - } - __name(isNullableType, "isNullableType"); - function resolveReadonlyArrayThunk(thunk) { - return typeof thunk === "function" ? thunk() : thunk; - } - __name(resolveReadonlyArrayThunk, "resolveReadonlyArrayThunk"); - function resolveObjMapThunk(thunk) { - return typeof thunk === "function" ? thunk() : thunk; - } - __name(resolveObjMapThunk, "resolveObjMapThunk"); - class GraphQLScalarType { - constructor(config2) { - var _config$parseValue, _config$serialize, _config$parseLiteral, _config$extensionASTN; - const parseValue = (_config$parseValue = config2.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc; - this.name = assertName(config2.name); - this.description = config2.description; - this.specifiedByURL = config2.specifiedByURL; - this.serialize = (_config$serialize = config2.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc; - this.parseValue = parseValue; - this.parseLiteral = (_config$parseLiteral = config2.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : (node, variables) => parseValue(valueFromASTUntyped(node, variables)); - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN = config2.extensionASTNodes) !== null && _config$extensionASTN !== void 0 ? _config$extensionASTN : []; - config2.specifiedByURL == null || typeof config2.specifiedByURL === "string" || devAssert(false, `${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(config2.specifiedByURL)}.`); - config2.serialize == null || typeof config2.serialize === "function" || devAssert(false, `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`); - if (config2.parseLiteral) { - typeof config2.parseValue === "function" && typeof config2.parseLiteral === "function" || devAssert(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`); - } - } - get [Symbol.toStringTag]() { - return "GraphQLScalarType"; - } - toConfig() { - return { - name: this.name, - description: this.description, - specifiedByURL: this.specifiedByURL, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLScalarType, "GraphQLScalarType"); - class GraphQLObjectType { - constructor(config2) { - var _config$extensionASTN2; - this.name = assertName(config2.name); - this.description = config2.description; - this.isTypeOf = config2.isTypeOf; - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN2 = config2.extensionASTNodes) !== null && _config$extensionASTN2 !== void 0 ? _config$extensionASTN2 : []; - this._fields = () => defineFieldMap(config2); - this._interfaces = () => defineInterfaces(config2); - config2.isTypeOf == null || typeof config2.isTypeOf === "function" || devAssert(false, `${this.name} must provide "isTypeOf" as a function, but got: ${inspect(config2.isTypeOf)}.`); - } - get [Symbol.toStringTag]() { - return "GraphQLObjectType"; - } - getFields() { - if (typeof this._fields === "function") { - this._fields = this._fields(); - } - return this._fields; - } - getInterfaces() { - if (typeof this._interfaces === "function") { - this._interfaces = this._interfaces(); - } - return this._interfaces; - } - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLObjectType, "GraphQLObjectType"); - function defineInterfaces(config2) { - var _config$interfaces; - const interfaces = resolveReadonlyArrayThunk((_config$interfaces = config2.interfaces) !== null && _config$interfaces !== void 0 ? _config$interfaces : []); - Array.isArray(interfaces) || devAssert(false, `${config2.name} interfaces must be an Array or a function which returns an Array.`); - return interfaces; - } - __name(defineInterfaces, "defineInterfaces"); - function defineFieldMap(config2) { - const fieldMap = resolveObjMapThunk(config2.fields); - isPlainObj(fieldMap) || devAssert(false, `${config2.name} fields must be an object with field names as keys or a function which returns such an object.`); - return mapValue(fieldMap, (fieldConfig, fieldName) => { - var _fieldConfig$args; - isPlainObj(fieldConfig) || devAssert(false, `${config2.name}.${fieldName} field config must be an object.`); - fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || devAssert(false, `${config2.name}.${fieldName} field resolver must be a function if provided, but got: ${inspect(fieldConfig.resolve)}.`); - const argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {}; - isPlainObj(argsConfig) || devAssert(false, `${config2.name}.${fieldName} args must be an object with argument names as keys.`); - return { - name: assertName(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - args: defineArguments(argsConfig), - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - deprecationReason: fieldConfig.deprecationReason, - extensions: toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); - } - __name(defineFieldMap, "defineFieldMap"); - function defineArguments(config2) { - return Object.entries(config2).map(_ref54 => { - let [argName, argConfig] = _ref54; - return { - name: assertName(argName), - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: toObjMap(argConfig.extensions), - astNode: argConfig.astNode - }; - }); - } - __name(defineArguments, "defineArguments"); - function isPlainObj(obj) { - return isObjectLike(obj) && !Array.isArray(obj); - } - __name(isPlainObj, "isPlainObj"); - function fieldsToFieldsConfig(fields) { - return mapValue(fields, field => ({ - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - })); - } - __name(fieldsToFieldsConfig, "fieldsToFieldsConfig"); - function argsToArgsConfig(args) { - return keyValMap(args, arg => arg.name, arg => ({ - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - astNode: arg.astNode - })); - } - __name(argsToArgsConfig, "argsToArgsConfig"); - class GraphQLInterfaceType { - constructor(config2) { - var _config$extensionASTN3; - this.name = assertName(config2.name); - this.description = config2.description; - this.resolveType = config2.resolveType; - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN3 = config2.extensionASTNodes) !== null && _config$extensionASTN3 !== void 0 ? _config$extensionASTN3 : []; - this._fields = defineFieldMap.bind(void 0, config2); - this._interfaces = defineInterfaces.bind(void 0, config2); - config2.resolveType == null || typeof config2.resolveType === "function" || devAssert(false, `${this.name} must provide "resolveType" as a function, but got: ${inspect(config2.resolveType)}.`); - } - get [Symbol.toStringTag]() { - return "GraphQLInterfaceType"; - } - getFields() { - if (typeof this._fields === "function") { - this._fields = this._fields(); - } - return this._fields; - } - getInterfaces() { - if (typeof this._interfaces === "function") { - this._interfaces = this._interfaces(); - } - return this._interfaces; - } - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLInterfaceType, "GraphQLInterfaceType"); - class GraphQLUnionType { - constructor(config2) { - var _config$extensionASTN4; - this.name = assertName(config2.name); - this.description = config2.description; - this.resolveType = config2.resolveType; - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN4 = config2.extensionASTNodes) !== null && _config$extensionASTN4 !== void 0 ? _config$extensionASTN4 : []; - this._types = defineTypes.bind(void 0, config2); - config2.resolveType == null || typeof config2.resolveType === "function" || devAssert(false, `${this.name} must provide "resolveType" as a function, but got: ${inspect(config2.resolveType)}.`); - } - get [Symbol.toStringTag]() { - return "GraphQLUnionType"; - } - getTypes() { - if (typeof this._types === "function") { - this._types = this._types(); - } - return this._types; - } - toConfig() { - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLUnionType, "GraphQLUnionType"); - function defineTypes(config2) { - const types = resolveReadonlyArrayThunk(config2.types); - Array.isArray(types) || devAssert(false, `Must provide Array of types or a function which returns such an array for Union ${config2.name}.`); - return types; - } - __name(defineTypes, "defineTypes"); - class GraphQLEnumType { - constructor(config2) { - var _config$extensionASTN5; - this.name = assertName(config2.name); - this.description = config2.description; - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN5 = config2.extensionASTNodes) !== null && _config$extensionASTN5 !== void 0 ? _config$extensionASTN5 : []; - this._values = defineEnumValues(this.name, config2.values); - this._valueLookup = new Map(this._values.map(enumValue => [enumValue.value, enumValue])); - this._nameLookup = keyMap(this._values, value3 => value3.name); - } - get [Symbol.toStringTag]() { - return "GraphQLEnumType"; - } - getValues() { - return this._values; - } - getValue(name2) { - return this._nameLookup[name2]; - } - serialize(outputValue) { - const enumValue = this._valueLookup.get(outputValue); - if (enumValue === void 0) { - throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(outputValue)}`); - } - return enumValue.name; - } - parseValue(inputValue) { - if (typeof inputValue !== "string") { - const valueStr = inspect(inputValue); - throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr)); - } - const enumValue = this.getValue(inputValue); - if (enumValue == null) { - throw new GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, inputValue)); - } - return enumValue.value; - } - parseLiteral(valueNode, _variables) { - if (valueNode.kind !== Kind.ENUM) { - const valueStr = print(valueNode); - throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + didYouMeanEnumValue(this, valueStr), { - nodes: valueNode - }); - } - const enumValue = this.getValue(valueNode.value); - if (enumValue == null) { - const valueStr = print(valueNode); - throw new GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + didYouMeanEnumValue(this, valueStr), { - nodes: valueNode - }); - } - return enumValue.value; - } - toConfig() { - const values = keyValMap(this.getValues(), value3 => value3.name, value3 => ({ - description: value3.description, - value: value3.value, - deprecationReason: value3.deprecationReason, - extensions: value3.extensions, - astNode: value3.astNode - })); - return { - name: this.name, - description: this.description, - values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLEnumType, "GraphQLEnumType"); - function didYouMeanEnumValue(enumType, unknownValueStr) { - const allNames = enumType.getValues().map(value3 => value3.name); - const suggestedValues = suggestionList(unknownValueStr, allNames); - return didYouMean("the enum value", suggestedValues); - } - __name(didYouMeanEnumValue, "didYouMeanEnumValue"); - function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || devAssert(false, `${typeName} values must be an object with value names as keys.`); - return Object.entries(valueMap).map(_ref55 => { - let [valueName, valueConfig] = _ref55; - isPlainObj(valueConfig) || devAssert(false, `${typeName}.${valueName} must refer to an object with a "value" key representing an internal value but got: ${inspect(valueConfig)}.`); - return { - name: assertEnumValueName(valueName), - description: valueConfig.description, - value: valueConfig.value !== void 0 ? valueConfig.value : valueName, - deprecationReason: valueConfig.deprecationReason, - extensions: toObjMap(valueConfig.extensions), - astNode: valueConfig.astNode - }; - }); - } - __name(defineEnumValues, "defineEnumValues"); - class GraphQLInputObjectType { - constructor(config2) { - var _config$extensionASTN6; - this.name = assertName(config2.name); - this.description = config2.description; - this.extensions = toObjMap(config2.extensions); - this.astNode = config2.astNode; - this.extensionASTNodes = (_config$extensionASTN6 = config2.extensionASTNodes) !== null && _config$extensionASTN6 !== void 0 ? _config$extensionASTN6 : []; - this._fields = defineInputFieldMap.bind(void 0, config2); - } - get [Symbol.toStringTag]() { - return "GraphQLInputObjectType"; - } - getFields() { - if (typeof this._fields === "function") { - this._fields = this._fields(); - } - return this._fields; - } - toConfig() { - const fields = mapValue(this.getFields(), field => ({ - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - })); - return { - name: this.name, - description: this.description, - fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } - } - __name(GraphQLInputObjectType, "GraphQLInputObjectType"); - function defineInputFieldMap(config2) { - const fieldMap = resolveObjMapThunk(config2.fields); - isPlainObj(fieldMap) || devAssert(false, `${config2.name} fields must be an object with field names as keys or a function which returns such an object.`); - return mapValue(fieldMap, (fieldConfig, fieldName) => { - !("resolve" in fieldConfig) || devAssert(false, `${config2.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`); - return { - name: assertName(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); - } - __name(defineInputFieldMap, "defineInputFieldMap"); - const GRAPHQL_MAX_INT = 2147483647; - const GRAPHQL_MIN_INT = -2147483648; - const GraphQLInt = new GraphQLScalarType({ - name: "Int", - description: "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === "boolean") { - return coercedValue ? 1 : 0; - } - let num2 = coercedValue; - if (typeof coercedValue === "string" && coercedValue !== "") { - num2 = Number(coercedValue); - } - if (typeof num2 !== "number" || !Number.isInteger(num2)) { - throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(coercedValue)}`); - } - if (num2 > GRAPHQL_MAX_INT || num2 < GRAPHQL_MIN_INT) { - throw new GraphQLError("Int cannot represent non 32-bit signed integer value: " + inspect(coercedValue)); - } - return num2; - }, - parseValue(inputValue) { - if (typeof inputValue !== "number" || !Number.isInteger(inputValue)) { - throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(inputValue)}`); - } - if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) { - throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inputValue}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.INT) { - throw new GraphQLError(`Int cannot represent non-integer value: ${print(valueNode)}`, { - nodes: valueNode - }); - } - const num2 = parseInt(valueNode.value, 10); - if (num2 > GRAPHQL_MAX_INT || num2 < GRAPHQL_MIN_INT) { - throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { - nodes: valueNode - }); - } - return num2; - } - }); - const GraphQLFloat = new GraphQLScalarType({ - name: "Float", - description: "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === "boolean") { - return coercedValue ? 1 : 0; - } - let num2 = coercedValue; - if (typeof coercedValue === "string" && coercedValue !== "") { - num2 = Number(coercedValue); - } - if (typeof num2 !== "number" || !Number.isFinite(num2)) { - throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)}`); - } - return num2; - }, - parseValue(inputValue) { - if (typeof inputValue !== "number" || !Number.isFinite(inputValue)) { - throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(inputValue)}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) { - throw new GraphQLError(`Float cannot represent non numeric value: ${print(valueNode)}`, valueNode); - } - return parseFloat(valueNode.value); - } - }); - const GraphQLString = new GraphQLScalarType({ - name: "String", - description: "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === "string") { - return coercedValue; - } - if (typeof coercedValue === "boolean") { - return coercedValue ? "true" : "false"; - } - if (typeof coercedValue === "number" && Number.isFinite(coercedValue)) { - return coercedValue.toString(); - } - throw new GraphQLError(`String cannot represent value: ${inspect(outputValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue !== "string") { - throw new GraphQLError(`String cannot represent a non string value: ${inspect(inputValue)}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.STRING) { - throw new GraphQLError(`String cannot represent a non string value: ${print(valueNode)}`, { - nodes: valueNode - }); - } - return valueNode.value; - } - }); - const GraphQLBoolean = new GraphQLScalarType({ - name: "Boolean", - description: "The `Boolean` scalar type represents `true` or `false`.", - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === "boolean") { - return coercedValue; - } - if (Number.isFinite(coercedValue)) { - return coercedValue !== 0; - } - throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue !== "boolean") { - throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(inputValue)}`); - } - return inputValue; - }, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.BOOLEAN) { - throw new GraphQLError(`Boolean cannot represent a non boolean value: ${print(valueNode)}`, { - nodes: valueNode - }); - } - return valueNode.value; - } - }); - const GraphQLID = new GraphQLScalarType({ - name: "ID", - description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - if (typeof coercedValue === "string") { - return coercedValue; - } - if (Number.isInteger(coercedValue)) { - return String(coercedValue); - } - throw new GraphQLError(`ID cannot represent value: ${inspect(outputValue)}`); - }, - parseValue(inputValue) { - if (typeof inputValue === "string") { - return inputValue; - } - if (typeof inputValue === "number" && Number.isInteger(inputValue)) { - return inputValue.toString(); - } - throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`); - }, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) { - throw new GraphQLError("ID cannot represent a non-string and non-integer value: " + print(valueNode), { - nodes: valueNode - }); - } - return valueNode.value; - } - }); - Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); - function serializeObject(outputValue) { - if (isObjectLike(outputValue)) { - if (typeof outputValue.valueOf === "function") { - const valueOfResult = outputValue.valueOf(); - if (!isObjectLike(valueOfResult)) { - return valueOfResult; - } - } - if (typeof outputValue.toJSON === "function") { - return outputValue.toJSON(); - } - } - return outputValue; - } - __name(serializeObject, "serializeObject"); - function astFromValue(value3, type2) { - if (isNonNullType(type2)) { - const astValue = astFromValue(value3, type2.ofType); - if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) { - return null; - } - return astValue; - } - if (value3 === null) { - return { - kind: Kind.NULL - }; - } - if (value3 === void 0) { - return null; - } - if (isListType(type2)) { - const itemType = type2.ofType; - if (isIterableObject(value3)) { - const valuesNodes = []; - for (const item of value3) { - const itemNode = astFromValue(item, itemType); - if (itemNode != null) { - valuesNodes.push(itemNode); - } - } - return { - kind: Kind.LIST, - values: valuesNodes - }; - } - return astFromValue(value3, itemType); - } - if (isInputObjectType(type2)) { - if (!isObjectLike(value3)) { - return null; - } - const fieldNodes = []; - for (const field of Object.values(type2.getFields())) { - const fieldValue = astFromValue(value3[field.name], field.type); - if (fieldValue) { - fieldNodes.push({ - kind: Kind.OBJECT_FIELD, - name: { - kind: Kind.NAME, - value: field.name - }, - value: fieldValue - }); - } - } - return { - kind: Kind.OBJECT, - fields: fieldNodes - }; - } - if (isLeafType(type2)) { - const serialized = type2.serialize(value3); - if (serialized == null) { - return null; - } - if (typeof serialized === "boolean") { - return { - kind: Kind.BOOLEAN, - value: serialized - }; - } - if (typeof serialized === "number" && Number.isFinite(serialized)) { - const stringNum = String(serialized); - return integerStringRegExp.test(stringNum) ? { - kind: Kind.INT, - value: stringNum - } : { - kind: Kind.FLOAT, - value: stringNum - }; - } - if (typeof serialized === "string") { - if (isEnumType(type2)) { - return { - kind: Kind.ENUM, - value: serialized - }; - } - if (type2 === GraphQLID && integerStringRegExp.test(serialized)) { - return { - kind: Kind.INT, - value: serialized - }; - } - return { - kind: Kind.STRING, - value: serialized - }; - } - throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}.`); - } - invariant(false, "Unexpected input type: " + inspect(type2)); - } - __name(astFromValue, "astFromValue"); - const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; - const __Schema = new GraphQLObjectType({ - name: "__Schema", - description: "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - fields: () => ({ - description: { - type: GraphQLString, - resolve: schema => schema.description - }, - types: { - description: "A list of all types supported by this server.", - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))), - resolve(schema) { - return Object.values(schema.getTypeMap()); - } - }, - queryType: { - description: "The type that query operations will be rooted at.", - type: new GraphQLNonNull(__Type), - resolve: schema => schema.getQueryType() - }, - mutationType: { - description: "If this server supports mutation, the type that mutation operations will be rooted at.", - type: __Type, - resolve: schema => schema.getMutationType() - }, - subscriptionType: { - description: "If this server support subscription, the type that subscription operations will be rooted at.", - type: __Type, - resolve: schema => schema.getSubscriptionType() - }, - directives: { - description: "A list of all directives supported by this server.", - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))), - resolve: schema => schema.getDirectives() - } - }) - }); - const __Directive = new GraphQLObjectType({ - name: "__Directive", - description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - fields: () => ({ - name: { - type: new GraphQLNonNull(GraphQLString), - resolve: directive2 => directive2.name - }, - description: { - type: GraphQLString, - resolve: directive2 => directive2.description - }, - isRepeatable: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: directive2 => directive2.isRepeatable - }, - locations: { - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))), - resolve: directive2 => directive2.locations - }, - args: { - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(field, _ref56) { - let { - includeDeprecated - } = _ref56; - return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); - } - } - }) - }); - const __DirectiveLocation = new GraphQLEnumType({ - name: "__DirectiveLocation", - description: "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - values: { - QUERY: { - value: DirectiveLocation.QUERY, - description: "Location adjacent to a query operation." - }, - MUTATION: { - value: DirectiveLocation.MUTATION, - description: "Location adjacent to a mutation operation." - }, - SUBSCRIPTION: { - value: DirectiveLocation.SUBSCRIPTION, - description: "Location adjacent to a subscription operation." - }, - FIELD: { - value: DirectiveLocation.FIELD, - description: "Location adjacent to a field." - }, - FRAGMENT_DEFINITION: { - value: DirectiveLocation.FRAGMENT_DEFINITION, - description: "Location adjacent to a fragment definition." - }, - FRAGMENT_SPREAD: { - value: DirectiveLocation.FRAGMENT_SPREAD, - description: "Location adjacent to a fragment spread." - }, - INLINE_FRAGMENT: { - value: DirectiveLocation.INLINE_FRAGMENT, - description: "Location adjacent to an inline fragment." - }, - VARIABLE_DEFINITION: { - value: DirectiveLocation.VARIABLE_DEFINITION, - description: "Location adjacent to a variable definition." - }, - SCHEMA: { - value: DirectiveLocation.SCHEMA, - description: "Location adjacent to a schema definition." - }, - SCALAR: { - value: DirectiveLocation.SCALAR, - description: "Location adjacent to a scalar definition." - }, - OBJECT: { - value: DirectiveLocation.OBJECT, - description: "Location adjacent to an object type definition." - }, - FIELD_DEFINITION: { - value: DirectiveLocation.FIELD_DEFINITION, - description: "Location adjacent to a field definition." - }, - ARGUMENT_DEFINITION: { - value: DirectiveLocation.ARGUMENT_DEFINITION, - description: "Location adjacent to an argument definition." - }, - INTERFACE: { - value: DirectiveLocation.INTERFACE, - description: "Location adjacent to an interface definition." - }, - UNION: { - value: DirectiveLocation.UNION, - description: "Location adjacent to a union definition." - }, - ENUM: { - value: DirectiveLocation.ENUM, - description: "Location adjacent to an enum definition." - }, - ENUM_VALUE: { - value: DirectiveLocation.ENUM_VALUE, - description: "Location adjacent to an enum value definition." - }, - INPUT_OBJECT: { - value: DirectiveLocation.INPUT_OBJECT, - description: "Location adjacent to an input object type definition." - }, - INPUT_FIELD_DEFINITION: { - value: DirectiveLocation.INPUT_FIELD_DEFINITION, - description: "Location adjacent to an input object field definition." - } - } - }); - const __Type = new GraphQLObjectType({ - name: "__Type", - description: "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - fields: () => ({ - kind: { - type: new GraphQLNonNull(__TypeKind), - resolve(type2) { - if (isScalarType(type2)) { - return TypeKind.SCALAR; - } - if (isObjectType(type2)) { - return TypeKind.OBJECT; - } - if (isInterfaceType(type2)) { - return TypeKind.INTERFACE; - } - if (isUnionType(type2)) { - return TypeKind.UNION; - } - if (isEnumType(type2)) { - return TypeKind.ENUM; - } - if (isInputObjectType(type2)) { - return TypeKind.INPUT_OBJECT; - } - if (isListType(type2)) { - return TypeKind.LIST; - } - if (isNonNullType(type2)) { - return TypeKind.NON_NULL; - } - invariant(false, `Unexpected type: "${inspect(type2)}".`); - } - }, - name: { - type: GraphQLString, - resolve: type2 => "name" in type2 ? type2.name : void 0 - }, - description: { - type: GraphQLString, - resolve: type2 => "description" in type2 ? type2.description : void 0 - }, - specifiedByURL: { - type: GraphQLString, - resolve: obj => "specifiedByURL" in obj ? obj.specifiedByURL : void 0 - }, - fields: { - type: new GraphQLList(new GraphQLNonNull(__Field)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(type2, _ref57) { - let { - includeDeprecated - } = _ref57; - if (isObjectType(type2) || isInterfaceType(type2)) { - const fields = Object.values(type2.getFields()); - return includeDeprecated ? fields : fields.filter(field => field.deprecationReason == null); - } - } - }, - interfaces: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type2) { - if (isObjectType(type2) || isInterfaceType(type2)) { - return type2.getInterfaces(); - } - } - }, - possibleTypes: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type2, _args, _context, _ref58) { - let { - schema - } = _ref58; - if (isAbstractType(type2)) { - return schema.getPossibleTypes(type2); - } - } - }, - enumValues: { - type: new GraphQLList(new GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(type2, _ref59) { - let { - includeDeprecated - } = _ref59; - if (isEnumType(type2)) { - const values = type2.getValues(); - return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); - } - } - }, - inputFields: { - type: new GraphQLList(new GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(type2, _ref60) { - let { - includeDeprecated - } = _ref60; - if (isInputObjectType(type2)) { - const values = Object.values(type2.getFields()); - return includeDeprecated ? values : values.filter(field => field.deprecationReason == null); - } - } - }, - ofType: { - type: __Type, - resolve: type2 => "ofType" in type2 ? type2.ofType : void 0 - } - }) - }); - const __Field = new GraphQLObjectType({ - name: "__Field", - description: "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - fields: () => ({ - name: { - type: new GraphQLNonNull(GraphQLString), - resolve: field => field.name - }, - description: { - type: GraphQLString, - resolve: field => field.description - }, - args: { - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(field, _ref61) { - let { - includeDeprecated - } = _ref61; - return includeDeprecated ? field.args : field.args.filter(arg => arg.deprecationReason == null); - } - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: field => field.type - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: field => field.deprecationReason != null - }, - deprecationReason: { - type: GraphQLString, - resolve: field => field.deprecationReason - } - }) - }); - const __InputValue = new GraphQLObjectType({ - name: "__InputValue", - description: "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - fields: () => ({ - name: { - type: new GraphQLNonNull(GraphQLString), - resolve: inputValue => inputValue.name - }, - description: { - type: GraphQLString, - resolve: inputValue => inputValue.description - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: inputValue => inputValue.type - }, - defaultValue: { - type: GraphQLString, - description: "A GraphQL-formatted string representing the default value for this input value.", - resolve(inputValue) { - const { - type: type2, - defaultValue: defaultValue2 - } = inputValue; - const valueAST = astFromValue(defaultValue2, type2); - return valueAST ? print(valueAST) : null; - } - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: field => field.deprecationReason != null - }, - deprecationReason: { - type: GraphQLString, - resolve: obj => obj.deprecationReason - } - }) - }); - const __EnumValue = new GraphQLObjectType({ - name: "__EnumValue", - description: "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - fields: () => ({ - name: { - type: new GraphQLNonNull(GraphQLString), - resolve: enumValue => enumValue.name - }, - description: { - type: GraphQLString, - resolve: enumValue => enumValue.description - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: enumValue => enumValue.deprecationReason != null - }, - deprecationReason: { - type: GraphQLString, - resolve: enumValue => enumValue.deprecationReason - } - }) - }); - let TypeKind; - (function (TypeKind2) { - TypeKind2["SCALAR"] = "SCALAR"; - TypeKind2["OBJECT"] = "OBJECT"; - TypeKind2["INTERFACE"] = "INTERFACE"; - TypeKind2["UNION"] = "UNION"; - TypeKind2["ENUM"] = "ENUM"; - TypeKind2["INPUT_OBJECT"] = "INPUT_OBJECT"; - TypeKind2["LIST"] = "LIST"; - TypeKind2["NON_NULL"] = "NON_NULL"; - })(TypeKind || (TypeKind = {})); - const __TypeKind = new GraphQLEnumType({ - name: "__TypeKind", - description: "An enum describing what kind of type a given `__Type` is.", - values: { - SCALAR: { - value: TypeKind.SCALAR, - description: "Indicates this type is a scalar." - }, - OBJECT: { - value: TypeKind.OBJECT, - description: "Indicates this type is an object. `fields` and `interfaces` are valid fields." - }, - INTERFACE: { - value: TypeKind.INTERFACE, - description: "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields." - }, - UNION: { - value: TypeKind.UNION, - description: "Indicates this type is a union. `possibleTypes` is a valid field." - }, - ENUM: { - value: TypeKind.ENUM, - description: "Indicates this type is an enum. `enumValues` is a valid field." - }, - INPUT_OBJECT: { - value: TypeKind.INPUT_OBJECT, - description: "Indicates this type is an input object. `inputFields` is a valid field." - }, - LIST: { - value: TypeKind.LIST, - description: "Indicates this type is a list. `ofType` is a valid field." - }, - NON_NULL: { - value: TypeKind.NON_NULL, - description: "Indicates this type is a non-null. `ofType` is a valid field." - } - } - }); - const SchemaMetaFieldDef = { - name: "__schema", - type: new GraphQLNonNull(__Schema), - description: "Access the current type schema of this server.", - args: [], - resolve: (_source, _args, _context, _ref62) => { - let { - schema - } = _ref62; - return schema; - }, - deprecationReason: void 0, - extensions: /* @__PURE__ */Object.create(null), - astNode: void 0 - }; - _exports.S = SchemaMetaFieldDef; - const TypeMetaFieldDef = { - name: "__type", - type: __Type, - description: "Request the type information of a single type.", - args: [{ - name: "name", - description: void 0, - type: new GraphQLNonNull(GraphQLString), - defaultValue: void 0, - deprecationReason: void 0, - extensions: /* @__PURE__ */Object.create(null), - astNode: void 0 - }], - resolve: (_source, _ref63, _context, _ref64) => { - let { - name: name2 - } = _ref63; - let { - schema - } = _ref64; - return schema.getType(name2); - }, - deprecationReason: void 0, - extensions: /* @__PURE__ */Object.create(null), - astNode: void 0 - }; - _exports.T = TypeMetaFieldDef; - const TypeNameMetaFieldDef = { - name: "__typename", - type: new GraphQLNonNull(GraphQLString), - description: "The name of the current Object type at runtime.", - args: [], - resolve: (_source, _args, _context, _ref65) => { - let { - parentType - } = _ref65; - return parentType.name; - }, - deprecationReason: void 0, - extensions: /* @__PURE__ */Object.create(null), - astNode: void 0 - }; - _exports.a = TypeNameMetaFieldDef; - Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); - function getDefinitionState(tokenState) { - let definitionState; - forEachState(tokenState, state2 => { - switch (state2.kind) { - case "Query": - case "ShortQuery": - case "Mutation": - case "Subscription": - case "FragmentDefinition": - definitionState = state2; - break; - } - }); - return definitionState; - } - __name(getDefinitionState, "getDefinitionState"); - function getFieldDef(schema, type2, fieldName) { - if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === type2) { - return SchemaMetaFieldDef; - } - if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === type2) { - return TypeMetaFieldDef; - } - if (fieldName === TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type2)) { - return TypeNameMetaFieldDef; - } - if ("getFields" in type2) { - return type2.getFields()[fieldName]; - } - return null; - } - __name(getFieldDef, "getFieldDef"); - function forEachState(stack, fn) { - const reverseStateStack = []; - let state2 = stack; - while (state2 === null || state2 === void 0 ? void 0 : state2.kind) { - reverseStateStack.push(state2); - state2 = state2.prevState; - } - for (let i = reverseStateStack.length - 1; i >= 0; i--) { - fn(reverseStateStack[i]); - } - } - __name(forEachState, "forEachState"); - function objectValues(object) { - const keys = Object.keys(object); - const len = keys.length; - const values = new Array(len); - for (let i = 0; i < len; ++i) { - values[i] = object[keys[i]]; - } - return values; - } - __name(objectValues, "objectValues"); - function hintList(token2, list3) { - return filterAndSortList(list3, normalizeText(token2.string)); - } - __name(hintList, "hintList"); - function filterAndSortList(list3, text3) { - if (!text3) { - return filterNonEmpty(list3, entry => !entry.isDeprecated); - } - const byProximity = list3.map(entry => ({ - proximity: getProximity(normalizeText(entry.label), text3), - entry - })); - return filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated).sort((a2, b2) => (a2.entry.isDeprecated ? 1 : 0) - (b2.entry.isDeprecated ? 1 : 0) || a2.proximity - b2.proximity || a2.entry.label.length - b2.entry.label.length).map(pair => pair.entry); - } - __name(filterAndSortList, "filterAndSortList"); - function filterNonEmpty(array, predicate) { - const filtered = array.filter(predicate); - return filtered.length === 0 ? array : filtered; - } - __name(filterNonEmpty, "filterNonEmpty"); - function normalizeText(text3) { - return text3.toLowerCase().replace(/\W/g, ""); - } - __name(normalizeText, "normalizeText"); - function getProximity(suggestion, text3) { - let proximity = lexicalDistance(text3, suggestion); - if (suggestion.length > text3.length) { - proximity -= suggestion.length - text3.length - 1; - proximity += suggestion.indexOf(text3) === 0 ? 0 : 0.5; - } - return proximity; - } - __name(getProximity, "getProximity"); - function lexicalDistance(a2, b2) { - let i; - let j; - const d2 = []; - const aLength = a2.length; - const bLength = b2.length; - for (i = 0; i <= aLength; i++) { - d2[i] = [i]; - } - for (j = 1; j <= bLength; j++) { - d2[0][j] = j; - } - for (i = 1; i <= aLength; i++) { - for (j = 1; j <= bLength; j++) { - const cost = a2[i - 1] === b2[j - 1] ? 0 : 1; - d2[i][j] = Math.min(d2[i - 1][j] + 1, d2[i][j - 1] + 1, d2[i - 1][j - 1] + cost); - if (i > 1 && j > 1 && a2[i - 1] === b2[j - 2] && a2[i - 2] === b2[j - 1]) { - d2[i][j] = Math.min(d2[i][j], d2[i - 2][j - 2] + cost); - } - } - } - return d2[aLength][bLength]; - } - __name(lexicalDistance, "lexicalDistance"); - var DocumentUri; - (function (DocumentUri2) { - function is(value3) { - return typeof value3 === "string"; - } - __name(is, "is"); - DocumentUri2.is = is; - })(DocumentUri || (DocumentUri = {})); - var URI; - (function (URI2) { - function is(value3) { - return typeof value3 === "string"; - } - __name(is, "is"); - URI2.is = is; - })(URI || (URI = {})); - var integer; - (function (integer2) { - integer2.MIN_VALUE = -2147483648; - integer2.MAX_VALUE = 2147483647; - function is(value3) { - return typeof value3 === "number" && integer2.MIN_VALUE <= value3 && value3 <= integer2.MAX_VALUE; - } - __name(is, "is"); - integer2.is = is; - })(integer || (integer = {})); - var uinteger; - (function (uinteger2) { - uinteger2.MIN_VALUE = 0; - uinteger2.MAX_VALUE = 2147483647; - function is(value3) { - return typeof value3 === "number" && uinteger2.MIN_VALUE <= value3 && value3 <= uinteger2.MAX_VALUE; - } - __name(is, "is"); - uinteger2.is = is; - })(uinteger || (uinteger = {})); - var Position; - (function (Position2) { - function create(line, character) { - if (line === Number.MAX_VALUE) { - line = uinteger.MAX_VALUE; - } - if (character === Number.MAX_VALUE) { - character = uinteger.MAX_VALUE; - } - return { - line, - character - }; - } - __name(create, "create"); - Position2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character); - } - __name(is, "is"); - Position2.is = is; - })(Position || (Position = {})); - var Range; - (function (Range2) { - function create(one, two, three, four) { - if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) { - return { - start: Position.create(one, two), - end: Position.create(three, four) - }; - } else if (Position.is(one) && Position.is(two)) { - return { - start: one, - end: two - }; - } else { - throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]")); - } - } - __name(create, "create"); - Range2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - __name(is, "is"); - Range2.is = is; - })(Range || (Range = {})); - var Location; - (function (Location2) { - function create(uri, range2) { - return { - uri, - range: range2 - }; - } - __name(create, "create"); - Location2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - __name(is, "is"); - Location2.is = is; - })(Location || (Location = {})); - var LocationLink; - (function (LocationLink2) { - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { - targetUri, - targetRange, - targetSelectionRange, - originSelectionRange - }; - } - __name(create, "create"); - LocationLink2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - __name(is, "is"); - LocationLink2.is = is; - })(LocationLink || (LocationLink = {})); - var Color; - (function (Color2) { - function create(red, green, blue, alpha2) { - return { - red, - green, - blue, - alpha: alpha2 - }; - } - __name(create, "create"); - Color2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1); - } - __name(is, "is"); - Color2.is = is; - })(Color || (Color = {})); - var ColorInformation; - (function (ColorInformation2) { - function create(range2, color) { - return { - range: range2, - color - }; - } - __name(create, "create"); - ColorInformation2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color); - } - __name(is, "is"); - ColorInformation2.is = is; - })(ColorInformation || (ColorInformation = {})); - var ColorPresentation; - (function (ColorPresentation2) { - function create(label, textEdit, additionalTextEdits) { - return { - label, - textEdit, - additionalTextEdits - }; - } - __name(create, "create"); - ColorPresentation2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - __name(is, "is"); - ColorPresentation2.is = is; - })(ColorPresentation || (ColorPresentation = {})); - var FoldingRangeKind; - (function (FoldingRangeKind2) { - FoldingRangeKind2.Comment = "comment"; - FoldingRangeKind2.Imports = "imports"; - FoldingRangeKind2.Region = "region"; - })(FoldingRangeKind || (FoldingRangeKind = {})); - var FoldingRange; - (function (FoldingRange2) { - function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) { - var result = { - startLine, - endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - if (Is.defined(collapsedText)) { - result.collapsedText = collapsedText; - } - return result; - } - __name(create, "create"); - FoldingRange2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - __name(is, "is"); - FoldingRange2.is = is; - })(FoldingRange || (FoldingRange = {})); - var DiagnosticRelatedInformation; - (function (DiagnosticRelatedInformation2) { - function create(location, message) { - return { - location, - message - }; - } - __name(create, "create"); - DiagnosticRelatedInformation2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - __name(is, "is"); - DiagnosticRelatedInformation2.is = is; - })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); - var DiagnosticSeverity; - (function (DiagnosticSeverity2) { - DiagnosticSeverity2.Error = 1; - DiagnosticSeverity2.Warning = 2; - DiagnosticSeverity2.Information = 3; - DiagnosticSeverity2.Hint = 4; - })(DiagnosticSeverity || (DiagnosticSeverity = {})); - var DiagnosticTag; - (function (DiagnosticTag2) { - DiagnosticTag2.Unnecessary = 1; - DiagnosticTag2.Deprecated = 2; - })(DiagnosticTag || (DiagnosticTag = {})); - var CodeDescription; - (function (CodeDescription2) { - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.string(candidate.href); - } - __name(is, "is"); - CodeDescription2.is = is; - })(CodeDescription || (CodeDescription = {})); - var Diagnostic; - (function (Diagnostic2) { - function create(range2, message, severity, code3, source, relatedInformation) { - var result = { - range: range2, - message - }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code3)) { - result.code = code3; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - __name(create, "create"); - Diagnostic2.create = create; - function is(value3) { - var _a; - var candidate = value3; - return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - __name(is, "is"); - Diagnostic2.is = is; - })(Diagnostic || (Diagnostic = {})); - var Command; - (function (Command2) { - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { - title, - command - }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - __name(create, "create"); - Command2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - __name(is, "is"); - Command2.is = is; - })(Command || (Command = {})); - var TextEdit; - (function (TextEdit2) { - function replace2(range2, newText) { - return { - range: range2, - newText - }; - } - __name(replace2, "replace"); - TextEdit2.replace = replace2; - function insert(position, newText) { - return { - range: { - start: position, - end: position - }, - newText - }; - } - __name(insert, "insert"); - TextEdit2.insert = insert; - function del(range2) { - return { - range: range2, - newText: "" - }; - } - __name(del, "del"); - TextEdit2.del = del; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range); - } - __name(is, "is"); - TextEdit2.is = is; - })(TextEdit || (TextEdit = {})); - var ChangeAnnotation; - (function (ChangeAnnotation2) { - function create(label, needsConfirmation, description) { - var result = { - label - }; - if (needsConfirmation !== void 0) { - result.needsConfirmation = needsConfirmation; - } - if (description !== void 0) { - result.description = description; - } - return result; - } - __name(create, "create"); - ChangeAnnotation2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0); - } - __name(is, "is"); - ChangeAnnotation2.is = is; - })(ChangeAnnotation || (ChangeAnnotation = {})); - var ChangeAnnotationIdentifier; - (function (ChangeAnnotationIdentifier2) { - function is(value3) { - var candidate = value3; - return Is.string(candidate); - } - __name(is, "is"); - ChangeAnnotationIdentifier2.is = is; - })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {})); - var AnnotatedTextEdit; - (function (AnnotatedTextEdit2) { - function replace2(range2, newText, annotation) { - return { - range: range2, - newText, - annotationId: annotation - }; - } - __name(replace2, "replace"); - AnnotatedTextEdit2.replace = replace2; - function insert(position, newText, annotation) { - return { - range: { - start: position, - end: position - }, - newText, - annotationId: annotation - }; - } - __name(insert, "insert"); - AnnotatedTextEdit2.insert = insert; - function del(range2, annotation) { - return { - range: range2, - newText: "", - annotationId: annotation - }; - } - __name(del, "del"); - AnnotatedTextEdit2.del = del; - function is(value3) { - var candidate = value3; - return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - __name(is, "is"); - AnnotatedTextEdit2.is = is; - })(AnnotatedTextEdit || (AnnotatedTextEdit = {})); - var TextDocumentEdit; - (function (TextDocumentEdit2) { - function create(textDocument, edits) { - return { - textDocument, - edits - }; - } - __name(create, "create"); - TextDocumentEdit2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits); - } - __name(is, "is"); - TextDocumentEdit2.is = is; - })(TextDocumentEdit || (TextDocumentEdit = {})); - var CreateFile; - (function (CreateFile2) { - function create(uri, options, annotation) { - var result = { - kind: "create", - uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - if (annotation !== void 0) { - result.annotationId = annotation; - } - return result; - } - __name(create, "create"); - CreateFile2.create = create; - function is(value3) { - var candidate = value3; - return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - __name(is, "is"); - CreateFile2.is = is; - })(CreateFile || (CreateFile = {})); - var RenameFile; - (function (RenameFile2) { - function create(oldUri, newUri, options, annotation) { - var result = { - kind: "rename", - oldUri, - newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - if (annotation !== void 0) { - result.annotationId = annotation; - } - return result; - } - __name(create, "create"); - RenameFile2.create = create; - function is(value3) { - var candidate = value3; - return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - __name(is, "is"); - RenameFile2.is = is; - })(RenameFile || (RenameFile = {})); - var DeleteFile; - (function (DeleteFile2) { - function create(uri, options, annotation) { - var result = { - kind: "delete", - uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - if (annotation !== void 0) { - result.annotationId = annotation; - } - return result; - } - __name(create, "create"); - DeleteFile2.create = create; - function is(value3) { - var candidate = value3; - return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId)); - } - __name(is, "is"); - DeleteFile2.is = is; - })(DeleteFile || (DeleteFile = {})); - var WorkspaceEdit; - (function (WorkspaceEdit2) { - function is(value3) { - var candidate = value3; - return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } else { - return TextDocumentEdit.is(change); - } - })); - } - __name(is, "is"); - WorkspaceEdit2.is = is; - })(WorkspaceEdit || (WorkspaceEdit = {})); - var TextEditChangeImpl = function () { - function TextEditChangeImpl2(edits, changeAnnotations) { - this.edits = edits; - this.changeAnnotations = changeAnnotations; - } - __name(TextEditChangeImpl2, "TextEditChangeImpl"); - TextEditChangeImpl2.prototype.insert = function (position, newText, annotation) { - var edit; - var id2; - if (annotation === void 0) { - edit = TextEdit.insert(position, newText); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id2 = annotation; - edit = AnnotatedTextEdit.insert(position, newText, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id2 = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.insert(position, newText, id2); - } - this.edits.push(edit); - if (id2 !== void 0) { - return id2; - } - }; - TextEditChangeImpl2.prototype.replace = function (range2, newText, annotation) { - var edit; - var id2; - if (annotation === void 0) { - edit = TextEdit.replace(range2, newText); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id2 = annotation; - edit = AnnotatedTextEdit.replace(range2, newText, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id2 = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.replace(range2, newText, id2); - } - this.edits.push(edit); - if (id2 !== void 0) { - return id2; - } - }; - TextEditChangeImpl2.prototype.delete = function (range2, annotation) { - var edit; - var id2; - if (annotation === void 0) { - edit = TextEdit.del(range2); - } else if (ChangeAnnotationIdentifier.is(annotation)) { - id2 = annotation; - edit = AnnotatedTextEdit.del(range2, annotation); - } else { - this.assertChangeAnnotations(this.changeAnnotations); - id2 = this.changeAnnotations.manage(annotation); - edit = AnnotatedTextEdit.del(range2, id2); - } - this.edits.push(edit); - if (id2 !== void 0) { - return id2; - } - }; - TextEditChangeImpl2.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl2.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl2.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - TextEditChangeImpl2.prototype.assertChangeAnnotations = function (value3) { - if (value3 === void 0) { - throw new Error("Text edit change is not configured to manage change annotations."); - } - }; - return TextEditChangeImpl2; - }(); - var ChangeAnnotations = function () { - function ChangeAnnotations2(annotations) { - this._annotations = annotations === void 0 ? /* @__PURE__ */Object.create(null) : annotations; - this._counter = 0; - this._size = 0; - } - __name(ChangeAnnotations2, "ChangeAnnotations"); - ChangeAnnotations2.prototype.all = function () { - return this._annotations; - }; - Object.defineProperty(ChangeAnnotations2.prototype, "size", { - get: function () { - return this._size; - }, - enumerable: false, - configurable: true - }); - ChangeAnnotations2.prototype.manage = function (idOrAnnotation, annotation) { - var id2; - if (ChangeAnnotationIdentifier.is(idOrAnnotation)) { - id2 = idOrAnnotation; - } else { - id2 = this.nextId(); - annotation = idOrAnnotation; - } - if (this._annotations[id2] !== void 0) { - throw new Error("Id ".concat(id2, " is already in use.")); - } - if (annotation === void 0) { - throw new Error("No annotation provided for id ".concat(id2)); - } - this._annotations[id2] = annotation; - this._size++; - return id2; - }; - ChangeAnnotations2.prototype.nextId = function () { - this._counter++; - return this._counter.toString(); - }; - return ChangeAnnotations2; - }(); - (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = /* @__PURE__ */Object.create(null); - if (workspaceEdit !== void 0) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations); - workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } else { - this._workspaceEdit = {}; - } - } - __name(WorkspaceChange, "WorkspaceChange"); - Object.defineProperty(WorkspaceChange.prototype, "edit", { - get: function () { - this.initDocumentChanges(); - if (this._changeAnnotations !== void 0) { - if (this._changeAnnotations.size === 0) { - this._workspaceEdit.changeAnnotations = void 0; - } else { - this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - } - } - return this._workspaceEdit; - }, - enumerable: false, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (OptionalVersionedTextDocumentIdentifier.is(key)) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === void 0) { - throw new Error("Workspace edit is not configured for document changes."); - } - var textDocument = { - uri: key.uri, - version: key.version - }; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument, - edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits, this._changeAnnotations); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } else { - this.initChanges(); - if (this._workspaceEdit.changes === void 0) { - throw new Error("Workspace edit is not configured for normal text edit changes."); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.initDocumentChanges = function () { - if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) { - this._changeAnnotations = new ChangeAnnotations(); - this._workspaceEdit.documentChanges = []; - this._workspaceEdit.changeAnnotations = this._changeAnnotations.all(); - } - }; - WorkspaceChange.prototype.initChanges = function () { - if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) { - this._workspaceEdit.changes = /* @__PURE__ */Object.create(null); - } - }; - WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === void 0) { - throw new Error("Workspace edit is not configured for document changes."); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id2; - if (annotation === void 0) { - operation = CreateFile.create(uri, options); - } else { - id2 = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = CreateFile.create(uri, options, id2); - } - this._workspaceEdit.documentChanges.push(operation); - if (id2 !== void 0) { - return id2; - } - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === void 0) { - throw new Error("Workspace edit is not configured for document changes."); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id2; - if (annotation === void 0) { - operation = RenameFile.create(oldUri, newUri, options); - } else { - id2 = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = RenameFile.create(oldUri, newUri, options, id2); - } - this._workspaceEdit.documentChanges.push(operation); - if (id2 !== void 0) { - return id2; - } - }; - WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) { - this.initDocumentChanges(); - if (this._workspaceEdit.documentChanges === void 0) { - throw new Error("Workspace edit is not configured for document changes."); - } - var annotation; - if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) { - annotation = optionsOrAnnotation; - } else { - options = optionsOrAnnotation; - } - var operation; - var id2; - if (annotation === void 0) { - operation = DeleteFile.create(uri, options); - } else { - id2 = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation); - operation = DeleteFile.create(uri, options, id2); - } - this._workspaceEdit.documentChanges.push(operation); - if (id2 !== void 0) { - return id2; - } - }; - return WorkspaceChange; - })(); - var TextDocumentIdentifier; - (function (TextDocumentIdentifier2) { - function create(uri) { - return { - uri - }; - } - __name(create, "create"); - TextDocumentIdentifier2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.uri); - } - __name(is, "is"); - TextDocumentIdentifier2.is = is; - })(TextDocumentIdentifier || (TextDocumentIdentifier = {})); - var VersionedTextDocumentIdentifier; - (function (VersionedTextDocumentIdentifier2) { - function create(uri, version) { - return { - uri, - version - }; - } - __name(create, "create"); - VersionedTextDocumentIdentifier2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version); - } - __name(is, "is"); - VersionedTextDocumentIdentifier2.is = is; - })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); - var OptionalVersionedTextDocumentIdentifier; - (function (OptionalVersionedTextDocumentIdentifier2) { - function create(uri, version) { - return { - uri, - version - }; - } - __name(create, "create"); - OptionalVersionedTextDocumentIdentifier2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version)); - } - __name(is, "is"); - OptionalVersionedTextDocumentIdentifier2.is = is; - })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {})); - var TextDocumentItem; - (function (TextDocumentItem2) { - function create(uri, languageId, version, text3) { - return { - uri, - languageId, - version, - text: text3 - }; - } - __name(create, "create"); - TextDocumentItem2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text); - } - __name(is, "is"); - TextDocumentItem2.is = is; - })(TextDocumentItem || (TextDocumentItem = {})); - var MarkupKind; - (function (MarkupKind2) { - MarkupKind2.PlainText = "plaintext"; - MarkupKind2.Markdown = "markdown"; - function is(value3) { - var candidate = value3; - return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown; - } - __name(is, "is"); - MarkupKind2.is = is; - })(MarkupKind || (MarkupKind = {})); - var MarkupContent; - (function (MarkupContent2) { - function is(value3) { - var candidate = value3; - return Is.objectLiteral(value3) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - __name(is, "is"); - MarkupContent2.is = is; - })(MarkupContent || (MarkupContent = {})); - var CompletionItemKind$1; - (function (CompletionItemKind2) { - CompletionItemKind2.Text = 1; - CompletionItemKind2.Method = 2; - CompletionItemKind2.Function = 3; - CompletionItemKind2.Constructor = 4; - CompletionItemKind2.Field = 5; - CompletionItemKind2.Variable = 6; - CompletionItemKind2.Class = 7; - CompletionItemKind2.Interface = 8; - CompletionItemKind2.Module = 9; - CompletionItemKind2.Property = 10; - CompletionItemKind2.Unit = 11; - CompletionItemKind2.Value = 12; - CompletionItemKind2.Enum = 13; - CompletionItemKind2.Keyword = 14; - CompletionItemKind2.Snippet = 15; - CompletionItemKind2.Color = 16; - CompletionItemKind2.File = 17; - CompletionItemKind2.Reference = 18; - CompletionItemKind2.Folder = 19; - CompletionItemKind2.EnumMember = 20; - CompletionItemKind2.Constant = 21; - CompletionItemKind2.Struct = 22; - CompletionItemKind2.Event = 23; - CompletionItemKind2.Operator = 24; - CompletionItemKind2.TypeParameter = 25; - })(CompletionItemKind$1 || (CompletionItemKind$1 = {})); - var InsertTextFormat; - (function (InsertTextFormat2) { - InsertTextFormat2.PlainText = 1; - InsertTextFormat2.Snippet = 2; - })(InsertTextFormat || (InsertTextFormat = {})); - var CompletionItemTag; - (function (CompletionItemTag2) { - CompletionItemTag2.Deprecated = 1; - })(CompletionItemTag || (CompletionItemTag = {})); - var InsertReplaceEdit; - (function (InsertReplaceEdit2) { - function create(newText, insert, replace2) { - return { - newText, - insert, - replace: replace2 - }; - } - __name(create, "create"); - InsertReplaceEdit2.create = create; - function is(value3) { - var candidate = value3; - return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); - } - __name(is, "is"); - InsertReplaceEdit2.is = is; - })(InsertReplaceEdit || (InsertReplaceEdit = {})); - var InsertTextMode; - (function (InsertTextMode2) { - InsertTextMode2.asIs = 1; - InsertTextMode2.adjustIndentation = 2; - })(InsertTextMode || (InsertTextMode = {})); - var CompletionItemLabelDetails; - (function (CompletionItemLabelDetails2) { - function is(value3) { - var candidate = value3; - return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0); - } - __name(is, "is"); - CompletionItemLabelDetails2.is = is; - })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {})); - var CompletionItem; - (function (CompletionItem2) { - function create(label) { - return { - label - }; - } - __name(create, "create"); - CompletionItem2.create = create; - })(CompletionItem || (CompletionItem = {})); - var CompletionList; - (function (CompletionList2) { - function create(items, isIncomplete) { - return { - items: items ? items : [], - isIncomplete: !!isIncomplete - }; - } - __name(create, "create"); - CompletionList2.create = create; - })(CompletionList || (CompletionList = {})); - var MarkedString; - (function (MarkedString2) { - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); - } - __name(fromPlainText, "fromPlainText"); - MarkedString2.fromPlainText = fromPlainText; - function is(value3) { - var candidate = value3; - return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value); - } - __name(is, "is"); - MarkedString2.is = is; - })(MarkedString || (MarkedString = {})); - var Hover; - (function (Hover2) { - function is(value3) { - var candidate = value3; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value3.range === void 0 || Range.is(value3.range)); - } - __name(is, "is"); - Hover2.is = is; - })(Hover || (Hover = {})); - var ParameterInformation; - (function (ParameterInformation2) { - function create(label, documentation) { - return documentation ? { - label, - documentation - } : { - label - }; - } - __name(create, "create"); - ParameterInformation2.create = create; - })(ParameterInformation || (ParameterInformation = {})); - var SignatureInformation; - (function (SignatureInformation2) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { - label - }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } else { - result.parameters = []; - } - return result; - } - __name(create, "create"); - SignatureInformation2.create = create; - })(SignatureInformation || (SignatureInformation = {})); - var DocumentHighlightKind; - (function (DocumentHighlightKind2) { - DocumentHighlightKind2.Text = 1; - DocumentHighlightKind2.Read = 2; - DocumentHighlightKind2.Write = 3; - })(DocumentHighlightKind || (DocumentHighlightKind = {})); - var DocumentHighlight; - (function (DocumentHighlight2) { - function create(range2, kind) { - var result = { - range: range2 - }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - __name(create, "create"); - DocumentHighlight2.create = create; - })(DocumentHighlight || (DocumentHighlight = {})); - var SymbolKind; - (function (SymbolKind2) { - SymbolKind2.File = 1; - SymbolKind2.Module = 2; - SymbolKind2.Namespace = 3; - SymbolKind2.Package = 4; - SymbolKind2.Class = 5; - SymbolKind2.Method = 6; - SymbolKind2.Property = 7; - SymbolKind2.Field = 8; - SymbolKind2.Constructor = 9; - SymbolKind2.Enum = 10; - SymbolKind2.Interface = 11; - SymbolKind2.Function = 12; - SymbolKind2.Variable = 13; - SymbolKind2.Constant = 14; - SymbolKind2.String = 15; - SymbolKind2.Number = 16; - SymbolKind2.Boolean = 17; - SymbolKind2.Array = 18; - SymbolKind2.Object = 19; - SymbolKind2.Key = 20; - SymbolKind2.Null = 21; - SymbolKind2.EnumMember = 22; - SymbolKind2.Struct = 23; - SymbolKind2.Event = 24; - SymbolKind2.Operator = 25; - SymbolKind2.TypeParameter = 26; - })(SymbolKind || (SymbolKind = {})); - var SymbolTag; - (function (SymbolTag2) { - SymbolTag2.Deprecated = 1; - })(SymbolTag || (SymbolTag = {})); - var SymbolInformation; - (function (SymbolInformation2) { - function create(name2, kind, range2, uri, containerName) { - var result = { - name: name2, - kind, - location: { - uri, - range: range2 - } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - __name(create, "create"); - SymbolInformation2.create = create; - })(SymbolInformation || (SymbolInformation = {})); - var WorkspaceSymbol; - (function (WorkspaceSymbol2) { - function create(name2, kind, uri, range2) { - return range2 !== void 0 ? { - name: name2, - kind, - location: { - uri, - range: range2 - } - } : { - name: name2, - kind, - location: { - uri - } - }; - } - __name(create, "create"); - WorkspaceSymbol2.create = create; - })(WorkspaceSymbol || (WorkspaceSymbol = {})); - var DocumentSymbol; - (function (DocumentSymbol2) { - function create(name2, detail, kind, range2, selectionRange, children) { - var result = { - name: name2, - detail, - kind, - range: range2, - selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - __name(create, "create"); - DocumentSymbol2.create = create; - function is(value3) { - var candidate = value3; - return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags)); - } - __name(is, "is"); - DocumentSymbol2.is = is; - })(DocumentSymbol || (DocumentSymbol = {})); - var CodeActionKind; - (function (CodeActionKind2) { - CodeActionKind2.Empty = ""; - CodeActionKind2.QuickFix = "quickfix"; - CodeActionKind2.Refactor = "refactor"; - CodeActionKind2.RefactorExtract = "refactor.extract"; - CodeActionKind2.RefactorInline = "refactor.inline"; - CodeActionKind2.RefactorRewrite = "refactor.rewrite"; - CodeActionKind2.Source = "source"; - CodeActionKind2.SourceOrganizeImports = "source.organizeImports"; - CodeActionKind2.SourceFixAll = "source.fixAll"; - })(CodeActionKind || (CodeActionKind = {})); - var CodeActionTriggerKind; - (function (CodeActionTriggerKind2) { - CodeActionTriggerKind2.Invoked = 1; - CodeActionTriggerKind2.Automatic = 2; - })(CodeActionTriggerKind || (CodeActionTriggerKind = {})); - var CodeActionContext; - (function (CodeActionContext2) { - function create(diagnostics, only, triggerKind) { - var result = { - diagnostics - }; - if (only !== void 0 && only !== null) { - result.only = only; - } - if (triggerKind !== void 0 && triggerKind !== null) { - result.triggerKind = triggerKind; - } - return result; - } - __name(create, "create"); - CodeActionContext2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic); - } - __name(is, "is"); - CodeActionContext2.is = is; - })(CodeActionContext || (CodeActionContext = {})); - var CodeAction; - (function (CodeAction2) { - function create(title, kindOrCommandOrEdit, kind) { - var result = { - title - }; - var checkKind = true; - if (typeof kindOrCommandOrEdit === "string") { - checkKind = false; - result.kind = kindOrCommandOrEdit; - } else if (Command.is(kindOrCommandOrEdit)) { - result.command = kindOrCommandOrEdit; - } else { - result.edit = kindOrCommandOrEdit; - } - if (checkKind && kind !== void 0) { - result.kind = kind; - } - return result; - } - __name(create, "create"); - CodeAction2.create = create; - function is(value3) { - var candidate = value3; - return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - __name(is, "is"); - CodeAction2.is = is; - })(CodeAction || (CodeAction = {})); - var CodeLens; - (function (CodeLens2) { - function create(range2, data) { - var result = { - range: range2 - }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - __name(create, "create"); - CodeLens2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - __name(is, "is"); - CodeLens2.is = is; - })(CodeLens || (CodeLens = {})); - var FormattingOptions; - (function (FormattingOptions2) { - function create(tabSize, insertSpaces) { - return { - tabSize, - insertSpaces - }; - } - __name(create, "create"); - FormattingOptions2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - __name(is, "is"); - FormattingOptions2.is = is; - })(FormattingOptions || (FormattingOptions = {})); - var DocumentLink; - (function (DocumentLink2) { - function create(range2, target2, data) { - return { - range: range2, - target: target2, - data - }; - } - __name(create, "create"); - DocumentLink2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - __name(is, "is"); - DocumentLink2.is = is; - })(DocumentLink || (DocumentLink = {})); - var SelectionRange; - (function (SelectionRange2) { - function create(range2, parent) { - return { - range: range2, - parent - }; - } - __name(create, "create"); - SelectionRange2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent)); - } - __name(is, "is"); - SelectionRange2.is = is; - })(SelectionRange || (SelectionRange = {})); - var SemanticTokenTypes; - (function (SemanticTokenTypes2) { - SemanticTokenTypes2["namespace"] = "namespace"; - SemanticTokenTypes2["type"] = "type"; - SemanticTokenTypes2["class"] = "class"; - SemanticTokenTypes2["enum"] = "enum"; - SemanticTokenTypes2["interface"] = "interface"; - SemanticTokenTypes2["struct"] = "struct"; - SemanticTokenTypes2["typeParameter"] = "typeParameter"; - SemanticTokenTypes2["parameter"] = "parameter"; - SemanticTokenTypes2["variable"] = "variable"; - SemanticTokenTypes2["property"] = "property"; - SemanticTokenTypes2["enumMember"] = "enumMember"; - SemanticTokenTypes2["event"] = "event"; - SemanticTokenTypes2["function"] = "function"; - SemanticTokenTypes2["method"] = "method"; - SemanticTokenTypes2["macro"] = "macro"; - SemanticTokenTypes2["keyword"] = "keyword"; - SemanticTokenTypes2["modifier"] = "modifier"; - SemanticTokenTypes2["comment"] = "comment"; - SemanticTokenTypes2["string"] = "string"; - SemanticTokenTypes2["number"] = "number"; - SemanticTokenTypes2["regexp"] = "regexp"; - SemanticTokenTypes2["operator"] = "operator"; - SemanticTokenTypes2["decorator"] = "decorator"; - })(SemanticTokenTypes || (SemanticTokenTypes = {})); - var SemanticTokenModifiers; - (function (SemanticTokenModifiers2) { - SemanticTokenModifiers2["declaration"] = "declaration"; - SemanticTokenModifiers2["definition"] = "definition"; - SemanticTokenModifiers2["readonly"] = "readonly"; - SemanticTokenModifiers2["static"] = "static"; - SemanticTokenModifiers2["deprecated"] = "deprecated"; - SemanticTokenModifiers2["abstract"] = "abstract"; - SemanticTokenModifiers2["async"] = "async"; - SemanticTokenModifiers2["modification"] = "modification"; - SemanticTokenModifiers2["documentation"] = "documentation"; - SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary"; - })(SemanticTokenModifiers || (SemanticTokenModifiers = {})); - var SemanticTokens; - (function (SemanticTokens2) { - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number"); - } - __name(is, "is"); - SemanticTokens2.is = is; - })(SemanticTokens || (SemanticTokens = {})); - var InlineValueText; - (function (InlineValueText2) { - function create(range2, text3) { - return { - range: range2, - text: text3 - }; - } - __name(create, "create"); - InlineValueText2.create = create; - function is(value3) { - var candidate = value3; - return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text); - } - __name(is, "is"); - InlineValueText2.is = is; - })(InlineValueText || (InlineValueText = {})); - var InlineValueVariableLookup; - (function (InlineValueVariableLookup2) { - function create(range2, variableName, caseSensitiveLookup) { - return { - range: range2, - variableName, - caseSensitiveLookup - }; - } - __name(create, "create"); - InlineValueVariableLookup2.create = create; - function is(value3) { - var candidate = value3; - return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0); - } - __name(is, "is"); - InlineValueVariableLookup2.is = is; - })(InlineValueVariableLookup || (InlineValueVariableLookup = {})); - var InlineValueEvaluatableExpression; - (function (InlineValueEvaluatableExpression2) { - function create(range2, expression) { - return { - range: range2, - expression - }; - } - __name(create, "create"); - InlineValueEvaluatableExpression2.create = create; - function is(value3) { - var candidate = value3; - return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0); - } - __name(is, "is"); - InlineValueEvaluatableExpression2.is = is; - })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {})); - var InlineValueContext; - (function (InlineValueContext2) { - function create(frameId, stoppedLocation) { - return { - frameId, - stoppedLocation - }; - } - __name(create, "create"); - InlineValueContext2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Range.is(value3.stoppedLocation); - } - __name(is, "is"); - InlineValueContext2.is = is; - })(InlineValueContext || (InlineValueContext = {})); - var InlayHintKind; - (function (InlayHintKind2) { - InlayHintKind2.Type = 1; - InlayHintKind2.Parameter = 2; - function is(value3) { - return value3 === 1 || value3 === 2; - } - __name(is, "is"); - InlayHintKind2.is = is; - })(InlayHintKind || (InlayHintKind = {})); - var InlayHintLabelPart; - (function (InlayHintLabelPart2) { - function create(value3) { - return { - value: value3 - }; - } - __name(create, "create"); - InlayHintLabelPart2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command)); - } - __name(is, "is"); - InlayHintLabelPart2.is = is; - })(InlayHintLabelPart || (InlayHintLabelPart = {})); - var InlayHint; - (function (InlayHint2) { - function create(position, label, kind) { - var result = { - position, - label - }; - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - __name(create, "create"); - InlayHint2.create = create; - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight)); - } - __name(is, "is"); - InlayHint2.is = is; - })(InlayHint || (InlayHint = {})); - var WorkspaceFolder; - (function (WorkspaceFolder2) { - function is(value3) { - var candidate = value3; - return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name); - } - __name(is, "is"); - WorkspaceFolder2.is = is; - })(WorkspaceFolder || (WorkspaceFolder = {})); - var TextDocument; - (function (TextDocument2) { - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - __name(create, "create"); - TextDocument2.create = create; - function is(value3) { - var candidate = value3; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - __name(is, "is"); - TextDocument2.is = is; - function applyEdits(document2, edits) { - var text3 = document2.getText(); - var sortedEdits = mergeSort(edits, function (a2, b2) { - var diff = a2.range.start.line - b2.range.start.line; - if (diff === 0) { - return a2.range.start.character - b2.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text3.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e2 = sortedEdits[i]; - var startOffset = document2.offsetAt(e2.range.start); - var endOffset = document2.offsetAt(e2.range.end); - if (endOffset <= lastModifiedOffset) { - text3 = text3.substring(0, startOffset) + e2.newText + text3.substring(endOffset, text3.length); - } else { - throw new Error("Overlapping edit"); - } - lastModifiedOffset = startOffset; - } - return text3; - } - __name(applyEdits, "applyEdits"); - TextDocument2.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - return data; - } - var p2 = data.length / 2 | 0; - var left = data.slice(0, p2); - var right = data.slice(p2); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - data[i++] = left[leftIdx++]; - } else { - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } - __name(mergeSort, "mergeSort"); - })(TextDocument || (TextDocument = {})); - var FullTextDocument = function () { - function FullTextDocument2(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = void 0; - } - __name(FullTextDocument2, "FullTextDocument"); - Object.defineProperty(FullTextDocument2.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FullTextDocument2.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: false, - configurable: true - }); - FullTextDocument2.prototype.getText = function (range2) { - if (range2) { - var start = this.offsetAt(range2.start); - var end = this.offsetAt(range2.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument2.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = void 0; - }; - FullTextDocument2.prototype.getLineOffsets = function () { - if (this._lineOffsets === void 0) { - var lineOffsets = []; - var text3 = this._content; - var isLineStart = true; - for (var i = 0; i < text3.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text3.charAt(i); - isLineStart = ch === "\r" || ch === "\n"; - if (ch === "\r" && i + 1 < text3.length && text3.charAt(i + 1) === "\n") { - i++; - } - } - if (isLineStart && text3.length > 0) { - lineOffsets.push(text3.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument2.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, - high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid2 = Math.floor((low + high) / 2); - if (lineOffsets[mid2] > offset) { - high = mid2; - } else { - low = mid2 + 1; - } - } - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument2.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument2.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: false, - configurable: true - }); - return FullTextDocument2; - }(); - var Is; - (function (Is2) { - var toString = Object.prototype.toString; - function defined(value3) { - return typeof value3 !== "undefined"; - } - __name(defined, "defined"); - Is2.defined = defined; - function undefined$1(value3) { - return typeof value3 === "undefined"; - } - __name(undefined$1, "undefined$1"); - Is2.undefined = undefined$1; - function boolean(value3) { - return value3 === true || value3 === false; - } - __name(boolean, "boolean"); - Is2.boolean = boolean; - function string(value3) { - return toString.call(value3) === "[object String]"; - } - __name(string, "string"); - Is2.string = string; - function number(value3) { - return toString.call(value3) === "[object Number]"; - } - __name(number, "number"); - Is2.number = number; - function numberRange(value3, min, max) { - return toString.call(value3) === "[object Number]" && min <= value3 && value3 <= max; - } - __name(numberRange, "numberRange"); - Is2.numberRange = numberRange; - function integer2(value3) { - return toString.call(value3) === "[object Number]" && -2147483648 <= value3 && value3 <= 2147483647; - } - __name(integer2, "integer"); - Is2.integer = integer2; - function uinteger2(value3) { - return toString.call(value3) === "[object Number]" && 0 <= value3 && value3 <= 2147483647; - } - __name(uinteger2, "uinteger"); - Is2.uinteger = uinteger2; - function func(value3) { - return toString.call(value3) === "[object Function]"; - } - __name(func, "func"); - Is2.func = func; - function objectLiteral(value3) { - return value3 !== null && typeof value3 === "object"; - } - __name(objectLiteral, "objectLiteral"); - Is2.objectLiteral = objectLiteral; - function typedArray(value3, check2) { - return Array.isArray(value3) && value3.every(check2); - } - __name(typedArray, "typedArray"); - Is2.typedArray = typedArray; - })(Is || (Is = {})); - var CompletionItemKind; - (function (CompletionItemKind2) { - CompletionItemKind2.Text = 1; - CompletionItemKind2.Method = 2; - CompletionItemKind2.Function = 3; - CompletionItemKind2.Constructor = 4; - CompletionItemKind2.Field = 5; - CompletionItemKind2.Variable = 6; - CompletionItemKind2.Class = 7; - CompletionItemKind2.Interface = 8; - CompletionItemKind2.Module = 9; - CompletionItemKind2.Property = 10; - CompletionItemKind2.Unit = 11; - CompletionItemKind2.Value = 12; - CompletionItemKind2.Enum = 13; - CompletionItemKind2.Keyword = 14; - CompletionItemKind2.Snippet = 15; - CompletionItemKind2.Color = 16; - CompletionItemKind2.File = 17; - CompletionItemKind2.Reference = 18; - CompletionItemKind2.Folder = 19; - CompletionItemKind2.EnumMember = 20; - CompletionItemKind2.Constant = 21; - CompletionItemKind2.Struct = 22; - CompletionItemKind2.Event = 23; - CompletionItemKind2.Operator = 24; - CompletionItemKind2.TypeParameter = 25; - })(CompletionItemKind || (CompletionItemKind = {})); - class CharacterStream { - constructor(sourceText) { - var _this2 = this; - this.getStartOfToken = () => this._start; - this.getCurrentPosition = () => this._pos; - this.eol = () => this._sourceText.length === this._pos; - this.sol = () => this._pos === 0; - this.peek = () => { - return this._sourceText.charAt(this._pos) || null; - }; - this.next = () => { - const char = this._sourceText.charAt(this._pos); - this._pos++; - return char; - }; - this.eat = pattern => { - const isMatched = this._testNextCharacter(pattern); - if (isMatched) { - this._start = this._pos; - this._pos++; - return this._sourceText.charAt(this._pos - 1); - } - return void 0; - }; - this.eatWhile = match2 => { - let isMatched = this._testNextCharacter(match2); - let didEat = false; - if (isMatched) { - didEat = isMatched; - this._start = this._pos; - } - while (isMatched) { - this._pos++; - isMatched = this._testNextCharacter(match2); - didEat = true; - } - return didEat; - }; - this.eatSpace = () => this.eatWhile(/[\s\u00a0]/); - this.skipToEnd = () => { - this._pos = this._sourceText.length; - }; - this.skipTo = position => { - this._pos = position; - }; - this.match = function (pattern) { - let consume = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - let caseFold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - let token2 = null; - let match2 = null; - if (typeof pattern === "string") { - const regex2 = new RegExp(pattern, caseFold ? "i" : "g"); - match2 = regex2.test(_this2._sourceText.substr(_this2._pos, pattern.length)); - token2 = pattern; - } else if (pattern instanceof RegExp) { - match2 = _this2._sourceText.slice(_this2._pos).match(pattern); - token2 = match2 === null || match2 === void 0 ? void 0 : match2[0]; - } - if (match2 != null && (typeof pattern === "string" || match2 instanceof Array && _this2._sourceText.startsWith(match2[0], _this2._pos))) { - if (consume) { - _this2._start = _this2._pos; - if (token2 && token2.length) { - _this2._pos += token2.length; - } - } - return match2; - } - return false; - }; - this.backUp = num2 => { - this._pos -= num2; - }; - this.column = () => this._pos; - this.indentation = () => { - const match2 = this._sourceText.match(/\s*/); - let indent2 = 0; - if (match2 && match2.length !== 0) { - const whiteSpaces = match2[0]; - let pos = 0; - while (whiteSpaces.length > pos) { - if (whiteSpaces.charCodeAt(pos) === 9) { - indent2 += 2; - } else { - indent2++; - } - pos++; - } - } - return indent2; - }; - this.current = () => this._sourceText.slice(this._start, this._pos); - this._start = 0; - this._pos = 0; - this._sourceText = sourceText; - } - _testNextCharacter(pattern) { - const character = this._sourceText.charAt(this._pos); - let isMatched = false; - if (typeof pattern === "string") { - isMatched = character === pattern; - } else { - isMatched = pattern instanceof RegExp ? pattern.test(character) : pattern(character); - } - return isMatched; - } - } - _exports.C = CharacterStream; - __name(CharacterStream, "CharacterStream"); - function opt(ofRule) { - return { - ofRule - }; - } - __name(opt, "opt"); - function list$1(ofRule, separator) { - return { - ofRule, - isList: true, - separator - }; - } - __name(list$1, "list$1"); - function butNot(rule, exclusions) { - const ruleMatch = rule.match; - rule.match = token2 => { - let check2 = false; - if (ruleMatch) { - check2 = ruleMatch(token2); - } - return check2 && exclusions.every(exclusion => exclusion.match && !exclusion.match(token2)); - }; - return rule; - } - __name(butNot, "butNot"); - function t$2(kind, style2) { - return { - style: style2, - match: token2 => token2.kind === kind - }; - } - __name(t$2, "t$2"); - function p$1(value3, style2) { - return { - style: style2 || "punctuation", - match: token2 => token2.kind === "Punctuation" && token2.value === value3 - }; - } - __name(p$1, "p$1"); - const isIgnored = /* @__PURE__ */__name(ch => ch === " " || ch === " " || ch === "," || ch === "\n" || ch === "\r" || ch === "\uFEFF" || ch === "\xA0", "isIgnored"); - _exports.i = isIgnored; - const LexRules = { - Name: /^[_A-Za-z][_0-9A-Za-z]*/, - Punctuation: /^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/, - Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, - String: /^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/, - Comment: /^#.*/ - }; - _exports.L = LexRules; - const ParseRules = { - Document: [list$1("Definition")], - Definition(token2) { - switch (token2.value) { - case "{": - return "ShortQuery"; - case "query": - return "Query"; - case "mutation": - return "Mutation"; - case "subscription": - return "Subscription"; - case "fragment": - return _graphql.Kind.FRAGMENT_DEFINITION; - case "schema": - return "SchemaDef"; - case "scalar": - return "ScalarDef"; - case "type": - return "ObjectTypeDef"; - case "interface": - return "InterfaceDef"; - case "union": - return "UnionDef"; - case "enum": - return "EnumDef"; - case "input": - return "InputDef"; - case "extend": - return "ExtendDef"; - case "directive": - return "DirectiveDef"; - } - }, - ShortQuery: ["SelectionSet"], - Query: [word("query"), opt(name("def")), opt("VariableDefinitions"), list$1("Directive"), "SelectionSet"], - Mutation: [word("mutation"), opt(name("def")), opt("VariableDefinitions"), list$1("Directive"), "SelectionSet"], - Subscription: [word("subscription"), opt(name("def")), opt("VariableDefinitions"), list$1("Directive"), "SelectionSet"], - VariableDefinitions: [p$1("("), list$1("VariableDefinition"), p$1(")")], - VariableDefinition: ["Variable", p$1(":"), "Type", opt("DefaultValue")], - Variable: [p$1("$", "variable"), name("variable")], - DefaultValue: [p$1("="), "Value"], - SelectionSet: [p$1("{"), list$1("Selection"), p$1("}")], - Selection(token2, stream) { - return token2.value === "..." ? stream.match(/[\s\u00a0,]*(on\b|@|{)/, false) ? "InlineFragment" : "FragmentSpread" : stream.match(/[\s\u00a0,]*:/, false) ? "AliasedField" : "Field"; - }, - AliasedField: [name("property"), p$1(":"), name("qualifier"), opt("Arguments"), list$1("Directive"), opt("SelectionSet")], - Field: [name("property"), opt("Arguments"), list$1("Directive"), opt("SelectionSet")], - Arguments: [p$1("("), list$1("Argument"), p$1(")")], - Argument: [name("attribute"), p$1(":"), "Value"], - FragmentSpread: [p$1("..."), name("def"), list$1("Directive")], - InlineFragment: [p$1("..."), opt("TypeCondition"), list$1("Directive"), "SelectionSet"], - FragmentDefinition: [word("fragment"), opt(butNot(name("def"), [word("on")])), "TypeCondition", list$1("Directive"), "SelectionSet"], - TypeCondition: [word("on"), "NamedType"], - Value(token2) { - switch (token2.kind) { - case "Number": - return "NumberValue"; - case "String": - return "StringValue"; - case "Punctuation": - switch (token2.value) { - case "[": - return "ListValue"; - case "{": - return "ObjectValue"; - case "$": - return "Variable"; - case "&": - return "NamedType"; - } - return null; - case "Name": - switch (token2.value) { - case "true": - case "false": - return "BooleanValue"; - } - if (token2.value === "null") { - return "NullValue"; - } - return "EnumValue"; - } - }, - NumberValue: [t$2("Number", "number")], - StringValue: [{ - style: "string", - match: token2 => token2.kind === "String", - update(state2, token2) { - if (token2.value.startsWith('"""')) { - state2.inBlockstring = !token2.value.slice(3).endsWith('"""'); - } - } - }], - BooleanValue: [t$2("Name", "builtin")], - NullValue: [t$2("Name", "keyword")], - EnumValue: [name("string-2")], - ListValue: [p$1("["), list$1("Value"), p$1("]")], - ObjectValue: [p$1("{"), list$1("ObjectField"), p$1("}")], - ObjectField: [name("attribute"), p$1(":"), "Value"], - Type(token2) { - return token2.value === "[" ? "ListType" : "NonNullType"; - }, - ListType: [p$1("["), "Type", p$1("]"), opt(p$1("!"))], - NonNullType: ["NamedType", opt(p$1("!"))], - NamedType: [type("atom")], - Directive: [p$1("@", "meta"), name("meta"), opt("Arguments")], - DirectiveDef: [word("directive"), p$1("@", "meta"), name("meta"), opt("ArgumentsDef"), word("on"), list$1("DirectiveLocation", p$1("|"))], - InterfaceDef: [word("interface"), name("atom"), opt("Implements"), list$1("Directive"), p$1("{"), list$1("FieldDef"), p$1("}")], - Implements: [word("implements"), list$1("NamedType", p$1("&"))], - DirectiveLocation: [name("string-2")], - SchemaDef: [word("schema"), list$1("Directive"), p$1("{"), list$1("OperationTypeDef"), p$1("}")], - OperationTypeDef: [name("keyword"), p$1(":"), name("atom")], - ScalarDef: [word("scalar"), name("atom"), list$1("Directive")], - ObjectTypeDef: [word("type"), name("atom"), opt("Implements"), list$1("Directive"), p$1("{"), list$1("FieldDef"), p$1("}")], - FieldDef: [name("property"), opt("ArgumentsDef"), p$1(":"), "Type", list$1("Directive")], - ArgumentsDef: [p$1("("), list$1("InputValueDef"), p$1(")")], - InputValueDef: [name("attribute"), p$1(":"), "Type", opt("DefaultValue"), list$1("Directive")], - UnionDef: [word("union"), name("atom"), list$1("Directive"), p$1("="), list$1("UnionMember", p$1("|"))], - UnionMember: ["NamedType"], - EnumDef: [word("enum"), name("atom"), list$1("Directive"), p$1("{"), list$1("EnumValueDef"), p$1("}")], - EnumValueDef: [name("string-2"), list$1("Directive")], - InputDef: [word("input"), name("atom"), list$1("Directive"), p$1("{"), list$1("InputValueDef"), p$1("}")], - ExtendDef: [word("extend"), "ExtensionDefinition"], - ExtensionDefinition(token2) { - switch (token2.value) { - case "schema": - return _graphql.Kind.SCHEMA_EXTENSION; - case "scalar": - return _graphql.Kind.SCALAR_TYPE_EXTENSION; - case "type": - return _graphql.Kind.OBJECT_TYPE_EXTENSION; - case "interface": - return _graphql.Kind.INTERFACE_TYPE_EXTENSION; - case "union": - return _graphql.Kind.UNION_TYPE_EXTENSION; - case "enum": - return _graphql.Kind.ENUM_TYPE_EXTENSION; - case "input": - return _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION; - } - }, - [_graphql.Kind.SCHEMA_EXTENSION]: ["SchemaDef"], - [_graphql.Kind.SCALAR_TYPE_EXTENSION]: ["ScalarDef"], - [_graphql.Kind.OBJECT_TYPE_EXTENSION]: ["ObjectTypeDef"], - [_graphql.Kind.INTERFACE_TYPE_EXTENSION]: ["InterfaceDef"], - [_graphql.Kind.UNION_TYPE_EXTENSION]: ["UnionDef"], - [_graphql.Kind.ENUM_TYPE_EXTENSION]: ["EnumDef"], - [_graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]: ["InputDef"] - }; - _exports.P = ParseRules; - function word(value3) { - return { - style: "keyword", - match: token2 => token2.kind === "Name" && token2.value === value3 - }; - } - __name(word, "word"); - function name(style2) { - return { - style: style2, - match: token2 => token2.kind === "Name", - update(state2, token2) { - state2.name = token2.value; - } - }; - } - __name(name, "name"); - function type(style2) { - return { - style: style2, - match: token2 => token2.kind === "Name", - update(state2, token2) { - var _a; - if ((_a = state2.prevState) === null || _a === void 0 ? void 0 : _a.prevState) { - state2.name = token2.value; - state2.prevState.prevState.type = token2.value; - } - } - }; - } - __name(type, "type"); - function onlineParser() { - let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - eatWhitespace: stream => stream.eatWhile(isIgnored), - lexRules: LexRules, - parseRules: ParseRules, - editorConfig: {} - }; - return { - startState() { - const initialState2 = { - level: 0, - step: 0, - name: null, - kind: null, - type: null, - rule: null, - needsSeparator: false, - prevState: null - }; - pushRule(options.parseRules, initialState2, _graphql.Kind.DOCUMENT); - return initialState2; - }, - token(stream, state2) { - return getToken(stream, state2, options); - } - }; - } - __name(onlineParser, "onlineParser"); - function getToken(stream, state2, options) { - var _a; - if (state2.inBlockstring) { - if (stream.match(/.*"""/)) { - state2.inBlockstring = false; - return "string"; - } - stream.skipToEnd(); - return "string"; - } - const { - lexRules, - parseRules, - eatWhitespace, - editorConfig - } = options; - if (state2.rule && state2.rule.length === 0) { - popRule(state2); - } else if (state2.needsAdvance) { - state2.needsAdvance = false; - advanceRule(state2, true); - } - if (stream.sol()) { - const tabSize = (editorConfig === null || editorConfig === void 0 ? void 0 : editorConfig.tabSize) || 2; - state2.indentLevel = Math.floor(stream.indentation() / tabSize); - } - if (eatWhitespace(stream)) { - return "ws"; - } - const token2 = lex(lexRules, stream); - if (!token2) { - const matchedSomething = stream.match(/\S+/); - if (!matchedSomething) { - stream.match(/\s/); - } - pushRule(SpecialParseRules, state2, "Invalid"); - return "invalidchar"; - } - if (token2.kind === "Comment") { - pushRule(SpecialParseRules, state2, "Comment"); - return "comment"; - } - const backupState = assign$2({}, state2); - if (token2.kind === "Punctuation") { - if (/^[{([]/.test(token2.value)) { - if (state2.indentLevel !== void 0) { - state2.levels = (state2.levels || []).concat(state2.indentLevel + 1); - } - } else if (/^[})\]]/.test(token2.value)) { - const levels = state2.levels = (state2.levels || []).slice(0, -1); - if (state2.indentLevel && levels.length > 0 && levels[levels.length - 1] < state2.indentLevel) { - state2.indentLevel = levels[levels.length - 1]; - } - } - } - while (state2.rule) { - let expected = typeof state2.rule === "function" ? state2.step === 0 ? state2.rule(token2, stream) : null : state2.rule[state2.step]; - if (state2.needsSeparator) { - expected = expected === null || expected === void 0 ? void 0 : expected.separator; - } - if (expected) { - if (expected.ofRule) { - expected = expected.ofRule; - } - if (typeof expected === "string") { - pushRule(parseRules, state2, expected); - continue; - } - if ((_a = expected.match) === null || _a === void 0 ? void 0 : _a.call(expected, token2)) { - if (expected.update) { - expected.update(state2, token2); - } - if (token2.kind === "Punctuation") { - advanceRule(state2, true); - } else { - state2.needsAdvance = true; - } - return expected.style; - } - } - unsuccessful(state2); - } - assign$2(state2, backupState); - pushRule(SpecialParseRules, state2, "Invalid"); - return "invalidchar"; - } - __name(getToken, "getToken"); - function assign$2(to, from) { - const keys = Object.keys(from); - for (let i = 0; i < keys.length; i++) { - to[keys[i]] = from[keys[i]]; - } - return to; - } - __name(assign$2, "assign$2"); - const SpecialParseRules = { - Invalid: [], - Comment: [] - }; - function pushRule(rules, state2, ruleKind) { - if (!rules[ruleKind]) { - throw new TypeError("Unknown rule: " + ruleKind); - } - state2.prevState = Object.assign({}, state2); - state2.kind = ruleKind; - state2.name = null; - state2.type = null; - state2.rule = rules[ruleKind]; - state2.step = 0; - state2.needsSeparator = false; - } - __name(pushRule, "pushRule"); - function popRule(state2) { - if (!state2.prevState) { - return; - } - state2.kind = state2.prevState.kind; - state2.name = state2.prevState.name; - state2.type = state2.prevState.type; - state2.rule = state2.prevState.rule; - state2.step = state2.prevState.step; - state2.needsSeparator = state2.prevState.needsSeparator; - state2.prevState = state2.prevState.prevState; - } - __name(popRule, "popRule"); - function advanceRule(state2, successful) { - var _a; - if (isList(state2) && state2.rule) { - const step = state2.rule[state2.step]; - if (step.separator) { - const { - separator - } = step; - state2.needsSeparator = !state2.needsSeparator; - if (!state2.needsSeparator && separator.ofRule) { - return; - } - } - if (successful) { - return; - } - } - state2.needsSeparator = false; - state2.step++; - while (state2.rule && !(Array.isArray(state2.rule) && state2.step < state2.rule.length)) { - popRule(state2); - if (state2.rule) { - if (isList(state2)) { - if ((_a = state2.rule) === null || _a === void 0 ? void 0 : _a[state2.step].separator) { - state2.needsSeparator = !state2.needsSeparator; - } - } else { - state2.needsSeparator = false; - state2.step++; - } - } - } - } - __name(advanceRule, "advanceRule"); - function isList(state2) { - const step = Array.isArray(state2.rule) && typeof state2.rule[state2.step] !== "string" && state2.rule[state2.step]; - return step && step.isList; - } - __name(isList, "isList"); - function unsuccessful(state2) { - while (state2.rule && !(Array.isArray(state2.rule) && state2.rule[state2.step].ofRule)) { - popRule(state2); - } - if (state2.rule) { - advanceRule(state2, false); - } - } - __name(unsuccessful, "unsuccessful"); - function lex(lexRules, stream) { - const kinds = Object.keys(lexRules); - for (let i = 0; i < kinds.length; i++) { - const match2 = stream.match(lexRules[kinds[i]]); - if (match2 && match2 instanceof Array) { - return { - kind: kinds[i], - value: match2[0] - }; - } - } - } - __name(lex, "lex"); - const AdditionalRuleKinds = { - ALIASED_FIELD: "AliasedField", - ARGUMENTS: "Arguments", - SHORT_QUERY: "ShortQuery", - QUERY: "Query", - MUTATION: "Mutation", - SUBSCRIPTION: "Subscription", - TYPE_CONDITION: "TypeCondition", - INVALID: "Invalid", - COMMENT: "Comment", - SCHEMA_DEF: "SchemaDef", - SCALAR_DEF: "ScalarDef", - OBJECT_TYPE_DEF: "ObjectTypeDef", - OBJECT_VALUE: "ObjectValue", - LIST_VALUE: "ListValue", - INTERFACE_DEF: "InterfaceDef", - UNION_DEF: "UnionDef", - ENUM_DEF: "EnumDef", - ENUM_VALUE: "EnumValue", - FIELD_DEF: "FieldDef", - INPUT_DEF: "InputDef", - INPUT_VALUE_DEF: "InputValueDef", - ARGUMENTS_DEF: "ArgumentsDef", - EXTEND_DEF: "ExtendDef", - EXTENSION_DEFINITION: "ExtensionDefinition", - DIRECTIVE_DEF: "DirectiveDef", - IMPLEMENTS: "Implements", - VARIABLE_DEFINITIONS: "VariableDefinitions", - TYPE: "Type" - }; - const RuleKinds = Object.assign(Object.assign({}, _graphql.Kind), AdditionalRuleKinds); - const SuggestionCommand = { - command: "editor.action.triggerSuggest", - title: "Suggestions" - }; - const collectFragmentDefs = /* @__PURE__ */__name(op => { - const externalFragments = []; - if (op) { - try { - (0, _graphql.visit)((0, _graphql.parse)(op), { - FragmentDefinition(def) { - externalFragments.push(def); - } - }); - } catch (_a) { - return []; - } - } - return externalFragments; - }, "collectFragmentDefs"); - const typeSystemKinds = [_graphql.Kind.SCHEMA_DEFINITION, _graphql.Kind.OPERATION_TYPE_DEFINITION, _graphql.Kind.SCALAR_TYPE_DEFINITION, _graphql.Kind.OBJECT_TYPE_DEFINITION, _graphql.Kind.INTERFACE_TYPE_DEFINITION, _graphql.Kind.UNION_TYPE_DEFINITION, _graphql.Kind.ENUM_TYPE_DEFINITION, _graphql.Kind.INPUT_OBJECT_TYPE_DEFINITION, _graphql.Kind.DIRECTIVE_DEFINITION, _graphql.Kind.SCHEMA_EXTENSION, _graphql.Kind.SCALAR_TYPE_EXTENSION, _graphql.Kind.OBJECT_TYPE_EXTENSION, _graphql.Kind.INTERFACE_TYPE_EXTENSION, _graphql.Kind.UNION_TYPE_EXTENSION, _graphql.Kind.ENUM_TYPE_EXTENSION, _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]; - const hasTypeSystemDefinitions = /* @__PURE__ */__name(sdl => { - let hasTypeSystemDef = false; - if (sdl) { - try { - (0, _graphql.visit)((0, _graphql.parse)(sdl), { - enter(node) { - if (node.kind === "Document") { - return; - } - if (typeSystemKinds.includes(node.kind)) { - hasTypeSystemDef = true; - return _graphql.BREAK; - } - return false; - } - }); - } catch (_a) { - return hasTypeSystemDef; - } - } - return hasTypeSystemDef; - }, "hasTypeSystemDefinitions"); - function getAutocompleteSuggestions(schema, queryText, cursor, contextToken, fragmentDefs, options) { - var _a; - const opts = Object.assign(Object.assign({}, options), { - schema - }); - const token2 = contextToken || getTokenAtPosition(queryText, cursor); - const state2 = token2.state.kind === "Invalid" ? token2.state.prevState : token2.state; - const mode = (options === null || options === void 0 ? void 0 : options.mode) || getDocumentMode(queryText, options === null || options === void 0 ? void 0 : options.uri); - if (!state2) { - return []; - } - const { - kind, - step, - prevState - } = state2; - const typeInfo = getTypeInfo(schema, token2.state); - if (kind === RuleKinds.DOCUMENT) { - if (mode === GraphQLDocumentMode.TYPE_SYSTEM) { - return getSuggestionsForTypeSystemDefinitions(token2); - } - return getSuggestionsForExecutableDefinitions(token2); - } - if (kind === RuleKinds.EXTEND_DEF) { - return getSuggestionsForExtensionDefinitions(token2); - } - if (((_a = prevState === null || prevState === void 0 ? void 0 : prevState.prevState) === null || _a === void 0 ? void 0 : _a.kind) === RuleKinds.EXTENSION_DEFINITION && state2.name) { - return hintList(token2, []); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.SCALAR_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(_graphql.isScalarType).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.OBJECT_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(type2 => (0, _graphql.isObjectType)(type2) && !type2.name.startsWith("__")).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INTERFACE_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(_graphql.isInterfaceType).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.UNION_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(_graphql.isUnionType).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.ENUM_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(type2 => (0, _graphql.isEnumType)(type2) && !type2.name.startsWith("__")).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(_graphql.isInputObjectType).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if (kind === RuleKinds.IMPLEMENTS || kind === RuleKinds.NAMED_TYPE && (prevState === null || prevState === void 0 ? void 0 : prevState.kind) === RuleKinds.IMPLEMENTS) { - return getSuggestionsForImplements(token2, state2, schema, queryText, typeInfo); - } - if (kind === RuleKinds.SELECTION_SET || kind === RuleKinds.FIELD || kind === RuleKinds.ALIASED_FIELD) { - return getSuggestionsForFieldNames(token2, typeInfo, opts); - } - if (kind === RuleKinds.ARGUMENTS || kind === RuleKinds.ARGUMENT && step === 0) { - const { - argDefs - } = typeInfo; - if (argDefs) { - return hintList(token2, argDefs.map(argDef => { - var _a2; - return { - label: argDef.name, - insertText: argDef.name + ": ", - command: SuggestionCommand, - detail: String(argDef.type), - documentation: (_a2 = argDef.description) !== null && _a2 !== void 0 ? _a2 : void 0, - kind: CompletionItemKind.Variable, - type: argDef.type - }; - })); - } - } - if ((kind === RuleKinds.OBJECT_VALUE || kind === RuleKinds.OBJECT_FIELD && step === 0) && typeInfo.objectFieldDefs) { - const objectFields = objectValues(typeInfo.objectFieldDefs); - const completionKind = kind === RuleKinds.OBJECT_VALUE ? CompletionItemKind.Value : CompletionItemKind.Field; - return hintList(token2, objectFields.map(field => { - var _a2; - return { - label: field.name, - detail: String(field.type), - documentation: (_a2 = field.description) !== null && _a2 !== void 0 ? _a2 : void 0, - kind: completionKind, - type: field.type - }; - })); - } - if (kind === RuleKinds.ENUM_VALUE || kind === RuleKinds.LIST_VALUE && step === 1 || kind === RuleKinds.OBJECT_FIELD && step === 2 || kind === RuleKinds.ARGUMENT && step === 2) { - return getSuggestionsForInputValues(token2, typeInfo, queryText, schema); - } - if (kind === RuleKinds.VARIABLE && step === 1) { - const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); - const variableDefinitions = getVariableCompletions(queryText, schema, token2); - return hintList(token2, variableDefinitions.filter(v2 => v2.detail === (namedInputType === null || namedInputType === void 0 ? void 0 : namedInputType.name))); - } - if (kind === RuleKinds.TYPE_CONDITION && step === 1 || kind === RuleKinds.NAMED_TYPE && prevState != null && prevState.kind === RuleKinds.TYPE_CONDITION) { - return getSuggestionsForFragmentTypeConditions(token2, typeInfo, schema); - } - if (kind === RuleKinds.FRAGMENT_SPREAD && step === 1) { - return getSuggestionsForFragmentSpread(token2, typeInfo, schema, queryText, Array.isArray(fragmentDefs) ? fragmentDefs : collectFragmentDefs(fragmentDefs)); - } - const unwrappedState = unwrapType(state2); - if (mode === GraphQLDocumentMode.TYPE_SYSTEM && !unwrappedState.needsAdvance && kind === RuleKinds.NAMED_TYPE || kind === RuleKinds.LIST_TYPE) { - if (unwrappedState.kind === RuleKinds.FIELD_DEF) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(type2 => (0, _graphql.isOutputType)(type2) && !type2.name.startsWith("__")).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - if (unwrappedState.kind === RuleKinds.INPUT_VALUE_DEF) { - return hintList(token2, Object.values(schema.getTypeMap()).filter(type2 => (0, _graphql.isInputType)(type2) && !type2.name.startsWith("__")).map(type2 => ({ - label: type2.name, - kind: CompletionItemKind.Function - }))); - } - } - if (kind === RuleKinds.VARIABLE_DEFINITION && step === 2 || kind === RuleKinds.LIST_TYPE && step === 1 || kind === RuleKinds.NAMED_TYPE && prevState && (prevState.kind === RuleKinds.VARIABLE_DEFINITION || prevState.kind === RuleKinds.LIST_TYPE || prevState.kind === RuleKinds.NON_NULL_TYPE)) { - return getSuggestionsForVariableDefinition(token2, schema); - } - if (kind === RuleKinds.DIRECTIVE) { - return getSuggestionsForDirective(token2, state2, schema); - } - return []; - } - __name(getAutocompleteSuggestions, "getAutocompleteSuggestions"); - const insertSuffix = ` { - $1 -}`; - const getInsertText = /* @__PURE__ */__name(field => { - const { - type: type2 - } = field; - if ((0, _graphql.isCompositeType)(type2)) { - return insertSuffix; - } - if ((0, _graphql.isListType)(type2) && (0, _graphql.isCompositeType)(type2.ofType)) { - return insertSuffix; - } - if ((0, _graphql.isNonNullType)(type2)) { - if ((0, _graphql.isCompositeType)(type2.ofType)) { - return insertSuffix; - } - if ((0, _graphql.isListType)(type2.ofType) && (0, _graphql.isCompositeType)(type2.ofType.ofType)) { - return insertSuffix; - } - } - return null; - }, "getInsertText"); - function getSuggestionsForTypeSystemDefinitions(token2) { - return hintList(token2, [{ - label: "extend", - kind: CompletionItemKind.Function - }, { - label: "type", - kind: CompletionItemKind.Function - }, { - label: "interface", - kind: CompletionItemKind.Function - }, { - label: "union", - kind: CompletionItemKind.Function - }, { - label: "input", - kind: CompletionItemKind.Function - }, { - label: "scalar", - kind: CompletionItemKind.Function - }, { - label: "schema", - kind: CompletionItemKind.Function - }]); - } - __name(getSuggestionsForTypeSystemDefinitions, "getSuggestionsForTypeSystemDefinitions"); - function getSuggestionsForExecutableDefinitions(token2) { - return hintList(token2, [{ - label: "query", - kind: CompletionItemKind.Function - }, { - label: "mutation", - kind: CompletionItemKind.Function - }, { - label: "subscription", - kind: CompletionItemKind.Function - }, { - label: "fragment", - kind: CompletionItemKind.Function - }, { - label: "{", - kind: CompletionItemKind.Constructor - }]); - } - __name(getSuggestionsForExecutableDefinitions, "getSuggestionsForExecutableDefinitions"); - function getSuggestionsForExtensionDefinitions(token2) { - return hintList(token2, [{ - label: "type", - kind: CompletionItemKind.Function - }, { - label: "interface", - kind: CompletionItemKind.Function - }, { - label: "union", - kind: CompletionItemKind.Function - }, { - label: "input", - kind: CompletionItemKind.Function - }, { - label: "scalar", - kind: CompletionItemKind.Function - }, { - label: "schema", - kind: CompletionItemKind.Function - }]); - } - __name(getSuggestionsForExtensionDefinitions, "getSuggestionsForExtensionDefinitions"); - function getSuggestionsForFieldNames(token2, typeInfo, options) { - var _a; - if (typeInfo.parentType) { - const { - parentType - } = typeInfo; - let fields = []; - if ("getFields" in parentType) { - fields = objectValues(parentType.getFields()); - } - if ((0, _graphql.isCompositeType)(parentType)) { - fields.push(_graphql.TypeNameMetaFieldDef); - } - if (parentType === ((_a = options === null || options === void 0 ? void 0 : options.schema) === null || _a === void 0 ? void 0 : _a.getQueryType())) { - fields.push(_graphql.SchemaMetaFieldDef, _graphql.TypeMetaFieldDef); - } - return hintList(token2, fields.map((field, index) => { - var _a2; - const suggestion = { - sortText: String(index) + field.name, - label: field.name, - detail: String(field.type), - documentation: (_a2 = field.description) !== null && _a2 !== void 0 ? _a2 : void 0, - deprecated: Boolean(field.deprecationReason), - isDeprecated: Boolean(field.deprecationReason), - deprecationReason: field.deprecationReason, - kind: CompletionItemKind.Field, - type: field.type - }; - if (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) { - const insertText = getInsertText(field); - if (insertText) { - suggestion.insertText = field.name + insertText; - suggestion.insertTextFormat = InsertTextFormat.Snippet; - suggestion.command = SuggestionCommand; - } - } - return suggestion; - })); - } - return []; - } - __name(getSuggestionsForFieldNames, "getSuggestionsForFieldNames"); - function getSuggestionsForInputValues(token2, typeInfo, queryText, schema) { - const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); - const queryVariables = getVariableCompletions(queryText, schema, token2).filter(v2 => v2.detail === namedInputType.name); - if (namedInputType instanceof _graphql.GraphQLEnumType) { - const values = namedInputType.getValues(); - return hintList(token2, values.map(value3 => { - var _a; - return { - label: value3.name, - detail: String(namedInputType), - documentation: (_a = value3.description) !== null && _a !== void 0 ? _a : void 0, - deprecated: Boolean(value3.deprecationReason), - isDeprecated: Boolean(value3.deprecationReason), - deprecationReason: value3.deprecationReason, - kind: CompletionItemKind.EnumMember, - type: namedInputType - }; - }).concat(queryVariables)); - } - if (namedInputType === _graphql.GraphQLBoolean) { - return hintList(token2, queryVariables.concat([{ - label: "true", - detail: String(_graphql.GraphQLBoolean), - documentation: "Not false.", - kind: CompletionItemKind.Variable, - type: _graphql.GraphQLBoolean - }, { - label: "false", - detail: String(_graphql.GraphQLBoolean), - documentation: "Not true.", - kind: CompletionItemKind.Variable, - type: _graphql.GraphQLBoolean - }])); - } - return queryVariables; - } - __name(getSuggestionsForInputValues, "getSuggestionsForInputValues"); - function getSuggestionsForImplements(token2, tokenState, schema, documentText, typeInfo) { - if (tokenState.needsSeparator) { - return []; - } - const typeMap = schema.getTypeMap(); - const schemaInterfaces = objectValues(typeMap).filter(_graphql.isInterfaceType); - const schemaInterfaceNames = schemaInterfaces.map(_ref66 => { - let { - name: name2 - } = _ref66; - return name2; - }); - const inlineInterfaces = /* @__PURE__ */new Set(); - runOnlineParser(documentText, (_, state2) => { - var _a, _b, _c, _d, _e; - if (state2.name) { - if (state2.kind === RuleKinds.INTERFACE_DEF && !schemaInterfaceNames.includes(state2.name)) { - inlineInterfaces.add(state2.name); - } - if (state2.kind === RuleKinds.NAMED_TYPE && ((_a = state2.prevState) === null || _a === void 0 ? void 0 : _a.kind) === RuleKinds.IMPLEMENTS) { - if (typeInfo.interfaceDef) { - const existingType = (_b = typeInfo.interfaceDef) === null || _b === void 0 ? void 0 : _b.getInterfaces().find(_ref67 => { - let { - name: name2 - } = _ref67; - return name2 === state2.name; - }); - if (existingType) { - return; - } - const type2 = schema.getType(state2.name); - const interfaceConfig = (_c = typeInfo.interfaceDef) === null || _c === void 0 ? void 0 : _c.toConfig(); - typeInfo.interfaceDef = new _graphql.GraphQLInterfaceType(Object.assign(Object.assign({}, interfaceConfig), { - interfaces: [...interfaceConfig.interfaces, type2 || new _graphql.GraphQLInterfaceType({ - name: state2.name, - fields: {} - })] - })); - } else if (typeInfo.objectTypeDef) { - const existingType = (_d = typeInfo.objectTypeDef) === null || _d === void 0 ? void 0 : _d.getInterfaces().find(_ref68 => { - let { - name: name2 - } = _ref68; - return name2 === state2.name; - }); - if (existingType) { - return; - } - const type2 = schema.getType(state2.name); - const objectTypeConfig = (_e = typeInfo.objectTypeDef) === null || _e === void 0 ? void 0 : _e.toConfig(); - typeInfo.objectTypeDef = new _graphql.GraphQLObjectType(Object.assign(Object.assign({}, objectTypeConfig), { - interfaces: [...objectTypeConfig.interfaces, type2 || new _graphql.GraphQLInterfaceType({ - name: state2.name, - fields: {} - })] - })); - } - } - } - }); - const currentTypeToExtend = typeInfo.interfaceDef || typeInfo.objectTypeDef; - const siblingInterfaces = (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.getInterfaces()) || []; - const siblingInterfaceNames = siblingInterfaces.map(_ref69 => { - let { - name: name2 - } = _ref69; - return name2; - }); - const possibleInterfaces = schemaInterfaces.concat([...inlineInterfaces].map(name2 => ({ - name: name2 - }))).filter(_ref70 => { - let { - name: name2 - } = _ref70; - return name2 !== (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.name) && !siblingInterfaceNames.includes(name2); - }); - return hintList(token2, possibleInterfaces.map(type2 => { - const result = { - label: type2.name, - kind: CompletionItemKind.Interface, - type: type2 - }; - if (type2 === null || type2 === void 0 ? void 0 : type2.description) { - result.documentation = type2.description; - } - return result; - })); - } - __name(getSuggestionsForImplements, "getSuggestionsForImplements"); - function getSuggestionsForFragmentTypeConditions(token2, typeInfo, schema, _kind) { - let possibleTypes; - if (typeInfo.parentType) { - if ((0, _graphql.isAbstractType)(typeInfo.parentType)) { - const abstractType = (0, _graphql.assertAbstractType)(typeInfo.parentType); - const possibleObjTypes = schema.getPossibleTypes(abstractType); - const possibleIfaceMap = /* @__PURE__ */Object.create(null); - possibleObjTypes.forEach(type2 => { - type2.getInterfaces().forEach(iface => { - possibleIfaceMap[iface.name] = iface; - }); - }); - possibleTypes = possibleObjTypes.concat(objectValues(possibleIfaceMap)); - } else { - possibleTypes = [typeInfo.parentType]; - } - } else { - const typeMap = schema.getTypeMap(); - possibleTypes = objectValues(typeMap).filter(type2 => (0, _graphql.isCompositeType)(type2) && !type2.name.startsWith("__")); - } - return hintList(token2, possibleTypes.map(type2 => { - const namedType = (0, _graphql.getNamedType)(type2); - return { - label: String(type2), - documentation: (namedType === null || namedType === void 0 ? void 0 : namedType.description) || "", - kind: CompletionItemKind.Field - }; - })); - } - __name(getSuggestionsForFragmentTypeConditions, "getSuggestionsForFragmentTypeConditions"); - function getSuggestionsForFragmentSpread(token2, typeInfo, schema, queryText, fragmentDefs) { - if (!queryText) { - return []; - } - const typeMap = schema.getTypeMap(); - const defState = getDefinitionState(token2.state); - const fragments = getFragmentDefinitions(queryText); - if (fragmentDefs && fragmentDefs.length > 0) { - fragments.push(...fragmentDefs); - } - const relevantFrags = fragments.filter(frag => typeMap[frag.typeCondition.name.value] && !(defState && defState.kind === RuleKinds.FRAGMENT_DEFINITION && defState.name === frag.name.value) && (0, _graphql.isCompositeType)(typeInfo.parentType) && (0, _graphql.isCompositeType)(typeMap[frag.typeCondition.name.value]) && (0, _graphql.doTypesOverlap)(schema, typeInfo.parentType, typeMap[frag.typeCondition.name.value])); - return hintList(token2, relevantFrags.map(frag => ({ - label: frag.name.value, - detail: String(typeMap[frag.typeCondition.name.value]), - documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`, - kind: CompletionItemKind.Field, - type: typeMap[frag.typeCondition.name.value] - }))); - } - __name(getSuggestionsForFragmentSpread, "getSuggestionsForFragmentSpread"); - const getParentDefinition = /* @__PURE__ */__name((state2, kind) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; - if (((_a = state2.prevState) === null || _a === void 0 ? void 0 : _a.kind) === kind) { - return state2.prevState; - } - if (((_c = (_b = state2.prevState) === null || _b === void 0 ? void 0 : _b.prevState) === null || _c === void 0 ? void 0 : _c.kind) === kind) { - return state2.prevState.prevState; - } - if (((_f = (_e = (_d = state2.prevState) === null || _d === void 0 ? void 0 : _d.prevState) === null || _e === void 0 ? void 0 : _e.prevState) === null || _f === void 0 ? void 0 : _f.kind) === kind) { - return state2.prevState.prevState.prevState; - } - if (((_k = (_j = (_h = (_g = state2.prevState) === null || _g === void 0 ? void 0 : _g.prevState) === null || _h === void 0 ? void 0 : _h.prevState) === null || _j === void 0 ? void 0 : _j.prevState) === null || _k === void 0 ? void 0 : _k.kind) === kind) { - return state2.prevState.prevState.prevState.prevState; - } - }, "getParentDefinition"); - function getVariableCompletions(queryText, schema, token2) { - let variableName = null; - let variableType; - const definitions = /* @__PURE__ */Object.create({}); - runOnlineParser(queryText, (_, state2) => { - if ((state2 === null || state2 === void 0 ? void 0 : state2.kind) === RuleKinds.VARIABLE && state2.name) { - variableName = state2.name; - } - if ((state2 === null || state2 === void 0 ? void 0 : state2.kind) === RuleKinds.NAMED_TYPE && variableName) { - const parentDefinition = getParentDefinition(state2, RuleKinds.TYPE); - if (parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type) { - variableType = schema.getType(parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type); - } - } - if (variableName && variableType && !definitions[variableName]) { - definitions[variableName] = { - detail: variableType.toString(), - insertText: token2.string === "$" ? variableName : "$" + variableName, - label: variableName, - type: variableType, - kind: CompletionItemKind.Variable - }; - variableName = null; - variableType = null; - } - }); - return objectValues(definitions); - } - __name(getVariableCompletions, "getVariableCompletions"); - function getFragmentDefinitions(queryText) { - const fragmentDefs = []; - runOnlineParser(queryText, (_, state2) => { - if (state2.kind === RuleKinds.FRAGMENT_DEFINITION && state2.name && state2.type) { - fragmentDefs.push({ - kind: RuleKinds.FRAGMENT_DEFINITION, - name: { - kind: _graphql.Kind.NAME, - value: state2.name - }, - selectionSet: { - kind: RuleKinds.SELECTION_SET, - selections: [] - }, - typeCondition: { - kind: RuleKinds.NAMED_TYPE, - name: { - kind: _graphql.Kind.NAME, - value: state2.type - } - } - }); - } - }); - return fragmentDefs; - } - __name(getFragmentDefinitions, "getFragmentDefinitions"); - function getSuggestionsForVariableDefinition(token2, schema, _kind) { - const inputTypeMap = schema.getTypeMap(); - const inputTypes = objectValues(inputTypeMap).filter(_graphql.isInputType); - return hintList(token2, inputTypes.map(type2 => ({ - label: type2.name, - documentation: type2.description, - kind: CompletionItemKind.Variable - }))); - } - __name(getSuggestionsForVariableDefinition, "getSuggestionsForVariableDefinition"); - function getSuggestionsForDirective(token2, state2, schema, _kind) { - var _a; - if ((_a = state2.prevState) === null || _a === void 0 ? void 0 : _a.kind) { - const directives = schema.getDirectives().filter(directive2 => canUseDirective(state2.prevState, directive2)); - return hintList(token2, directives.map(directive2 => ({ - label: directive2.name, - documentation: directive2.description || "", - kind: CompletionItemKind.Function - }))); - } - return []; - } - __name(getSuggestionsForDirective, "getSuggestionsForDirective"); - function getTokenAtPosition(queryText, cursor) { - let styleAtCursor = null; - let stateAtCursor = null; - let stringAtCursor = null; - const token2 = runOnlineParser(queryText, (stream, state2, style2, index) => { - if (index === cursor.line && stream.getCurrentPosition() >= cursor.character) { - styleAtCursor = style2; - stateAtCursor = Object.assign({}, state2); - stringAtCursor = stream.current(); - return "BREAK"; - } - }); - return { - start: token2.start, - end: token2.end, - string: stringAtCursor || token2.string, - state: stateAtCursor || token2.state, - style: styleAtCursor || token2.style - }; - } - __name(getTokenAtPosition, "getTokenAtPosition"); - function runOnlineParser(queryText, callback) { - const lines = queryText.split("\n"); - const parser = onlineParser(); - let state2 = parser.startState(); - let style2 = ""; - let stream = new CharacterStream(""); - for (let i = 0; i < lines.length; i++) { - stream = new CharacterStream(lines[i]); - while (!stream.eol()) { - style2 = parser.token(stream, state2); - const code3 = callback(stream, state2, style2, i); - if (code3 === "BREAK") { - break; - } - } - callback(stream, state2, style2, i); - if (!state2.kind) { - state2 = parser.startState(); - } - } - return { - start: stream.getStartOfToken(), - end: stream.getCurrentPosition(), - string: stream.current(), - state: state2, - style: style2 - }; - } - __name(runOnlineParser, "runOnlineParser"); - function canUseDirective(state2, directive2) { - if (!state2 || !state2.kind) { - return false; - } - const { - kind, - prevState - } = state2; - const { - locations - } = directive2; - switch (kind) { - case RuleKinds.QUERY: - return locations.includes(_graphql.DirectiveLocation.QUERY); - case RuleKinds.MUTATION: - return locations.includes(_graphql.DirectiveLocation.MUTATION); - case RuleKinds.SUBSCRIPTION: - return locations.includes(_graphql.DirectiveLocation.SUBSCRIPTION); - case RuleKinds.FIELD: - case RuleKinds.ALIASED_FIELD: - return locations.includes(_graphql.DirectiveLocation.FIELD); - case RuleKinds.FRAGMENT_DEFINITION: - return locations.includes(_graphql.DirectiveLocation.FRAGMENT_DEFINITION); - case RuleKinds.FRAGMENT_SPREAD: - return locations.includes(_graphql.DirectiveLocation.FRAGMENT_SPREAD); - case RuleKinds.INLINE_FRAGMENT: - return locations.includes(_graphql.DirectiveLocation.INLINE_FRAGMENT); - case RuleKinds.SCHEMA_DEF: - return locations.includes(_graphql.DirectiveLocation.SCHEMA); - case RuleKinds.SCALAR_DEF: - return locations.includes(_graphql.DirectiveLocation.SCALAR); - case RuleKinds.OBJECT_TYPE_DEF: - return locations.includes(_graphql.DirectiveLocation.OBJECT); - case RuleKinds.FIELD_DEF: - return locations.includes(_graphql.DirectiveLocation.FIELD_DEFINITION); - case RuleKinds.INTERFACE_DEF: - return locations.includes(_graphql.DirectiveLocation.INTERFACE); - case RuleKinds.UNION_DEF: - return locations.includes(_graphql.DirectiveLocation.UNION); - case RuleKinds.ENUM_DEF: - return locations.includes(_graphql.DirectiveLocation.ENUM); - case RuleKinds.ENUM_VALUE: - return locations.includes(_graphql.DirectiveLocation.ENUM_VALUE); - case RuleKinds.INPUT_DEF: - return locations.includes(_graphql.DirectiveLocation.INPUT_OBJECT); - case RuleKinds.INPUT_VALUE_DEF: - const prevStateKind = prevState === null || prevState === void 0 ? void 0 : prevState.kind; - switch (prevStateKind) { - case RuleKinds.ARGUMENTS_DEF: - return locations.includes(_graphql.DirectiveLocation.ARGUMENT_DEFINITION); - case RuleKinds.INPUT_DEF: - return locations.includes(_graphql.DirectiveLocation.INPUT_FIELD_DEFINITION); - } - } - return false; - } - __name(canUseDirective, "canUseDirective"); - function getTypeInfo(schema, tokenState) { - let argDef; - let argDefs; - let directiveDef; - let enumValue; - let fieldDef; - let inputType; - let objectTypeDef; - let objectFieldDefs; - let parentType; - let type2; - let interfaceDef; - forEachState(tokenState, state2 => { - var _a; - switch (state2.kind) { - case RuleKinds.QUERY: - case "ShortQuery": - type2 = schema.getQueryType(); - break; - case RuleKinds.MUTATION: - type2 = schema.getMutationType(); - break; - case RuleKinds.SUBSCRIPTION: - type2 = schema.getSubscriptionType(); - break; - case RuleKinds.INLINE_FRAGMENT: - case RuleKinds.FRAGMENT_DEFINITION: - if (state2.type) { - type2 = schema.getType(state2.type); - } - break; - case RuleKinds.FIELD: - case RuleKinds.ALIASED_FIELD: - { - if (!type2 || !state2.name) { - fieldDef = null; - } else { - fieldDef = parentType ? getFieldDef(schema, parentType, state2.name) : null; - type2 = fieldDef ? fieldDef.type : null; - } - break; - } - case RuleKinds.SELECTION_SET: - parentType = (0, _graphql.getNamedType)(type2); - break; - case RuleKinds.DIRECTIVE: - directiveDef = state2.name ? schema.getDirective(state2.name) : null; - break; - case RuleKinds.INTERFACE_DEF: - if (state2.name) { - objectTypeDef = null; - interfaceDef = new _graphql.GraphQLInterfaceType({ - name: state2.name, - interfaces: [], - fields: {} - }); - } - break; - case RuleKinds.OBJECT_TYPE_DEF: - if (state2.name) { - interfaceDef = null; - objectTypeDef = new _graphql.GraphQLObjectType({ - name: state2.name, - interfaces: [], - fields: {} - }); - } - break; - case RuleKinds.ARGUMENTS: - { - if (state2.prevState) { - switch (state2.prevState.kind) { - case RuleKinds.FIELD: - argDefs = fieldDef && fieldDef.args; - break; - case RuleKinds.DIRECTIVE: - argDefs = directiveDef && directiveDef.args; - break; - case RuleKinds.ALIASED_FIELD: - { - const name2 = (_a = state2.prevState) === null || _a === void 0 ? void 0 : _a.name; - if (!name2) { - argDefs = null; - break; - } - const field = parentType ? getFieldDef(schema, parentType, name2) : null; - if (!field) { - argDefs = null; - break; - } - argDefs = field.args; - break; - } - default: - argDefs = null; - break; - } - } else { - argDefs = null; - } - break; - } - case RuleKinds.ARGUMENT: - if (argDefs) { - for (let i = 0; i < argDefs.length; i++) { - if (argDefs[i].name === state2.name) { - argDef = argDefs[i]; - break; - } - } - } - inputType = argDef === null || argDef === void 0 ? void 0 : argDef.type; - break; - case RuleKinds.ENUM_VALUE: - const enumType = (0, _graphql.getNamedType)(inputType); - enumValue = enumType instanceof _graphql.GraphQLEnumType ? enumType.getValues().find(val => val.value === state2.name) : null; - break; - case RuleKinds.LIST_VALUE: - const nullableType = (0, _graphql.getNullableType)(inputType); - inputType = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; - break; - case RuleKinds.OBJECT_VALUE: - const objectType = (0, _graphql.getNamedType)(inputType); - objectFieldDefs = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; - break; - case RuleKinds.OBJECT_FIELD: - const objectField = state2.name && objectFieldDefs ? objectFieldDefs[state2.name] : null; - inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; - break; - case RuleKinds.NAMED_TYPE: - if (state2.name) { - type2 = schema.getType(state2.name); - } - break; - } - }); - return { - argDef, - argDefs, - directiveDef, - enumValue, - fieldDef, - inputType, - objectFieldDefs, - parentType, - type: type2, - interfaceDef, - objectTypeDef - }; - } - __name(getTypeInfo, "getTypeInfo"); - var GraphQLDocumentMode; - (function (GraphQLDocumentMode2) { - GraphQLDocumentMode2["TYPE_SYSTEM"] = "TYPE_SYSTEM"; - GraphQLDocumentMode2["EXECUTABLE"] = "EXECUTABLE"; - })(GraphQLDocumentMode || (GraphQLDocumentMode = {})); - function getDocumentMode(documentText, uri) { - if (uri === null || uri === void 0 ? void 0 : uri.endsWith(".graphqls")) { - return GraphQLDocumentMode.TYPE_SYSTEM; - } - return hasTypeSystemDefinitions(documentText) ? GraphQLDocumentMode.TYPE_SYSTEM : GraphQLDocumentMode.EXECUTABLE; - } - __name(getDocumentMode, "getDocumentMode"); - function unwrapType(state2) { - if (state2.prevState && state2.kind && [RuleKinds.NAMED_TYPE, RuleKinds.LIST_TYPE, RuleKinds.TYPE, RuleKinds.NON_NULL_TYPE].includes(state2.kind)) { - return unwrapType(state2.prevState); - } - return state2; - } - __name(unwrapType, "unwrapType"); - var nullthrows$2 = { - exports: {} - }; - function nullthrows(x2, message) { - if (x2 != null) { - return x2; - } - var error2 = new Error(message !== void 0 ? message : "Got unexpected " + x2); - error2.framesToPop = 1; - throw error2; - } - __name(nullthrows, "nullthrows"); - nullthrows$2.exports = nullthrows; - nullthrows$2.exports.default = nullthrows; - Object.defineProperty(nullthrows$2.exports, "__esModule", { - value: true - }); - var nullthrows$1 = /* @__PURE__ */getDefaultExportFromCjs(nullthrows$2.exports); - const getFragmentDependenciesForAST = /* @__PURE__ */__name((parsedOperation, fragmentDefinitions) => { - if (!fragmentDefinitions) { - return []; - } - const existingFrags = /* @__PURE__ */new Map(); - const referencedFragNames = /* @__PURE__ */new Set(); - (0, _graphql.visit)(parsedOperation, { - FragmentDefinition(node) { - existingFrags.set(node.name.value, true); - }, - FragmentSpread(node) { - if (!referencedFragNames.has(node.name.value)) { - referencedFragNames.add(node.name.value); - } - } - }); - const asts = /* @__PURE__ */new Set(); - referencedFragNames.forEach(name2 => { - if (!existingFrags.has(name2) && fragmentDefinitions.has(name2)) { - asts.add(nullthrows$1(fragmentDefinitions.get(name2))); - } - }); - const referencedFragments = []; - asts.forEach(ast2 => { - (0, _graphql.visit)(ast2, { - FragmentSpread(node) { - if (!referencedFragNames.has(node.name.value) && fragmentDefinitions.get(node.name.value)) { - asts.add(nullthrows$1(fragmentDefinitions.get(node.name.value))); - referencedFragNames.add(node.name.value); - } - } - }); - if (!existingFrags.has(ast2.name.value)) { - referencedFragments.push(ast2); - } - }); - return referencedFragments; - }, "getFragmentDependenciesForAST"); - function collectVariables(schema, documentAST) { - const variableToType = /* @__PURE__ */Object.create(null); - documentAST.definitions.forEach(definition => { - if (definition.kind === "OperationDefinition") { - const { - variableDefinitions - } = definition; - if (variableDefinitions) { - variableDefinitions.forEach(_ref71 => { - let { - variable, - type: type2 - } = _ref71; - const inputType = (0, _graphql.typeFromAST)(schema, type2); - if (inputType) { - variableToType[variable.name.value] = inputType; - } else if (type2.kind === _graphql.Kind.NAMED_TYPE && type2.name.value === "Float") { - variableToType[variable.name.value] = _graphql.GraphQLFloat; - } - }); - } - } - }); - return variableToType; - } - __name(collectVariables, "collectVariables"); - function getOperationASTFacts(documentAST, schema) { - const variableToType = schema ? collectVariables(schema, documentAST) : void 0; - const operations = []; - (0, _graphql.visit)(documentAST, { - OperationDefinition(node) { - operations.push(node); - } - }); - return { - variableToType, - operations - }; - } - __name(getOperationASTFacts, "getOperationASTFacts"); - function getOperationFacts(schema, documentString) { - if (!documentString) { - return; - } - try { - const documentAST = (0, _graphql.parse)(documentString); - return Object.assign(Object.assign({}, getOperationASTFacts(documentAST, schema)), { - documentAST - }); - } catch (_a) { - return; - } - } - __name(getOperationFacts, "getOperationFacts"); - globalThis && globalThis.__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value3) { - return value3 instanceof P ? value3 : new P(function (resolve) { - resolve(value3); - }); - } - __name(adopt, "adopt"); - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value3) { - try { - step(generator.next(value3)); - } catch (e2) { - reject(e2); - } - } - __name(fulfilled, "fulfilled"); - function rejected(value3) { - try { - step(generator["throw"](value3)); - } catch (e2) { - reject(e2); - } - } - __name(rejected, "rejected"); - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - __name(step, "step"); - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - /*! - * is-primitive - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - var isPrimitive$1 = /* @__PURE__ */__name(function isPrimitive(val) { - if (typeof val === "object") { - return val === null; - } - return typeof val !== "function"; - }, "isPrimitive"); - /*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - var isobject = /* @__PURE__ */__name(function isObject(val) { - return val != null && typeof val === "object" && Array.isArray(val) === false; - }, "isObject"); - /*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - var isObject$2 = isobject; - function isObjectObject(o2) { - return isObject$2(o2) === true && Object.prototype.toString.call(o2) === "[object Object]"; - } - __name(isObjectObject, "isObjectObject"); - var isPlainObject$1 = /* @__PURE__ */__name(function isPlainObject(o2) { - var ctor, prot; - if (isObjectObject(o2) === false) return false; - ctor = o2.constructor; - if (typeof ctor !== "function") return false; - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - if (prot.hasOwnProperty("isPrototypeOf") === false) { - return false; - } - return true; - }, "isPlainObject"); - /*! - * set-value - * - * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert). - * Released under the MIT License. - */ - const { - deleteProperty - } = Reflect; - const isPrimitive2 = isPrimitive$1; - const isPlainObject2 = isPlainObject$1; - const isObject$1 = /* @__PURE__ */__name(value3 => { - return typeof value3 === "object" && value3 !== null || typeof value3 === "function"; - }, "isObject$1"); - const isUnsafeKey = /* @__PURE__ */__name(key => { - return key === "__proto__" || key === "constructor" || key === "prototype"; - }, "isUnsafeKey"); - const validateKey = /* @__PURE__ */__name(key => { - if (!isPrimitive2(key)) { - throw new TypeError("Object keys must be strings or symbols"); - } - if (isUnsafeKey(key)) { - throw new Error(`Cannot set unsafe key: "${key}"`); - } - }, "validateKey"); - const toStringKey = /* @__PURE__ */__name(input => { - return Array.isArray(input) ? input.flat().map(String).join(",") : input; - }, "toStringKey"); - const createMemoKey = /* @__PURE__ */__name((input, options) => { - if (typeof input !== "string" || !options) return input; - let key = input + ";"; - if (options.arrays !== void 0) key += `arrays=${options.arrays};`; - if (options.separator !== void 0) key += `separator=${options.separator};`; - if (options.split !== void 0) key += `split=${options.split};`; - if (options.merge !== void 0) key += `merge=${options.merge};`; - if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`; - return key; - }, "createMemoKey"); - const memoize = /* @__PURE__ */__name((input, options, fn) => { - const key = toStringKey(options ? createMemoKey(input, options) : input); - validateKey(key); - const value3 = setValue.cache.get(key) || fn(); - setValue.cache.set(key, value3); - return value3; - }, "memoize"); - const splitString = /* @__PURE__ */__name(function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const sep = options.separator || "."; - const preserve = sep === "/" ? false : options.preservePaths; - if (typeof input === "string" && preserve !== false && /\//.test(input)) { - return [input]; - } - const parts = []; - let part2 = ""; - const push = /* @__PURE__ */__name(part3 => { - let number; - if (part3.trim() !== "" && Number.isInteger(number = Number(part3))) { - parts.push(number); - } else { - parts.push(part3); - } - }, "push"); - for (let i = 0; i < input.length; i++) { - const value3 = input[i]; - if (value3 === "\\") { - part2 += input[++i]; - continue; - } - if (value3 === sep) { - push(part2); - part2 = ""; - continue; - } - part2 += value3; - } - if (part2) { - push(part2); - } - return parts; - }, "splitString"); - const split = /* @__PURE__ */__name((input, options) => { - if (options && typeof options.split === "function") return options.split(input); - if (typeof input === "symbol") return [input]; - if (Array.isArray(input)) return input; - return memoize(input, options, () => splitString(input, options)); - }, "split"); - const assignProp = /* @__PURE__ */__name((obj, prop2, value3, options) => { - validateKey(prop2); - if (value3 === void 0) { - deleteProperty(obj, prop2); - } else if (options && options.merge) { - const merge = options.merge === "function" ? options.merge : Object.assign; - if (merge && isPlainObject2(obj[prop2]) && isPlainObject2(value3)) { - obj[prop2] = merge(obj[prop2], value3); - } else { - obj[prop2] = value3; - } - } else { - obj[prop2] = value3; - } - return obj; - }, "assignProp"); - const setValue = /* @__PURE__ */__name((target2, path, value3, options) => { - if (!path || !isObject$1(target2)) return target2; - const keys = split(path, options); - let obj = target2; - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const next = keys[i + 1]; - validateKey(key); - if (next === void 0) { - assignProp(obj, key, value3, options); - break; - } - if (typeof next === "number" && !Array.isArray(obj[key])) { - obj = obj[key] = []; - continue; - } - if (!isObject$1(obj[key])) { - obj[key] = {}; - } - obj = obj[key]; - } - return target2; - }, "setValue"); - setValue.split = split; - setValue.cache = /* @__PURE__ */new Map(); - setValue.clear = () => { - setValue.cache = /* @__PURE__ */new Map(); - }; - var setValue_1 = setValue; - function SvgArgument(_a) { - var _b = _a, - { - title, - titleId - } = _b, - props2 = __objRest(_b, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("rect", { - x: 6, - y: 6, - width: 2, - height: 2, - rx: 1, - fill: "currentColor" - })); - } - __name(SvgArgument, "SvgArgument"); - function SvgChevronDown(_c) { - var _d = _c, - { - title, - titleId - } = _d, - props2 = __objRest(_d, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 9", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M1 1L7 7L13 1", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgChevronDown, "SvgChevronDown"); - function SvgChevronLeft(_e) { - var _f = _e, - { - title, - titleId - } = _f, - props2 = __objRest(_f, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 7 10", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M6 1.04819L2 5.04819L6 9.04819", - stroke: "currentColor", - strokeWidth: 1.75 - })); - } - __name(SvgChevronLeft, "SvgChevronLeft"); - function SvgChevronUp(_g) { - var _h = _g, - { - title, - titleId - } = _h, - props2 = __objRest(_h, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 9", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M13 8L7 2L1 8", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgChevronUp, "SvgChevronUp"); - function SvgClose(_i) { - var _j = _i, - { - title, - titleId - } = _j, - props2 = __objRest(_j, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M1 1L12.9998 12.9997", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - d: "M13 1L1.00079 13.0003", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgClose, "SvgClose"); - function SvgCopy(_k) { - var _l = _k, - { - title, - titleId - } = _l, - props2 = __objRest(_l, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "-2 -2 22 22", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M11.25 14.2105V15.235C11.25 16.3479 10.3479 17.25 9.23501 17.25H2.76499C1.65214 17.25 0.75 16.3479 0.75 15.235L0.75 8.76499C0.75 7.65214 1.65214 6.75 2.76499 6.75L3.78947 6.75", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("rect", { - x: 6.75, - y: 0.75, - width: 10.5, - height: 10.5, - rx: 2.2069, - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgCopy, "SvgCopy"); - function SvgDeprecatedArgument(_m) { - var _n = _m, - { - title, - titleId - } = _n, - props2 = __objRest(_n, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M5 9L9 5", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M5 5L9 9", - stroke: "currentColor", - strokeWidth: 1.2 - })); - } - __name(SvgDeprecatedArgument, "SvgDeprecatedArgument"); - function SvgDeprecatedEnumValue(_o) { - var _p = _o, - { - title, - titleId - } = _p, - props2 = __objRest(_p, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 12 12", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M4 8L8 4", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M4 4L8 8", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z", - fill: "currentColor" - })); - } - __name(SvgDeprecatedEnumValue, "SvgDeprecatedEnumValue"); - function SvgDeprecatedField(_q) { - var _r = _q, - { - title, - titleId - } = _r, - props2 = __objRest(_r, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 12 12", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 0.6, - y: 0.6, - width: 10.8, - height: 10.8, - rx: 3.4, - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M4 8L8 4", - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M4 4L8 8", - stroke: "currentColor", - strokeWidth: 1.2 - })); - } - __name(SvgDeprecatedField, "SvgDeprecatedField"); - function SvgDirective(_s) { - var _t = _s, - { - title, - titleId - } = _t, - props2 = __objRest(_t, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0.5 12 12", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 7, - y: 5.5, - width: 2, - height: 2, - rx: 1, - transform: "rotate(90 7 5.5)", - fill: "currentColor" - }), /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M10.8 9L10.8 9.5C10.8 10.4941 9.99411 11.3 9 11.3L3 11.3C2.00589 11.3 1.2 10.4941 1.2 9.5L1.2 9L-3.71547e-07 9L-3.93402e-07 9.5C-4.65826e-07 11.1569 1.34314 12.5 3 12.5L9 12.5C10.6569 12.5 12 11.1569 12 9.5L12 9L10.8 9ZM10.8 4L12 4L12 3.5C12 1.84315 10.6569 0.5 9 0.5L3 0.5C1.34315 0.5 -5.87117e-08 1.84315 -1.31135e-07 3.5L-1.5299e-07 4L1.2 4L1.2 3.5C1.2 2.50589 2.00589 1.7 3 1.7L9 1.7C9.99411 1.7 10.8 2.50589 10.8 3.5L10.8 4Z", - fill: "currentColor" - })); - } - __name(SvgDirective, "SvgDirective"); - function SvgDocsFilled(_u) { - var _v = _u, - { - title, - titleId - } = _v, - props2 = __objRest(_v, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 20 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H17.25C17.8023 0.75 18.25 1.19772 18.25 1.75V5.25", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - d: "M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H18.25C18.8023 5.25 19.25 5.69771 19.25 6.25V22.25C19.25 22.8023 18.8023 23.25 18.25 23.25H3C1.75736 23.25 0.75 22.2426 0.75 21V3Z", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M3 5.25C1.75736 5.25 0.75 4.24264 0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H3ZM13 11L6 11V12.5L13 12.5V11Z", - fill: "currentColor" - })); - } - __name(SvgDocsFilled, "SvgDocsFilled"); - function SvgDocs(_w) { - var _x = _w, - { - title, - titleId - } = _x, - props2 = __objRest(_x, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 20 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H17.25M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H16.25C16.8023 0.75 17.25 1.19772 17.25 1.75V5.25M0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H17.25", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("line", { - x1: 13, - y1: 11.75, - x2: 6, - y2: 11.75, - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgDocs, "SvgDocs"); - function SvgEnumValue(_y) { - var _z = _y, - { - title, - titleId - } = _z, - props2 = __objRest(_z, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 12 12", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 5, - y: 5, - width: 2, - height: 2, - rx: 1, - fill: "currentColor" - }), /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z", - fill: "currentColor" - })); - } - __name(SvgEnumValue, "SvgEnumValue"); - function SvgField(_A) { - var _B = _A, - { - title, - titleId - } = _B, - props2 = __objRest(_B, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 12 13", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 0.6, - y: 1.1, - width: 10.8, - height: 10.8, - rx: 2.4, - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("rect", { - x: 5, - y: 5.5, - width: 2, - height: 2, - rx: 1, - fill: "currentColor" - })); - } - __name(SvgField, "SvgField"); - function SvgHistory(_C) { - var _D = _C, - { - title, - titleId - } = _D, - props2 = __objRest(_D, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 24 20", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M1.59375 9.52344L4.87259 12.9944L8.07872 9.41249", - stroke: "currentColor", - strokeWidth: 1.5, - strokeLinecap: "square" - }), /* @__PURE__ */React.createElement("path", { - d: "M13.75 5.25V10.75H18.75", - stroke: "currentColor", - strokeWidth: 1.5, - strokeLinecap: "square" - }), /* @__PURE__ */React.createElement("path", { - d: "M4.95427 11.9332C4.55457 10.0629 4.74441 8.11477 5.49765 6.35686C6.25089 4.59894 7.5305 3.11772 9.16034 2.11709C10.7902 1.11647 12.6901 0.645626 14.5986 0.769388C16.5071 0.893151 18.3303 1.60543 19.8172 2.80818C21.3042 4.01093 22.3818 5.64501 22.9017 7.48548C23.4216 9.32595 23.3582 11.2823 22.7203 13.0853C22.0824 14.8883 20.9013 16.4492 19.3396 17.5532C17.778 18.6572 15.9125 19.25 14 19.25", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgHistory, "SvgHistory"); - function SvgImplements(_E) { - var _F = _E, - { - title, - titleId - } = _F, - props2 = __objRest(_F, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 12 12", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("circle", { - cx: 6, - cy: 6, - r: 5.4, - stroke: "currentColor", - strokeWidth: 1.2, - strokeDasharray: "4.241025 4.241025", - transform: "rotate(22.5)", - "transform-origin": "center" - }), /* @__PURE__ */React.createElement("circle", { - cx: 6, - cy: 6, - r: 1, - fill: "currentColor" - })); - } - __name(SvgImplements, "SvgImplements"); - function SvgKeyboardShortcut(_G) { - var _H = _G, - { - title, - titleId - } = _H, - props2 = __objRest(_H, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 19 18", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M1.5 14.5653C1.5 15.211 1.75652 15.8303 2.21314 16.2869C2.66975 16.7435 3.28905 17 3.9348 17C4.58054 17 5.19984 16.7435 5.65646 16.2869C6.11307 15.8303 6.36959 15.211 6.36959 14.5653V12.1305H3.9348C3.28905 12.1305 2.66975 12.387 2.21314 12.8437C1.75652 13.3003 1.5 13.9195 1.5 14.5653Z", - stroke: "currentColor", - strokeWidth: 1.125, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M3.9348 1.00063C3.28905 1.00063 2.66975 1.25715 2.21314 1.71375C1.75652 2.17035 1.5 2.78964 1.5 3.43537C1.5 4.0811 1.75652 4.70038 2.21314 5.15698C2.66975 5.61358 3.28905 5.8701 3.9348 5.8701H6.36959V3.43537C6.36959 2.78964 6.11307 2.17035 5.65646 1.71375C5.19984 1.25715 4.58054 1.00063 3.9348 1.00063Z", - stroke: "currentColor", - strokeWidth: 1.125, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M15.0652 12.1305H12.6304V14.5653C12.6304 15.0468 12.7732 15.5175 13.0407 15.9179C13.3083 16.3183 13.6885 16.6304 14.1334 16.8147C14.5783 16.9989 15.0679 17.0472 15.5402 16.9532C16.0125 16.8593 16.4464 16.6274 16.7869 16.2869C17.1274 15.9464 17.3593 15.5126 17.4532 15.0403C17.5472 14.568 17.4989 14.0784 17.3147 13.6335C17.1304 13.1886 16.8183 12.8084 16.4179 12.5409C16.0175 12.2733 15.5468 12.1305 15.0652 12.1305Z", - stroke: "currentColor", - strokeWidth: 1.125, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M12.6318 5.86775H6.36955V12.1285H12.6318V5.86775Z", - stroke: "currentColor", - strokeWidth: 1.125, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M17.5 3.43473C17.5 2.789 17.2435 2.16972 16.7869 1.71312C16.3303 1.25652 15.711 1 15.0652 1C14.4195 1 13.8002 1.25652 13.3435 1.71312C12.8869 2.16972 12.6304 2.789 12.6304 3.43473V5.86946H15.0652C15.711 5.86946 16.3303 5.61295 16.7869 5.15635C17.2435 4.69975 17.5 4.08046 17.5 3.43473Z", - stroke: "currentColor", - strokeWidth: 1.125, - strokeLinecap: "round", - strokeLinejoin: "round" - })); - } - __name(SvgKeyboardShortcut, "SvgKeyboardShortcut"); - function SvgMagnifyingGlass(_I) { - var _J = _I, - { - title, - titleId - } = _J, - props2 = __objRest(_J, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 13 13", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("circle", { - cx: 5, - cy: 5, - r: 4.35, - stroke: "currentColor", - strokeWidth: 1.3 - }), /* @__PURE__ */React.createElement("line", { - x1: 8.45962, - y1: 8.54038, - x2: 11.7525, - y2: 11.8333, - stroke: "currentColor", - strokeWidth: 1.3 - })); - } - __name(SvgMagnifyingGlass, "SvgMagnifyingGlass"); - function SvgMerge(_K) { - var _L = _K, - { - title, - titleId - } = _L, - props2 = __objRest(_L, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "-2 -2 22 22", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M17.2492 6V2.9569C17.2492 1.73806 16.2611 0.75 15.0423 0.75L2.9569 0.75C1.73806 0.75 0.75 1.73806 0.75 2.9569L0.75 6", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - d: "M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - d: "M6 4.5L9 7.5L12 4.5", - stroke: "currentColor", - strokeWidth: 1.5 - }), /* @__PURE__ */React.createElement("path", { - d: "M12 13.5L9 10.5L6 13.5", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgMerge, "SvgMerge"); - function SvgPen(_M) { - var _N = _M, - { - title, - titleId - } = _N, - props2 = __objRest(_N, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z", - fill: "currentColor" - }), /* @__PURE__ */React.createElement("path", { - d: "M11.5 4.5L9.5 2.5", - stroke: "currentColor", - strokeWidth: 1.4026, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M5.5 10.5L3.5 8.5", - stroke: "currentColor", - strokeWidth: 1.4026, - strokeLinecap: "round", - strokeLinejoin: "round" - })); - } - __name(SvgPen, "SvgPen"); - function SvgPlay(_O) { - var _P = _O, - { - title, - titleId - } = _P, - props2 = __objRest(_P, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 16 18", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z", - fill: "currentColor" - })); - } - __name(SvgPlay, "SvgPlay"); - function SvgPlus(_Q) { - var _R = _Q, - { - title, - titleId - } = _R, - props2 = __objRest(_R, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 10 16", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z", - fill: "currentColor" - })); - } - __name(SvgPlus, "SvgPlus"); - function SvgPrettify(_S) { - var _T = _S, - { - title, - titleId - } = _T, - props2 = __objRest(_T, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - width: 25, - height: 25, - viewBox: "0 0 25 25", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M10.2852 24.0745L13.7139 18.0742", - stroke: "currentColor", - strokeWidth: 1.5625 - }), /* @__PURE__ */React.createElement("path", { - d: "M14.5742 24.0749L17.1457 19.7891", - stroke: "currentColor", - strokeWidth: 1.5625 - }), /* @__PURE__ */React.createElement("path", { - d: "M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735", - stroke: "currentColor", - strokeWidth: 1.5625 - }), /* @__PURE__ */React.createElement("path", { - d: "M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z", - stroke: "currentColor", - strokeWidth: 1.5625, - strokeLinejoin: "round" - }), /* @__PURE__ */React.createElement("path", { - d: "M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z", - stroke: "currentColor", - strokeWidth: 1.5625, - strokeLinejoin: "round" - })); - } - __name(SvgPrettify, "SvgPrettify"); - function SvgReload(_U) { - var _V = _U, - { - title, - titleId - } = _V, - props2 = __objRest(_V, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 16 16", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M4.75 9.25H1.25V12.75", - stroke: "currentColor", - strokeWidth: 1, - strokeLinecap: "square" - }), /* @__PURE__ */React.createElement("path", { - d: "M11.25 6.75H14.75V3.25", - stroke: "currentColor", - strokeWidth: 1, - strokeLinecap: "square" - }), /* @__PURE__ */React.createElement("path", { - d: "M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513", - stroke: "currentColor", - strokeWidth: 1 - }), /* @__PURE__ */React.createElement("path", { - d: "M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487", - stroke: "currentColor", - strokeWidth: 1 - })); - } - __name(SvgReload, "SvgReload"); - function SvgRootType(_W) { - var _X = _W, - { - title, - titleId - } = _X, - props2 = __objRest(_X, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 13 13", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 0.6, - y: 0.6, - width: 11.8, - height: 11.8, - rx: 5.9, - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("path", { - d: "M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5", - stroke: "currentColor", - strokeWidth: 1.2 - })); - } - __name(SvgRootType, "SvgRootType"); - function SvgSettings(_Y) { - var _Z = _Y, - { - title, - titleId - } = _Z, - props2 = __objRest(_Z, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 21 20", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z", - fill: "currentColor" - })); - } - __name(SvgSettings, "SvgSettings"); - function SvgStarFilled(__) { - var _$ = __, - { - title, - titleId - } = _$, - props2 = __objRest(_$, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", - fill: "currentColor", - stroke: "currentColor" - })); - } - __name(SvgStarFilled, "SvgStarFilled"); - function SvgStar(_aa) { - var _ba = _aa, - { - title, - titleId - } = _ba, - props2 = __objRest(_ba, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("path", { - d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", - stroke: "currentColor", - strokeWidth: 1.5 - })); - } - __name(SvgStar, "SvgStar"); - function SvgStop(_ca) { - var _da = _ca, - { - title, - titleId - } = _da, - props2 = __objRest(_da, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 16 16", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - width: 16, - height: 16, - rx: 2, - fill: "currentColor" - })); - } - __name(SvgStop, "SvgStop"); - function SvgType(_ea) { - var _fa = _ea, - { - title, - titleId - } = _fa, - props2 = __objRest(_fa, ["title", "titleId"]); - return /* @__PURE__ */React.createElement("svg", Object.assign({ - height: "1em", - viewBox: "0 0 13 13", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - "aria-labelledby": titleId - }, props2), title ? /* @__PURE__ */React.createElement("title", { - id: titleId - }, title) : null, /* @__PURE__ */React.createElement("rect", { - x: 0.6, - y: 0.6, - width: 11.8, - height: 11.8, - rx: 5.9, - stroke: "currentColor", - strokeWidth: 1.2 - }), /* @__PURE__ */React.createElement("rect", { - x: 5.5, - y: 5.5, - width: 2, - height: 2, - rx: 1, - fill: "currentColor" - })); - } - __name(SvgType, "SvgType"); - var __defProp$E = Object.defineProperty; - var __name$E = /* @__PURE__ */__name((target2, value3) => __defProp$E(target2, "name", { - value: value3, - configurable: true - }), "__name$E"); - const ArgumentIcon = generateIcon(SvgArgument, "argument icon"); - _exports.ac = ArgumentIcon; - const ChevronDownIcon = generateIcon(SvgChevronDown, "chevron down icon"); - _exports.ad = ChevronDownIcon; - const ChevronLeftIcon = generateIcon(SvgChevronLeft, "chevron left icon"); - _exports.ae = ChevronLeftIcon; - const ChevronUpIcon = generateIcon(SvgChevronUp, "chevron up icon"); - _exports.af = ChevronUpIcon; - const CloseIcon = generateIcon(SvgClose, "close icon"); - _exports.ag = CloseIcon; - const CopyIcon = generateIcon(SvgCopy, "copy icon"); - _exports.ah = CopyIcon; - const DeprecatedArgumentIcon = generateIcon(SvgDeprecatedArgument, "deprecated argument icon"); - _exports.ai = DeprecatedArgumentIcon; - const DeprecatedEnumValueIcon = generateIcon(SvgDeprecatedEnumValue, "deprecated enum value icon"); - _exports.aj = DeprecatedEnumValueIcon; - const DeprecatedFieldIcon = generateIcon(SvgDeprecatedField, "deprecated field icon"); - _exports.ak = DeprecatedFieldIcon; - const DirectiveIcon = generateIcon(SvgDirective, "directive icon"); - _exports.al = DirectiveIcon; - const DocsFilledIcon = generateIcon(SvgDocsFilled, "filled docs icon"); - _exports.am = DocsFilledIcon; - const DocsIcon = generateIcon(SvgDocs, "docs icon"); - _exports.an = DocsIcon; - const EnumValueIcon = generateIcon(SvgEnumValue, "enum value icon"); - _exports.ao = EnumValueIcon; - const FieldIcon = generateIcon(SvgField, "field icon"); - _exports.ap = FieldIcon; - const HistoryIcon = generateIcon(SvgHistory, "history icon"); - _exports.aq = HistoryIcon; - const ImplementsIcon = generateIcon(SvgImplements, "implements icon"); - _exports.ar = ImplementsIcon; - const KeyboardShortcutIcon = generateIcon(SvgKeyboardShortcut, "keyboard shortcut icon"); - _exports.as = KeyboardShortcutIcon; - const MagnifyingGlassIcon = generateIcon(SvgMagnifyingGlass, "magnifying glass icon"); - _exports.at = MagnifyingGlassIcon; - const MergeIcon = generateIcon(SvgMerge, "merge icon"); - _exports.au = MergeIcon; - const PenIcon = generateIcon(SvgPen, "pen icon"); - _exports.av = PenIcon; - const PlayIcon = generateIcon(SvgPlay, "play icon"); - _exports.aw = PlayIcon; - const PlusIcon = generateIcon(SvgPlus, "plus icon"); - _exports.ax = PlusIcon; - const PrettifyIcon = generateIcon(SvgPrettify, "prettify icon"); - _exports.ay = PrettifyIcon; - const ReloadIcon = generateIcon(SvgReload, "reload icon"); - _exports.az = ReloadIcon; - const RootTypeIcon = generateIcon(SvgRootType, "root type icon"); - _exports.aA = RootTypeIcon; - const SettingsIcon = generateIcon(SvgSettings, "settings icon"); - _exports.aB = SettingsIcon; - const StarFilledIcon = generateIcon(SvgStarFilled, "filled star icon"); - _exports.aC = StarFilledIcon; - const StarIcon = generateIcon(SvgStar, "star icon"); - _exports.aD = StarIcon; - const StopIcon = generateIcon(SvgStop, "stop icon"); - _exports.aE = StopIcon; - const TypeIcon = generateIcon(SvgType, "type icon"); - _exports.aF = TypeIcon; - function generateIcon(RawComponent, title) { - const WithTitle = /* @__PURE__ */__name$E( /* @__PURE__ */__name(function IconComponent(props2) { - return /* @__PURE__ */jsx(RawComponent, __spreadProps(__spreadValues({}, props2), { - title - })); - }, "IconComponent"), "IconComponent"); - Object.defineProperty(WithTitle, "name", { - value: RawComponent.name - }); - return WithTitle; - } - __name(generateIcon, "generateIcon"); - __name$E(generateIcon, "generateIcon"); - var button$1 = /* @__PURE__ */(() => ".graphiql-un-styled,button.graphiql-un-styled{all:unset;border-radius:var(--border-radius-4);cursor:pointer}:is(.graphiql-un-styled,button.graphiql-un-styled):hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}:is(.graphiql-un-styled,button.graphiql-un-styled):active{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}:is(.graphiql-un-styled,button.graphiql-un-styled):focus{outline:hsla(var(--color-neutral),var(--alpha-background-heavy)) auto 1px}.graphiql-button,button.graphiql-button{background-color:hsla(var(--color-neutral),var(--alpha-background-light));border:none;border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),1);cursor:pointer;font-size:var(--font-size-body);padding:var(--px-8) var(--px-12)}:is(.graphiql-button,button.graphiql-button):hover,:is(.graphiql-button,button.graphiql-button):active{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}:is(.graphiql-button,button.graphiql-button):focus{outline:hsla(var(--color-neutral),var(--alpha-background-heavy)) auto 1px}.graphiql-button-success:is(.graphiql-button,button.graphiql-button){background-color:hsla(var(--color-success),var(--alpha-background-heavy))}.graphiql-button-error:is(.graphiql-button,button.graphiql-button){background-color:hsla(var(--color-error),var(--alpha-background-heavy))}\n")(); - const UnStyledButton = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx("button", __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-un-styled", props2.className) - }))); - _exports.aG = UnStyledButton; - UnStyledButton.displayName = "UnStyledButton"; - const Button = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx("button", __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-button", { - success: "graphiql-button-success", - error: "graphiql-button-error" - }[props2.state], props2.className) - }))); - _exports.aH = Button; - Button.displayName = "Button"; - var buttonGroup = /* @__PURE__ */(() => ".graphiql-button-group{background-color:hsla(var(--color-neutral),var(--alpha-background-light));border-radius:calc(var(--border-radius-4) + var(--px-4));display:flex;padding:var(--px-4)}.graphiql-button-group>button.graphiql-button{background-color:transparent}.graphiql-button-group>button.graphiql-button:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}.graphiql-button-group>button.graphiql-button.active{background-color:hsl(var(--color-base));cursor:default}.graphiql-button-group>*+*{margin-left:var(--px-8)}\n")(); - const ButtonGroup = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx("div", __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-button-group", props2.className) - }))); - _exports.aI = ButtonGroup; - ButtonGroup.displayName = "ButtonGroup"; - function canUseDOM() { - return !!(typeof window !== "undefined" && window.document && window.document.createElement); - } - __name(canUseDOM, "canUseDOM"); - var useIsomorphicLayoutEffect = /* @__PURE__ */canUseDOM() ? React.useLayoutEffect : React.useEffect; - function useForceUpdate() { - var _useState = (0, React.useState)( /* @__PURE__ */Object.create(null)), - dispatch = _useState[1]; - return (0, React.useCallback)(function () { - dispatch( /* @__PURE__ */Object.create(null)); - }, []); - } - __name(useForceUpdate, "useForceUpdate"); - function _objectWithoutPropertiesLoose$b(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$b, "_objectWithoutPropertiesLoose$b"); - var _excluded$a = ["unstable_skipInitialRender"]; - var PortalImpl = /* @__PURE__ */__name(function PortalImpl2(_ref2) { - var children = _ref2.children, - _ref$type = _ref2.type, - type2 = _ref$type === void 0 ? "reach-portal" : _ref$type, - containerRef = _ref2.containerRef; - var mountNode = (0, React.useRef)(null); - var portalNode = (0, React.useRef)(null); - var forceUpdate = useForceUpdate(); - useIsomorphicLayoutEffect(function () { - if (!mountNode.current) return; - var ownerDocument = mountNode.current.ownerDocument; - var body = (containerRef == null ? void 0 : containerRef.current) || ownerDocument.body; - portalNode.current = ownerDocument == null ? void 0 : ownerDocument.createElement(type2); - body.appendChild(portalNode.current); - forceUpdate(); - return function () { - if (portalNode.current && body) { - body.removeChild(portalNode.current); - } - }; - }, [type2, forceUpdate, containerRef]); - return portalNode.current ? /* @__PURE__ */(0, _reactDom.createPortal)(children, portalNode.current) : /* @__PURE__ */(0, React.createElement)("span", { - ref: mountNode - }); - }, "PortalImpl"); - var Portal = /* @__PURE__ */__name(function Portal2(_ref2) { - var unstable_skipInitialRender = _ref2.unstable_skipInitialRender, - props2 = _objectWithoutPropertiesLoose$b(_ref2, _excluded$a); - var _React$useState = (0, React.useState)(false), - hydrated = _React$useState[0], - setHydrated = _React$useState[1]; - (0, React.useEffect)(function () { - if (unstable_skipInitialRender) { - setHydrated(true); - } - }, [unstable_skipInitialRender]); - if (unstable_skipInitialRender && !hydrated) { - return null; - } - return /* @__PURE__ */(0, React.createElement)(PortalImpl, props2); - }, "Portal"); - function getOwnerDocument(element) { - return canUseDOM() ? element ? element.ownerDocument : document : null; - } - __name(getOwnerDocument, "getOwnerDocument"); - function isBoolean(value3) { - return typeof value3 === "boolean"; - } - __name(isBoolean, "isBoolean"); - function isFunction$1(value3) { - return !!(value3 && {}.toString.call(value3) == "[object Function]"); - } - __name(isFunction$1, "isFunction$1"); - function isString$1(value3) { - return typeof value3 === "string"; - } - __name(isString$1, "isString$1"); - function noop() {} - __name(noop, "noop"); - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - __name(_arrayLikeToArray, "_arrayLikeToArray"); - function _unsupportedIterableToArray(o2, minLen) { - if (!o2) return; - if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); - var n2 = Object.prototype.toString.call(o2).slice(8, -1); - if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; - if (n2 === "Map" || n2 === "Set") return Array.from(o2); - if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen); - } - __name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); - function _createForOfIteratorHelperLoose(o2, allowArrayLike) { - var it2; - if (typeof Symbol === "undefined" || o2[Symbol.iterator] == null) { - if (Array.isArray(o2) || (it2 = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") { - if (it2) o2 = it2; - var i = 0; - return function () { - if (i >= o2.length) return { - done: true - }; - return { - done: false, - value: o2[i++] - }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - it2 = o2[Symbol.iterator](); - return it2.next.bind(it2); - } - __name(_createForOfIteratorHelperLoose, "_createForOfIteratorHelperLoose"); - function assignRef$1(ref, value3) { - if (ref == null) return; - if (isFunction$1(ref)) { - ref(value3); - } else { - try { - ref.current = value3; - } catch (error2) { - throw new Error('Cannot assign value "' + value3 + '" to ref "' + ref + '"'); - } - } - } - __name(assignRef$1, "assignRef$1"); - function useComposedRefs() { - for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { - refs[_key] = arguments[_key]; - } - return (0, React.useCallback)(function (node) { - for (var _iterator = _createForOfIteratorHelperLoose(refs), _step; !(_step = _iterator()).done;) { - var ref = _step.value; - assignRef$1(ref, node); - } - }, refs); - } - __name(useComposedRefs, "useComposedRefs"); - function composeEventHandlers(theirHandler, ourHandler) { - return function (event) { - theirHandler && theirHandler(event); - if (!event.defaultPrevented) { - return ourHandler(event); - } - }; - } - __name(composeEventHandlers, "composeEventHandlers"); - function _objectWithoutPropertiesLoose$a(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$a, "_objectWithoutPropertiesLoose$a"); - function _extends$a() { - _extends$a = Object.assign ? Object.assign.bind() : function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$a.apply(this, arguments); - } - __name(_extends$a, "_extends$a"); - var ReactPropTypesSecret$3 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - var ReactPropTypesSecret_1$1 = ReactPropTypesSecret$3; - var ReactPropTypesSecret$2 = ReactPropTypesSecret_1$1; - function emptyFunction$1() {} - __name(emptyFunction$1, "emptyFunction$1"); - function emptyFunctionWithReset$1() {} - __name(emptyFunctionWithReset$1, "emptyFunctionWithReset$1"); - emptyFunctionWithReset$1.resetWarningCache = emptyFunction$1; - var factoryWithThrowingShims$1 = /* @__PURE__ */__name(function () { - function shim(props2, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret$2) { - return; - } - var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"); - err.name = "Invariant Violation"; - throw err; - } - __name(shim, "shim"); - shim.isRequired = shim; - function getShim() { - return shim; - } - __name(getShim, "getShim"); - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - checkPropTypes: emptyFunctionWithReset$1, - resetWarningCache: emptyFunction$1 - }; - ReactPropTypes.PropTypes = ReactPropTypes; - return ReactPropTypes; - }, "factoryWithThrowingShims$1"); - { - factoryWithThrowingShims$1(); - } - var FOCUS_GROUP = "data-focus-lock"; - var FOCUS_DISABLED = "data-focus-lock-disabled"; - var FOCUS_ALLOW = "data-no-focus-lock"; - var FOCUS_AUTO = "data-autofocus-inside"; - var FOCUS_NO_AUTOFOCUS = "data-no-autofocus"; - function assignRef(ref, value3) { - if (typeof ref === "function") { - ref(value3); - } else if (ref) { - ref.current = value3; - } - return ref; - } - __name(assignRef, "assignRef"); - function useCallbackRef(initialValue, callback) { - var ref = (0, React.useState)(function () { - return { - value: initialValue, - callback, - facade: { - get current() { - return ref.value; - }, - set current(value3) { - var last = ref.value; - if (last !== value3) { - ref.value = value3; - ref.callback(value3, last); - } - } - } - }; - })[0]; - ref.callback = callback; - return ref.facade; - } - __name(useCallbackRef, "useCallbackRef"); - function useMergeRefs(refs, defaultValue2) { - return useCallbackRef(defaultValue2 || null, function (newValue) { - return refs.forEach(function (ref) { - return assignRef(ref, newValue); - }); - }); - } - __name(useMergeRefs, "useMergeRefs"); - var hiddenGuard = { - width: "1px", - height: "0px", - padding: 0, - overflow: "hidden", - position: "fixed", - top: "1px", - left: "1px" - }; - var __assign = /* @__PURE__ */__name(function () { - __assign = Object.assign || /* @__PURE__ */__name(function __assign2(t2) { - for (var s2, i = 1, n2 = arguments.length; i < n2; i++) { - s2 = arguments[i]; - for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; - } - return t2; - }, "__assign"); - return __assign.apply(this, arguments); - }, "__assign"); - function __rest(s2, e2) { - var t2 = {}; - for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; - if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s2); i < p2.length; i++) { - if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i])) t2[p2[i]] = s2[p2[i]]; - } - return t2; - } - __name(__rest, "__rest"); - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l2 = from.length, ar; i < l2; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - __name(__spreadArray, "__spreadArray"); - function ItoI(a2) { - return a2; - } - __name(ItoI, "ItoI"); - function innerCreateMedium(defaults, middleware) { - if (middleware === void 0) { - middleware = ItoI; - } - var buffer = []; - var assigned = false; - var medium = { - read: function () { - if (assigned) { - throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); - } - if (buffer.length) { - return buffer[buffer.length - 1]; - } - return defaults; - }, - useMedium: function (data) { - var item = middleware(data, assigned); - buffer.push(item); - return function () { - buffer = buffer.filter(function (x2) { - return x2 !== item; - }); - }; - }, - assignSyncMedium: function (cb) { - assigned = true; - while (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); - } - buffer = { - push: function (x2) { - return cb(x2); - }, - filter: function () { - return buffer; - } - }; - }, - assignMedium: function (cb) { - assigned = true; - var pendingQueue = []; - if (buffer.length) { - var cbs = buffer; - buffer = []; - cbs.forEach(cb); - pendingQueue = buffer; - } - var executeQueue = /* @__PURE__ */__name(function () { - var cbs2 = pendingQueue; - pendingQueue = []; - cbs2.forEach(cb); - }, "executeQueue"); - var cycle = /* @__PURE__ */__name(function () { - return Promise.resolve().then(executeQueue); - }, "cycle"); - cycle(); - buffer = { - push: function (x2) { - pendingQueue.push(x2); - cycle(); - }, - filter: function (filter) { - pendingQueue = pendingQueue.filter(filter); - return buffer; - } - }; - } - }; - return medium; - } - __name(innerCreateMedium, "innerCreateMedium"); - function createMedium(defaults, middleware) { - if (middleware === void 0) { - middleware = ItoI; - } - return innerCreateMedium(defaults, middleware); - } - __name(createMedium, "createMedium"); - function createSidecarMedium(options) { - if (options === void 0) { - options = {}; - } - var medium = innerCreateMedium(null); - medium.options = __assign({ - async: true, - ssr: false - }, options); - return medium; - } - __name(createSidecarMedium, "createSidecarMedium"); - var SideCar$1 = /* @__PURE__ */__name(function (_a) { - var sideCar = _a.sideCar, - rest = __rest(_a, ["sideCar"]); - if (!sideCar) { - throw new Error("Sidecar: please provide `sideCar` property to import the right car"); - } - var Target = sideCar.read(); - if (!Target) { - throw new Error("Sidecar medium not found"); - } - return /*#__PURE__*/React.createElement(Target, __assign({}, rest)); - }, "SideCar$1"); - SideCar$1.isSideCarExport = true; - function exportSidecar(medium, exported) { - medium.useMedium(exported); - return SideCar$1; - } - __name(exportSidecar, "exportSidecar"); - var mediumFocus = createMedium({}, function (_ref2) { - var target2 = _ref2.target, - currentTarget = _ref2.currentTarget; - return { - target: target2, - currentTarget - }; - }); - var mediumBlur = createMedium(); - var mediumEffect = createMedium(); - var mediumSidecar = createSidecarMedium({ - async: true - }); - var emptyArray = []; - var FocusLock$1 = /* @__PURE__ */React.forwardRef( /* @__PURE__ */__name(function FocusLockUI(props2, parentRef) { - var _extends2; - var _React$useState = React.useState(), - realObserved = _React$useState[0], - setObserved = _React$useState[1]; - var observed = React.useRef(); - var isActive = React.useRef(false); - var originalFocusedElement = React.useRef(null); - var children = props2.children, - disabled = props2.disabled, - noFocusGuards = props2.noFocusGuards, - persistentFocus = props2.persistentFocus, - crossFrame = props2.crossFrame, - autoFocus = props2.autoFocus; - props2.allowTextSelection; - var group = props2.group, - className = props2.className, - whiteList = props2.whiteList, - hasPositiveIndices = props2.hasPositiveIndices, - _props$shards = props2.shards, - shards = _props$shards === void 0 ? emptyArray : _props$shards, - _props$as = props2.as, - Container = _props$as === void 0 ? "div" : _props$as, - _props$lockProps = props2.lockProps, - containerProps = _props$lockProps === void 0 ? {} : _props$lockProps, - SideCar2 = props2.sideCar, - shouldReturnFocus = props2.returnFocus, - focusOptions = props2.focusOptions, - onActivationCallback = props2.onActivation, - onDeactivationCallback = props2.onDeactivation; - var _React$useState2 = React.useState({}), - id2 = _React$useState2[0]; - var onActivation = React.useCallback(function () { - originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement; - if (observed.current && onActivationCallback) { - onActivationCallback(observed.current); - } - isActive.current = true; - }, [onActivationCallback]); - var onDeactivation = React.useCallback(function () { - isActive.current = false; - if (onDeactivationCallback) { - onDeactivationCallback(observed.current); - } - }, [onDeactivationCallback]); - (0, React.useEffect)(function () { - if (!disabled) { - originalFocusedElement.current = null; - } - }, []); - var returnFocus = React.useCallback(function (allowDefer) { - var returnFocusTo = originalFocusedElement.current; - if (returnFocusTo && returnFocusTo.focus) { - var howToReturnFocus = typeof shouldReturnFocus === "function" ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus; - if (howToReturnFocus) { - var returnFocusOptions = typeof howToReturnFocus === "object" ? howToReturnFocus : void 0; - originalFocusedElement.current = null; - if (allowDefer) { - Promise.resolve().then(function () { - return returnFocusTo.focus(returnFocusOptions); - }); - } else { - returnFocusTo.focus(returnFocusOptions); - } - } - } - }, [shouldReturnFocus]); - var onFocus3 = React.useCallback(function (event) { - if (isActive.current) { - mediumFocus.useMedium(event); - } - }, []); - var onBlur3 = mediumBlur.useMedium; - var setObserveNode = React.useCallback(function (newObserved) { - if (observed.current !== newObserved) { - observed.current = newObserved; - setObserved(newObserved); - } - }, []); - var lockProps = _extends$a((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && "disabled", _extends2[FOCUS_GROUP] = group, _extends2), containerProps); - var hasLeadingGuards = noFocusGuards !== true; - var hasTailingGuards = hasLeadingGuards && noFocusGuards !== "tail"; - var mergedRef = useMergeRefs([parentRef, setObserveNode]); - return /* @__PURE__ */React.createElement(React.Fragment, null, hasLeadingGuards && [/* @__PURE__ */React.createElement("div", { - key: "guard-first", - "data-focus-guard": true, - tabIndex: disabled ? -1 : 0, - style: hiddenGuard - }), hasPositiveIndices ? /* @__PURE__ */React.createElement("div", { - key: "guard-nearest", - "data-focus-guard": true, - tabIndex: disabled ? -1 : 1, - style: hiddenGuard - }) : null], !disabled && /* @__PURE__ */React.createElement(SideCar2, { - id: id2, - sideCar: mediumSidecar, - observed: realObserved, - disabled, - persistentFocus, - crossFrame, - autoFocus, - whiteList, - shards, - onActivation, - onDeactivation, - returnFocus, - focusOptions - }), /* @__PURE__ */React.createElement(Container, _extends$a({ - ref: mergedRef - }, lockProps, { - className, - onBlur: onBlur3, - onFocus: onFocus3 - }), children), hasTailingGuards && /* @__PURE__ */React.createElement("div", { - "data-focus-guard": true, - tabIndex: disabled ? -1 : 0, - style: hiddenGuard - })); - }, "FocusLockUI")); - FocusLock$1.propTypes = {}; - FocusLock$1.defaultProps = { - children: void 0, - disabled: false, - returnFocus: false, - focusOptions: void 0, - noFocusGuards: false, - autoFocus: true, - persistentFocus: false, - crossFrame: true, - hasPositiveIndices: void 0, - allowTextSelection: void 0, - group: void 0, - className: void 0, - whiteList: void 0, - shards: void 0, - as: "div", - lockProps: {}, - onActivation: void 0, - onDeactivation: void 0 - }; - var FocusLockUI2 = FocusLock$1; - function _setPrototypeOf(o2, p2) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */__name(function _setPrototypeOf2(o3, p3) { - o3.__proto__ = p3; - return o3; - }, "_setPrototypeOf"); - return _setPrototypeOf(o2, p2); - } - __name(_setPrototypeOf, "_setPrototypeOf"); - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - __name(_inheritsLoose, "_inheritsLoose"); - function _defineProperty(obj, key, value3) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value3, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value3; - } - return obj; - } - __name(_defineProperty, "_defineProperty"); - function withSideEffect(reducePropsToState2, handleStateChangeOnClient2) { - function getDisplayName(WrappedComponent) { - return WrappedComponent.displayName || WrappedComponent.name || "Component"; - } - __name(getDisplayName, "getDisplayName"); - return /* @__PURE__ */__name(function wrap2(WrappedComponent) { - var mountedInstances = []; - var state2; - function emitChange() { - state2 = reducePropsToState2(mountedInstances.map(function (instance) { - return instance.props; - })); - handleStateChangeOnClient2(state2); - } - __name(emitChange, "emitChange"); - var SideEffect = /* @__PURE__ */function (_PureComponent) { - _inheritsLoose(SideEffect2, _PureComponent); - function SideEffect2() { - return _PureComponent.apply(this, arguments) || this; - } - __name(SideEffect2, "SideEffect"); - SideEffect2.peek = /* @__PURE__ */__name(function peek() { - return state2; - }, "peek"); - var _proto = SideEffect2.prototype; - _proto.componentDidMount = /* @__PURE__ */__name(function componentDidMount() { - mountedInstances.push(this); - emitChange(); - }, "componentDidMount"); - _proto.componentDidUpdate = /* @__PURE__ */__name(function componentDidUpdate() { - emitChange(); - }, "componentDidUpdate"); - _proto.componentWillUnmount = /* @__PURE__ */__name(function componentWillUnmount() { - var index = mountedInstances.indexOf(this); - mountedInstances.splice(index, 1); - emitChange(); - }, "componentWillUnmount"); - _proto.render = /* @__PURE__ */__name(function render() { - return /* @__PURE__ */jsx(WrappedComponent, __spreadValues({}, this.props)); - }, "render"); - return SideEffect2; - }(React.PureComponent); - _defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")"); - return SideEffect; - }, "wrap"); - } - __name(withSideEffect, "withSideEffect"); - var toArray = /* @__PURE__ */__name(function (a2) { - var ret = Array(a2.length); - for (var i = 0; i < a2.length; ++i) { - ret[i] = a2[i]; - } - return ret; - }, "toArray"); - var asArray = /* @__PURE__ */__name(function (a2) { - return Array.isArray(a2) ? a2 : [a2]; - }, "asArray"); - var isElementHidden = /* @__PURE__ */__name(function (node) { - if (node.nodeType !== Node.ELEMENT_NODE) { - return false; - } - var computedStyle = window.getComputedStyle(node, null); - if (!computedStyle || !computedStyle.getPropertyValue) { - return false; - } - return computedStyle.getPropertyValue("display") === "none" || computedStyle.getPropertyValue("visibility") === "hidden"; - }, "isElementHidden"); - var getParentNode = /* @__PURE__ */__name(function (node) { - return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.parentNode.host : node.parentNode; - }, "getParentNode"); - var isTopNode = /* @__PURE__ */__name(function (node) { - return node === document || node && node.nodeType === Node.DOCUMENT_NODE; - }, "isTopNode"); - var isVisibleUncached = /* @__PURE__ */__name(function (node, checkParent) { - return !node || isTopNode(node) || !isElementHidden(node) && checkParent(getParentNode(node)); - }, "isVisibleUncached"); - var isVisibleCached = /* @__PURE__ */__name(function (visibilityCache, node) { - var cached = visibilityCache.get(node); - if (cached !== void 0) { - return cached; - } - var result = isVisibleUncached(node, isVisibleCached.bind(void 0, visibilityCache)); - visibilityCache.set(node, result); - return result; - }, "isVisibleCached"); - var isAutoFocusAllowedUncached = /* @__PURE__ */__name(function (node, checkParent) { - return node && !isTopNode(node) ? isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false : true; - }, "isAutoFocusAllowedUncached"); - var isAutoFocusAllowedCached = /* @__PURE__ */__name(function (cache, node) { - var cached = cache.get(node); - if (cached !== void 0) { - return cached; - } - var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(void 0, cache)); - cache.set(node, result); - return result; - }, "isAutoFocusAllowedCached"); - var getDataset = /* @__PURE__ */__name(function (node) { - return node.dataset; - }, "getDataset"); - var isHTMLButtonElement = /* @__PURE__ */__name(function (node) { - return node.tagName === "BUTTON"; - }, "isHTMLButtonElement"); - var isHTMLInputElement = /* @__PURE__ */__name(function (node) { - return node.tagName === "INPUT"; - }, "isHTMLInputElement"); - var isRadioElement = /* @__PURE__ */__name(function (node) { - return isHTMLInputElement(node) && node.type === "radio"; - }, "isRadioElement"); - var notHiddenInput = /* @__PURE__ */__name(function (node) { - return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === "hidden" || node.disabled)); - }, "notHiddenInput"); - var isAutoFocusAllowed = /* @__PURE__ */__name(function (node) { - var attribute2 = node.getAttribute(FOCUS_NO_AUTOFOCUS); - return ![true, "true", ""].includes(attribute2); - }, "isAutoFocusAllowed"); - var isGuard = /* @__PURE__ */__name(function (node) { - var _a; - return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); - }, "isGuard"); - var isNotAGuard = /* @__PURE__ */__name(function (node) { - return !isGuard(node); - }, "isNotAGuard"); - var isDefined = /* @__PURE__ */__name(function (x2) { - return Boolean(x2); - }, "isDefined"); - var tabSort = /* @__PURE__ */__name(function (a2, b2) { - var tabDiff = a2.tabIndex - b2.tabIndex; - var indexDiff = a2.index - b2.index; - if (tabDiff) { - if (!a2.tabIndex) { - return 1; - } - if (!b2.tabIndex) { - return -1; - } - } - return tabDiff || indexDiff; - }, "tabSort"); - var orderByTabIndex = /* @__PURE__ */__name(function (nodes, filterNegative, keepGuards) { - return toArray(nodes).map(function (node, index) { - return { - node, - index, - tabIndex: keepGuards && node.tabIndex === -1 ? (node.dataset || {}).focusGuard ? 0 : -1 : node.tabIndex - }; - }).filter(function (data) { - return !filterNegative || data.tabIndex >= 0; - }).sort(tabSort); - }, "orderByTabIndex"); - var tabbables = ["button:enabled", "select:enabled", "textarea:enabled", "input:enabled", "a[href]", "area[href]", "summary", "iframe", "object", "embed", "audio[controls]", "video[controls]", "[tabindex]", "[contenteditable]", "[autofocus]"]; - var queryTabbables = tabbables.join(","); - var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]"); - var getFocusablesWithShadowDom = /* @__PURE__ */__name(function (parent, withGuards) { - var _a; - return toArray(((_a = parent.shadowRoot) === null || _a === void 0 ? void 0 : _a.children) || parent.children).reduce(function (acc, child) { - return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child)); - }, []); - }, "getFocusablesWithShadowDom"); - var getFocusables = /* @__PURE__ */__name(function (parents, withGuards) { - return parents.reduce(function (acc, parent) { - return acc.concat(getFocusablesWithShadowDom(parent, withGuards), parent.parentNode ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { - return node === parent; - }) : []); - }, []); - }, "getFocusables"); - var getParentAutofocusables = /* @__PURE__ */__name(function (parent) { - var parentFocus = parent.querySelectorAll("[".concat(FOCUS_AUTO, "]")); - return toArray(parentFocus).map(function (node) { - return getFocusables([node]); - }).reduce(function (acc, nodes) { - return acc.concat(nodes); - }, []); - }, "getParentAutofocusables"); - var filterFocusable = /* @__PURE__ */__name(function (nodes, visibilityCache) { - return toArray(nodes).filter(function (node) { - return isVisibleCached(visibilityCache, node); - }).filter(function (node) { - return notHiddenInput(node); - }); - }, "filterFocusable"); - var filterAutoFocusable = /* @__PURE__ */__name(function (nodes, cache) { - if (cache === void 0) { - cache = /* @__PURE__ */new Map(); - } - return toArray(nodes).filter(function (node) { - return isAutoFocusAllowedCached(cache, node); - }); - }, "filterAutoFocusable"); - var getTabbableNodes = /* @__PURE__ */__name(function (topNodes, visibilityCache, withGuards) { - return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards); - }, "getTabbableNodes"); - var getAllTabbableNodes = /* @__PURE__ */__name(function (topNodes, visibilityCache) { - return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false); - }, "getAllTabbableNodes"); - var parentAutofocusables = /* @__PURE__ */__name(function (topNode, visibilityCache) { - return filterFocusable(getParentAutofocusables(topNode), visibilityCache); - }, "parentAutofocusables"); - var contains = /* @__PURE__ */__name(function (scope, element) { - return (scope.shadowRoot ? contains(scope.shadowRoot, element) : Object.getPrototypeOf(scope).contains.call(scope, element)) || toArray(scope.children).some(function (child) { - return contains(child, element); - }); - }, "contains"); - var filterNested = /* @__PURE__ */__name(function (nodes) { - var contained = /* @__PURE__ */new Set(); - var l2 = nodes.length; - for (var i = 0; i < l2; i += 1) { - for (var j = i + 1; j < l2; j += 1) { - var position = nodes[i].compareDocumentPosition(nodes[j]); - if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) { - contained.add(j); - } - if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) { - contained.add(i); - } - } - } - return nodes.filter(function (_, index) { - return !contained.has(index); - }); - }, "filterNested"); - var getTopParent = /* @__PURE__ */__name(function (node) { - return node.parentNode ? getTopParent(node.parentNode) : node; - }, "getTopParent"); - var getAllAffectedNodes = /* @__PURE__ */__name(function (node) { - var nodes = asArray(node); - return nodes.filter(Boolean).reduce(function (acc, currentNode) { - var group = currentNode.getAttribute(FOCUS_GROUP); - acc.push.apply(acc, group ? filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, '="').concat(group, '"]:not([').concat(FOCUS_DISABLED, '="disabled"])')))) : [currentNode]); - return acc; - }, []); - }, "getAllAffectedNodes"); - var getNestedShadowActiveElement = /* @__PURE__ */__name(function (shadowRoot) { - return shadowRoot.activeElement ? shadowRoot.activeElement.shadowRoot ? getNestedShadowActiveElement(shadowRoot.activeElement.shadowRoot) : shadowRoot.activeElement : void 0; - }, "getNestedShadowActiveElement"); - var getActiveElement = /* @__PURE__ */__name(function () { - return document.activeElement ? document.activeElement.shadowRoot ? getNestedShadowActiveElement(document.activeElement.shadowRoot) : document.activeElement : void 0; - }, "getActiveElement"); - var focusInFrame = /* @__PURE__ */__name(function (frame) { - return frame === document.activeElement; - }, "focusInFrame"); - var focusInsideIframe = /* @__PURE__ */__name(function (topNode) { - return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function (node) { - return focusInFrame(node); - })); - }, "focusInsideIframe"); - var focusInside = /* @__PURE__ */__name(function (topNode) { - var activeElement = document && getActiveElement(); - if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) { - return false; - } - return getAllAffectedNodes(topNode).some(function (node) { - return contains(node, activeElement) || focusInsideIframe(node); - }); - }, "focusInside"); - var focusIsHidden = /* @__PURE__ */__name(function () { - var activeElement = document && getActiveElement(); - if (!activeElement) { - return false; - } - return toArray(document.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) { - return contains(node, activeElement); - }); - }, "focusIsHidden"); - var findSelectedRadio = /* @__PURE__ */__name(function (node, nodes) { - return nodes.filter(isRadioElement).filter(function (el2) { - return el2.name === node.name; - }).filter(function (el2) { - return el2.checked; - })[0] || node; - }, "findSelectedRadio"); - var correctNode = /* @__PURE__ */__name(function (node, nodes) { - if (isRadioElement(node) && node.name) { - return findSelectedRadio(node, nodes); - } - return node; - }, "correctNode"); - var correctNodes = /* @__PURE__ */__name(function (nodes) { - var resultSet = /* @__PURE__ */new Set(); - nodes.forEach(function (node) { - return resultSet.add(correctNode(node, nodes)); - }); - return nodes.filter(function (node) { - return resultSet.has(node); - }); - }, "correctNodes"); - var pickFirstFocus = /* @__PURE__ */__name(function (nodes) { - if (nodes[0] && nodes.length > 1) { - return correctNode(nodes[0], nodes); - } - return nodes[0]; - }, "pickFirstFocus"); - var pickFocusable = /* @__PURE__ */__name(function (nodes, index) { - if (nodes.length > 1) { - return nodes.indexOf(correctNode(nodes[index], nodes)); - } - return index; - }, "pickFocusable"); - var NEW_FOCUS = "NEW_FOCUS"; - var newFocus = /* @__PURE__ */__name(function (innerNodes, outerNodes, activeElement, lastNode) { - var cnt = innerNodes.length; - var firstFocus = innerNodes[0]; - var lastFocus = innerNodes[cnt - 1]; - var isOnGuard = isGuard(activeElement); - if (activeElement && innerNodes.indexOf(activeElement) >= 0) { - return void 0; - } - var activeIndex = activeElement !== void 0 ? outerNodes.indexOf(activeElement) : -1; - var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex; - var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1; - var indexDiff = activeIndex - lastIndex; - var firstNodeIndex = outerNodes.indexOf(firstFocus); - var lastNodeIndex = outerNodes.indexOf(lastFocus); - var correctedNodes = correctNodes(outerNodes); - var correctedIndex = activeElement !== void 0 ? correctedNodes.indexOf(activeElement) : -1; - var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex); - var returnFirstNode = pickFocusable(innerNodes, 0); - var returnLastNode = pickFocusable(innerNodes, cnt - 1); - if (activeIndex === -1 || lastNodeInside === -1) { - return NEW_FOCUS; - } - if (!indexDiff && lastNodeInside >= 0) { - return lastNodeInside; - } - if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) { - return returnLastNode; - } - if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) { - return returnFirstNode; - } - if (indexDiff && Math.abs(correctedIndexDiff) > 1) { - return lastNodeInside; - } - if (activeIndex <= firstNodeIndex) { - return returnLastNode; - } - if (activeIndex > lastNodeIndex) { - return returnFirstNode; - } - if (indexDiff) { - if (Math.abs(indexDiff) > 1) { - return lastNodeInside; - } - return (cnt + lastNodeInside + indexDiff) % cnt; - } - return void 0; - }, "newFocus"); - var getParents = /* @__PURE__ */__name(function (node, parents) { - if (parents === void 0) { - parents = []; - } - parents.push(node); - if (node.parentNode) { - getParents(node.parentNode.host || node.parentNode, parents); - } - return parents; - }, "getParents"); - var getCommonParent = /* @__PURE__ */__name(function (nodeA, nodeB) { - var parentsA = getParents(nodeA); - var parentsB = getParents(nodeB); - for (var i = 0; i < parentsA.length; i += 1) { - var currentParent = parentsA[i]; - if (parentsB.indexOf(currentParent) >= 0) { - return currentParent; - } - } - return false; - }, "getCommonParent"); - var getTopCommonParent = /* @__PURE__ */__name(function (baseActiveElement, leftEntry, rightEntries) { - var activeElements = asArray(baseActiveElement); - var leftEntries = asArray(leftEntry); - var activeElement = activeElements[0]; - var topCommon = false; - leftEntries.filter(Boolean).forEach(function (entry) { - topCommon = getCommonParent(topCommon || entry, entry) || topCommon; - rightEntries.filter(Boolean).forEach(function (subEntry) { - var common = getCommonParent(activeElement, subEntry); - if (common) { - if (!topCommon || contains(common, topCommon)) { - topCommon = common; - } else { - topCommon = getCommonParent(common, topCommon); - } - } - }); - }); - return topCommon; - }, "getTopCommonParent"); - var allParentAutofocusables = /* @__PURE__ */__name(function (entries, visibilityCache) { - return entries.reduce(function (acc, node) { - return acc.concat(parentAutofocusables(node, visibilityCache)); - }, []); - }, "allParentAutofocusables"); - var findAutoFocused = /* @__PURE__ */__name(function (autoFocusables) { - return function (node) { - var _a; - return node.autofocus || !!((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus) || autoFocusables.indexOf(node) >= 0; - }; - }, "findAutoFocused"); - var reorderNodes = /* @__PURE__ */__name(function (srcNodes, dstNodes) { - var remap = /* @__PURE__ */new Map(); - dstNodes.forEach(function (entity3) { - return remap.set(entity3.node, entity3); - }); - return srcNodes.map(function (node) { - return remap.get(node); - }).filter(isDefined); - }, "reorderNodes"); - var getFocusMerge = /* @__PURE__ */__name(function (topNode, lastNode) { - var activeElement = document && getActiveElement(); - var entries = getAllAffectedNodes(topNode).filter(isNotAGuard); - var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries); - var visibilityCache = /* @__PURE__ */new Map(); - var anyFocusable = getAllTabbableNodes(entries, visibilityCache); - var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) { - var node = _a.node; - return isNotAGuard(node); - }); - if (!innerElements[0]) { - innerElements = anyFocusable; - if (!innerElements[0]) { - return void 0; - } - } - var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) { - var node = _a.node; - return node; - }); - var orderedInnerElements = reorderNodes(outerNodes, innerElements); - var innerNodes = orderedInnerElements.map(function (_a) { - var node = _a.node; - return node; - }); - var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode); - if (newId === NEW_FOCUS) { - var autoFocusable = filterAutoFocusable(anyFocusable.map(function (_a) { - var node = _a.node; - return node; - })).filter(findAutoFocused(allParentAutofocusables(entries, visibilityCache))); - return { - node: autoFocusable && autoFocusable.length ? pickFirstFocus(autoFocusable) : pickFirstFocus(filterAutoFocusable(innerNodes)) - }; - } - if (newId === void 0) { - return newId; - } - return orderedInnerElements[newId]; - }, "getFocusMerge"); - var getFocusabledIn = /* @__PURE__ */__name(function (topNode) { - var entries = getAllAffectedNodes(topNode).filter(isNotAGuard); - var commonParent = getTopCommonParent(topNode, topNode, entries); - var visibilityCache = /* @__PURE__ */new Map(); - var outerNodes = getTabbableNodes([commonParent], visibilityCache, true); - var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) { - var node = _a.node; - return isNotAGuard(node); - }).map(function (_a) { - var node = _a.node; - return node; - }); - return outerNodes.map(function (_a) { - var node = _a.node, - index = _a.index; - return { - node, - index, - lockItem: innerElements.indexOf(node) >= 0, - guard: isGuard(node) - }; - }); - }, "getFocusabledIn"); - var focusOn = /* @__PURE__ */__name(function (target2, focusOptions) { - if ("focus" in target2) { - target2.focus(focusOptions); - } - if ("contentWindow" in target2 && target2.contentWindow) { - target2.contentWindow.focus(); - } - }, "focusOn"); - var guardCount = 0; - var lockDisabled = false; - var setFocus = /* @__PURE__ */__name(function (topNode, lastNode, options) { - if (options === void 0) { - options = {}; - } - var focusable = getFocusMerge(topNode, lastNode); - if (lockDisabled) { - return; - } - if (focusable) { - if (guardCount > 2) { - console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"); - lockDisabled = true; - setTimeout(function () { - lockDisabled = false; - }, 1); - return; - } - guardCount++; - focusOn(focusable.node, options.focusOptions); - guardCount--; - } - }, "setFocus"); - var moveFocusInside = setFocus; - function deferAction(action) { - var _window = window, - setImmediate = _window.setImmediate; - if (typeof setImmediate !== "undefined") { - setImmediate(action); - } else { - setTimeout(action, 1); - } - } - __name(deferAction, "deferAction"); - var focusOnBody = /* @__PURE__ */__name(function focusOnBody2() { - return document && document.activeElement === document.body; - }, "focusOnBody"); - var isFreeFocus = /* @__PURE__ */__name(function isFreeFocus2() { - return focusOnBody() || focusIsHidden(); - }, "isFreeFocus"); - var lastActiveTrap = null; - var lastActiveFocus = null; - var lastPortaledElement = null; - var focusWasOutsideWindow = false; - var defaultWhitelist = /* @__PURE__ */__name(function defaultWhitelist2() { - return true; - }, "defaultWhitelist"); - var focusWhitelisted = /* @__PURE__ */__name(function focusWhitelisted2(activeElement) { - return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement); - }, "focusWhitelisted"); - var recordPortal = /* @__PURE__ */__name(function recordPortal2(observerNode, portaledElement) { - lastPortaledElement = { - observerNode, - portaledElement - }; - }, "recordPortal"); - var focusIsPortaledPair = /* @__PURE__ */__name(function focusIsPortaledPair2(element) { - return lastPortaledElement && lastPortaledElement.portaledElement === element; - }, "focusIsPortaledPair"); - function autoGuard(startIndex, end, step, allNodes) { - var lastGuard = null; - var i = startIndex; - do { - var item = allNodes[i]; - if (item.guard) { - if (item.node.dataset.focusAutoGuard) { - lastGuard = item; - } - } else if (item.lockItem) { - if (i !== startIndex) { - return; - } - lastGuard = null; - } else { - break; - } - } while ((i += step) !== end); - if (lastGuard) { - lastGuard.node.tabIndex = 0; - } - } - __name(autoGuard, "autoGuard"); - var extractRef$1 = /* @__PURE__ */__name(function extractRef(ref) { - return ref && "current" in ref ? ref.current : ref; - }, "extractRef"); - var focusWasOutside = /* @__PURE__ */__name(function focusWasOutside2(crossFrameOption) { - if (crossFrameOption) { - return Boolean(focusWasOutsideWindow); - } - return focusWasOutsideWindow === "meanwhile"; - }, "focusWasOutside"); - var checkInHost = /* @__PURE__ */__name(function checkInHost2(check2, el2, boundary) { - return el2 && (el2.host === check2 && (!el2.activeElement || boundary.contains(el2.activeElement)) || el2.parentNode && checkInHost2(check2, el2.parentNode, boundary)); - }, "checkInHost"); - var withinHost = /* @__PURE__ */__name(function withinHost2(activeElement, workingArea) { - return workingArea.some(function (area) { - return checkInHost(activeElement, area, area); - }); - }, "withinHost"); - var activateTrap = /* @__PURE__ */__name(function activateTrap2() { - var result = false; - if (lastActiveTrap) { - var _lastActiveTrap = lastActiveTrap, - observed = _lastActiveTrap.observed, - persistentFocus = _lastActiveTrap.persistentFocus, - autoFocus = _lastActiveTrap.autoFocus, - shards = _lastActiveTrap.shards, - crossFrame = _lastActiveTrap.crossFrame, - focusOptions = _lastActiveTrap.focusOptions; - var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement; - var activeElement = document && document.activeElement; - if (workingNode) { - var workingArea = [workingNode].concat(shards.map(extractRef$1).filter(Boolean)); - if (!activeElement || focusWhitelisted(activeElement)) { - if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) { - if (workingNode && !(focusInside(workingArea) || activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement))) { - if (document && !lastActiveFocus && activeElement && !autoFocus) { - if (activeElement.blur) { - activeElement.blur(); - } - document.body.focus(); - } else { - result = moveFocusInside(workingArea, lastActiveFocus, { - focusOptions - }); - lastPortaledElement = {}; - } - } - focusWasOutsideWindow = false; - lastActiveFocus = document && document.activeElement; - } - } - if (document) { - var newActiveElement = document && document.activeElement; - var allNodes = getFocusabledIn(workingArea); - var focusedIndex = allNodes.map(function (_ref2) { - var node = _ref2.node; - return node; - }).indexOf(newActiveElement); - if (focusedIndex > -1) { - allNodes.filter(function (_ref2) { - var guard = _ref2.guard, - node = _ref2.node; - return guard && node.dataset.focusAutoGuard; - }).forEach(function (_ref3) { - var node = _ref3.node; - return node.removeAttribute("tabIndex"); - }); - autoGuard(focusedIndex, allNodes.length, 1, allNodes); - autoGuard(focusedIndex, -1, -1, allNodes); - } - } - } - } - return result; - }, "activateTrap"); - var onTrap = /* @__PURE__ */__name(function onTrap2(event) { - if (activateTrap() && event) { - event.stopPropagation(); - event.preventDefault(); - } - }, "onTrap"); - var onBlur = /* @__PURE__ */__name(function onBlur2() { - return deferAction(activateTrap); - }, "onBlur"); - var onFocus = /* @__PURE__ */__name(function onFocus2(event) { - var source = event.target; - var currentNode = event.currentTarget; - if (!currentNode.contains(source)) { - recordPortal(currentNode, source); - } - }, "onFocus"); - var FocusWatcher = /* @__PURE__ */__name(function FocusWatcher2() { - return null; - }, "FocusWatcher"); - var onWindowBlur = /* @__PURE__ */__name(function onWindowBlur2() { - focusWasOutsideWindow = "just"; - setTimeout(function () { - focusWasOutsideWindow = "meanwhile"; - }, 0); - }, "onWindowBlur"); - var attachHandler = /* @__PURE__ */__name(function attachHandler2() { - document.addEventListener("focusin", onTrap); - document.addEventListener("focusout", onBlur); - window.addEventListener("blur", onWindowBlur); - }, "attachHandler"); - var detachHandler = /* @__PURE__ */__name(function detachHandler2() { - document.removeEventListener("focusin", onTrap); - document.removeEventListener("focusout", onBlur); - window.removeEventListener("blur", onWindowBlur); - }, "detachHandler"); - function reducePropsToState(propsList) { - return propsList.filter(function (_ref5) { - var disabled = _ref5.disabled; - return !disabled; - }); - } - __name(reducePropsToState, "reducePropsToState"); - function handleStateChangeOnClient(traps) { - var trap = traps.slice(-1)[0]; - if (trap && !lastActiveTrap) { - attachHandler(); - } - var lastTrap = lastActiveTrap; - var sameTrap = lastTrap && trap && trap.id === lastTrap.id; - lastActiveTrap = trap; - if (lastTrap && !sameTrap) { - lastTrap.onDeactivation(); - if (!traps.filter(function (_ref6) { - var id2 = _ref6.id; - return id2 === lastTrap.id; - }).length) { - lastTrap.returnFocus(!trap); - } - } - if (trap) { - lastActiveFocus = null; - if (!sameTrap || lastTrap.observed !== trap.observed) { - trap.onActivation(); - } - activateTrap(); - deferAction(activateTrap); - } else { - detachHandler(); - lastActiveFocus = null; - } - } - __name(handleStateChangeOnClient, "handleStateChangeOnClient"); - mediumFocus.assignSyncMedium(onFocus); - mediumBlur.assignMedium(onBlur); - mediumEffect.assignMedium(function (cb) { - return cb({ - moveFocusInside, - focusInside - }); - }); - var FocusTrap = withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher); - var FocusLockCombination = /* @__PURE__ */React.forwardRef( /* @__PURE__ */__name(function FocusLockUICombination(props2, ref) { - return /* @__PURE__ */React.createElement(FocusLockUI2, _extends$a({ - sideCar: FocusTrap, - ref - }, props2)); - }, "FocusLockUICombination")); - var _ref = FocusLockUI2.propTypes || {}; - _ref.sideCar; - _objectWithoutPropertiesLoose$a(_ref, ["sideCar"]); - FocusLockCombination.propTypes = {}; - var FocusLock = FocusLockCombination; - var zeroRightClassName = "right-scroll-bar-position"; - var fullWidthClassName = "width-before-scroll-bar"; - var noScrollbarsClassName = "with-scroll-bars-hidden"; - var removedBarSizeVariable = "--removed-body-scroll-bar-size"; - var effectCar = createSidecarMedium(); - var nothing = /* @__PURE__ */__name(function () { - return; - }, "nothing"); - var RemoveScroll$1 = /*#__PURE__*/React.forwardRef(function (props2, parentRef) { - var ref = React.useRef(null); - var _a = React.useState({ - onScrollCapture: nothing, - onWheelCapture: nothing, - onTouchMoveCapture: nothing - }), - callbacks = _a[0], - setCallbacks = _a[1]; - var forwardProps = props2.forwardProps, - children = props2.children, - className = props2.className, - removeScrollBar = props2.removeScrollBar, - enabled = props2.enabled, - shards = props2.shards, - sideCar = props2.sideCar, - noIsolation = props2.noIsolation, - inert = props2.inert, - allowPinchZoom = props2.allowPinchZoom, - _b = props2.as, - Container = _b === void 0 ? "div" : _b, - rest = __rest(props2, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]); - var SideCar2 = sideCar; - var containerRef = useMergeRefs([ref, parentRef]); - var containerProps = __assign(__assign({}, rest), callbacks); - return /*#__PURE__*/React.createElement(React.Fragment, null, enabled && /*#__PURE__*/React.createElement(SideCar2, { - sideCar: effectCar, - removeScrollBar, - shards, - noIsolation, - inert, - setCallbacks, - allowPinchZoom: !!allowPinchZoom, - lockRef: ref - }), forwardProps ? /*#__PURE__*/React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { - ref: containerRef - })) : /*#__PURE__*/React.createElement(Container, __assign({}, containerProps, { - className, - ref: containerRef - }), children)); - }); - RemoveScroll$1.defaultProps = { - enabled: true, - removeScrollBar: true, - inert: false - }; - RemoveScroll$1.classNames = { - fullWidth: fullWidthClassName, - zeroRight: zeroRightClassName - }; - var getNonce = /* @__PURE__ */__name(function () { - if (true) { - return __webpack_require__.nc; - } - return void 0; - }, "getNonce"); - function makeStyleTag() { - if (!document) return null; - var tag = document.createElement("style"); - tag.type = "text/css"; - var nonce = getNonce(); - if (nonce) { - tag.setAttribute("nonce", nonce); - } - return tag; - } - __name(makeStyleTag, "makeStyleTag"); - function injectStyles(tag, css) { - if (tag.styleSheet) { - tag.styleSheet.cssText = css; - } else { - tag.appendChild(document.createTextNode(css)); - } - } - __name(injectStyles, "injectStyles"); - function insertStyleTag(tag) { - var head = document.head || document.getElementsByTagName("head")[0]; - head.appendChild(tag); - } - __name(insertStyleTag, "insertStyleTag"); - var stylesheetSingleton = /* @__PURE__ */__name(function () { - var counter = 0; - var stylesheet = null; - return { - add: function (style2) { - if (counter == 0) { - if (stylesheet = makeStyleTag()) { - injectStyles(stylesheet, style2); - insertStyleTag(stylesheet); - } - } - counter++; - }, - remove: function () { - counter--; - if (!counter && stylesheet) { - stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); - stylesheet = null; - } - } - }; - }, "stylesheetSingleton"); - var styleHookSingleton = /* @__PURE__ */__name(function () { - var sheet = stylesheetSingleton(); - return function (styles, isDynamic) { - React.useEffect(function () { - sheet.add(styles); - return function () { - sheet.remove(); - }; - }, [styles && isDynamic]); - }; - }, "styleHookSingleton"); - var styleSingleton = /* @__PURE__ */__name(function () { - var useStyle = styleHookSingleton(); - var Sheet = /* @__PURE__ */__name(function (_a) { - var styles = _a.styles, - dynamic = _a.dynamic; - useStyle(styles, dynamic); - return null; - }, "Sheet"); - return Sheet; - }, "styleSingleton"); - var zeroGap = { - left: 0, - top: 0, - right: 0, - gap: 0 - }; - var parse$1 = /* @__PURE__ */__name(function (x2) { - return parseInt(x2 || "", 10) || 0; - }, "parse$1"); - var getOffset = /* @__PURE__ */__name(function (gapMode) { - var cs = window.getComputedStyle(document.body); - var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"]; - var top2 = cs[gapMode === "padding" ? "paddingTop" : "marginTop"]; - var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"]; - return [parse$1(left), parse$1(top2), parse$1(right)]; - }, "getOffset"); - var getGapWidth = /* @__PURE__ */__name(function (gapMode) { - if (gapMode === void 0) { - gapMode = "margin"; - } - if (typeof window === "undefined") { - return zeroGap; - } - var offsets = getOffset(gapMode); - var documentWidth = document.documentElement.clientWidth; - var windowWidth = window.innerWidth; - return { - left: offsets[0], - top: offsets[1], - right: offsets[2], - gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) - }; - }, "getGapWidth"); - var Style = styleSingleton(); - var getStyles$2 = /* @__PURE__ */__name(function (_a, allowRelative, gapMode, important) { - var left = _a.left, - top2 = _a.top, - right = _a.right, - gap2 = _a.gap; - if (gapMode === void 0) { - gapMode = "margin"; - } - return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap2, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([allowRelative && "position: relative ".concat(important, ";"), gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top2, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap2, "px ").concat(important, ";\n "), gapMode === "padding" && "padding-right: ".concat(gap2, "px ").concat(important, ";")].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap2, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap2, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(removedBarSizeVariable, ": ").concat(gap2, "px;\n }\n"); - }, "getStyles$2"); - var RemoveScrollBar = /* @__PURE__ */__name(function (props2) { - var noRelative = props2.noRelative, - noImportant = props2.noImportant, - _a = props2.gapMode, - gapMode = _a === void 0 ? "margin" : _a; - var gap2 = React.useMemo(function () { - return getGapWidth(gapMode); - }, [gapMode]); - return /*#__PURE__*/React.createElement(Style, { - styles: getStyles$2(gap2, !noRelative, gapMode, !noImportant ? "!important" : "") - }); - }, "RemoveScrollBar"); - var passiveSupported = false; - if (typeof window !== "undefined") { - try { - var options = Object.defineProperty({}, "passive", { - get: function () { - passiveSupported = true; - return true; - } - }); - window.addEventListener("test", options, options); - window.removeEventListener("test", options, options); - } catch (err) { - passiveSupported = false; - } - } - var nonPassive = passiveSupported ? { - passive: false - } : false; - var alwaysContainsScroll = /* @__PURE__ */__name(function (node) { - return node.tagName === "TEXTAREA"; - }, "alwaysContainsScroll"); - var elementCanBeScrolled = /* @__PURE__ */__name(function (node, overflow) { - var styles = window.getComputedStyle(node); - return styles[overflow] !== "hidden" && !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible"); - }, "elementCanBeScrolled"); - var elementCouldBeVScrolled = /* @__PURE__ */__name(function (node) { - return elementCanBeScrolled(node, "overflowY"); - }, "elementCouldBeVScrolled"); - var elementCouldBeHScrolled = /* @__PURE__ */__name(function (node) { - return elementCanBeScrolled(node, "overflowX"); - }, "elementCouldBeHScrolled"); - var locationCouldBeScrolled = /* @__PURE__ */__name(function (axis, node) { - var current = node; - do { - if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) { - current = current.host; - } - var isScrollable = elementCouldBeScrolled(axis, current); - if (isScrollable) { - var _a = getScrollVariables(axis, current), - s2 = _a[1], - d2 = _a[2]; - if (s2 > d2) { - return true; - } - } - current = current.parentNode; - } while (current && current !== document.body); - return false; - }, "locationCouldBeScrolled"); - var getVScrollVariables = /* @__PURE__ */__name(function (_a) { - var scrollTop = _a.scrollTop, - scrollHeight = _a.scrollHeight, - clientHeight = _a.clientHeight; - return [scrollTop, scrollHeight, clientHeight]; - }, "getVScrollVariables"); - var getHScrollVariables = /* @__PURE__ */__name(function (_a) { - var scrollLeft = _a.scrollLeft, - scrollWidth = _a.scrollWidth, - clientWidth = _a.clientWidth; - return [scrollLeft, scrollWidth, clientWidth]; - }, "getHScrollVariables"); - var elementCouldBeScrolled = /* @__PURE__ */__name(function (axis, node) { - return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); - }, "elementCouldBeScrolled"); - var getScrollVariables = /* @__PURE__ */__name(function (axis, node) { - return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node); - }, "getScrollVariables"); - var getDirectionFactor = /* @__PURE__ */__name(function (axis, direction) { - return axis === "h" && direction === "rtl" ? -1 : 1; - }, "getDirectionFactor"); - var handleScroll = /* @__PURE__ */__name(function (axis, endTarget, event, sourceDelta, noOverscroll) { - var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); - var delta2 = directionFactor * sourceDelta; - var target2 = event.target; - var targetInLock = endTarget.contains(target2); - var shouldCancelScroll = false; - var isDeltaPositive = delta2 > 0; - var availableScroll = 0; - var availableScrollTop = 0; - do { - var _a = getScrollVariables(axis, target2), - position = _a[0], - scroll_1 = _a[1], - capacity = _a[2]; - var elementScroll = scroll_1 - capacity - directionFactor * position; - if (position || elementScroll) { - if (elementCouldBeScrolled(axis, target2)) { - availableScroll += elementScroll; - availableScrollTop += position; - } - } - target2 = target2.parentNode; - } while (!targetInLock && target2 !== document.body || targetInLock && (endTarget.contains(target2) || endTarget === target2)); - if (isDeltaPositive && (noOverscroll && availableScroll === 0 || !noOverscroll && delta2 > availableScroll)) { - shouldCancelScroll = true; - } else if (!isDeltaPositive && (noOverscroll && availableScrollTop === 0 || !noOverscroll && -delta2 > availableScrollTop)) { - shouldCancelScroll = true; - } - return shouldCancelScroll; - }, "handleScroll"); - var getTouchXY = /* @__PURE__ */__name(function (event) { - return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; - }, "getTouchXY"); - var getDeltaXY = /* @__PURE__ */__name(function (event) { - return [event.deltaX, event.deltaY]; - }, "getDeltaXY"); - var extractRef2 = /* @__PURE__ */__name(function (ref) { - return ref && "current" in ref ? ref.current : ref; - }, "extractRef"); - var deltaCompare = /* @__PURE__ */__name(function (x2, y2) { - return x2[0] === y2[0] && x2[1] === y2[1]; - }, "deltaCompare"); - var generateStyle = /* @__PURE__ */__name(function (id2) { - return "\n .block-interactivity-".concat(id2, " {pointer-events: none;}\n .allow-interactivity-").concat(id2, " {pointer-events: all;}\n"); - }, "generateStyle"); - var idCounter = 0; - var lockStack = []; - function RemoveScrollSideCar(props2) { - var shouldPreventQueue = React.useRef([]); - var touchStartRef = React.useRef([0, 0]); - var activeAxis = React.useRef(); - var id2 = React.useState(idCounter++)[0]; - var Style2 = React.useState(function () { - return styleSingleton(); - })[0]; - var lastProps = React.useRef(props2); - React.useEffect(function () { - lastProps.current = props2; - }, [props2]); - React.useEffect(function () { - if (props2.inert) { - document.body.classList.add("block-interactivity-".concat(id2)); - var allow_1 = __spreadArray([props2.lockRef.current], (props2.shards || []).map(extractRef2), true).filter(Boolean); - allow_1.forEach(function (el2) { - return el2.classList.add("allow-interactivity-".concat(id2)); - }); - return function () { - document.body.classList.remove("block-interactivity-".concat(id2)); - allow_1.forEach(function (el2) { - return el2.classList.remove("allow-interactivity-".concat(id2)); - }); - }; - } - return; - }, [props2.inert, props2.lockRef.current, props2.shards]); - var shouldCancelEvent = React.useCallback(function (event, parent) { - if ("touches" in event && event.touches.length === 2) { - return !lastProps.current.allowPinchZoom; - } - var touch = getTouchXY(event); - var touchStart = touchStartRef.current; - var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0]; - var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1]; - var currentAxis; - var target2 = event.target; - var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v"; - if ("touches" in event && moveDirection === "h" && target2.type === "range") { - return false; - } - var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target2); - if (!canBeScrolledInMainDirection) { - return true; - } - if (canBeScrolledInMainDirection) { - currentAxis = moveDirection; - } else { - currentAxis = moveDirection === "v" ? "h" : "v"; - canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target2); - } - if (!canBeScrolledInMainDirection) { - return false; - } - if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) { - activeAxis.current = currentAxis; - } - if (!currentAxis) { - return true; - } - var cancelingAxis = activeAxis.current || currentAxis; - return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true); - }, []); - var shouldPrevent = React.useCallback(function (_event) { - var event = _event; - if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) { - return; - } - var delta2 = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event); - var sourceEvent = shouldPreventQueue.current.filter(function (e2) { - return e2.name === event.type && e2.target === event.target && deltaCompare(e2.delta, delta2); - })[0]; - if (sourceEvent && sourceEvent.should) { - if (event.cancelable) { - event.preventDefault(); - } - return; - } - if (!sourceEvent) { - var shardNodes = (lastProps.current.shards || []).map(extractRef2).filter(Boolean).filter(function (node) { - return node.contains(event.target); - }); - var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; - if (shouldStop) { - if (event.cancelable) { - event.preventDefault(); - } - } - } - }, []); - var shouldCancel = React.useCallback(function (name2, delta2, target2, should) { - var event = { - name: name2, - delta: delta2, - target: target2, - should - }; - shouldPreventQueue.current.push(event); - setTimeout(function () { - shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e2) { - return e2 !== event; - }); - }, 1); - }, []); - var scrollTouchStart = React.useCallback(function (event) { - touchStartRef.current = getTouchXY(event); - activeAxis.current = void 0; - }, []); - var scrollWheel = React.useCallback(function (event) { - shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props2.lockRef.current)); - }, []); - var scrollTouchMove = React.useCallback(function (event) { - shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props2.lockRef.current)); - }, []); - React.useEffect(function () { - lockStack.push(Style2); - props2.setCallbacks({ - onScrollCapture: scrollWheel, - onWheelCapture: scrollWheel, - onTouchMoveCapture: scrollTouchMove - }); - document.addEventListener("wheel", shouldPrevent, nonPassive); - document.addEventListener("touchmove", shouldPrevent, nonPassive); - document.addEventListener("touchstart", scrollTouchStart, nonPassive); - return function () { - lockStack = lockStack.filter(function (inst) { - return inst !== Style2; - }); - document.removeEventListener("wheel", shouldPrevent, nonPassive); - document.removeEventListener("touchmove", shouldPrevent, nonPassive); - document.removeEventListener("touchstart", scrollTouchStart, nonPassive); - }; - }, []); - var removeScrollBar = props2.removeScrollBar, - inert = props2.inert; - return /*#__PURE__*/React.createElement(React.Fragment, null, inert ? /*#__PURE__*/React.createElement(Style2, { - styles: generateStyle(id2) - }) : null, removeScrollBar ? /*#__PURE__*/React.createElement(RemoveScrollBar, { - gapMode: "margin" - }) : null); - } - __name(RemoveScrollSideCar, "RemoveScrollSideCar"); - var SideCar = exportSidecar(effectCar, RemoveScrollSideCar); - var ReactRemoveScroll = /*#__PURE__*/React.forwardRef(function (props2, ref) { - return /*#__PURE__*/React.createElement(RemoveScroll$1, __assign({}, props2, { - ref, - sideCar: SideCar - })); - }); - ReactRemoveScroll.classNames = RemoveScroll$1.classNames; - var RemoveScroll = ReactRemoveScroll; - var propTypes = { - exports: {} - }; - var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; - var ReactPropTypesSecret = ReactPropTypesSecret_1; - function emptyFunction() {} - __name(emptyFunction, "emptyFunction"); - function emptyFunctionWithReset() {} - __name(emptyFunctionWithReset, "emptyFunctionWithReset"); - emptyFunctionWithReset.resetWarningCache = emptyFunction; - var factoryWithThrowingShims = /* @__PURE__ */__name(function () { - function shim(props2, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - return; - } - var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"); - err.name = "Invariant Violation"; - throw err; - } - __name(shim, "shim"); - shim.isRequired = shim; - function getShim() { - return shim; - } - __name(getShim, "getShim"); - var ReactPropTypes = { - array: shim, - bigint: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - any: shim, - arrayOf: getShim, - element: shim, - elementType: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim, - checkPropTypes: emptyFunctionWithReset, - resetWarningCache: emptyFunction - }; - ReactPropTypes.PropTypes = ReactPropTypes; - return ReactPropTypes; - }, "factoryWithThrowingShims"); - { - propTypes.exports = factoryWithThrowingShims(); - } - var PropTypes = propTypes.exports; - function _extends$9() { - _extends$9 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$9.apply(this, arguments); - } - __name(_extends$9, "_extends$9"); - function _objectWithoutPropertiesLoose$9(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$9, "_objectWithoutPropertiesLoose$9"); - var _excluded$9 = ["as", "isOpen"], - _excluded2$5 = ["allowPinchZoom", "as", "dangerouslyBypassFocusLock", "dangerouslyBypassScrollLock", "initialFocusRef", "onClick", "onDismiss", "onKeyDown", "onMouseDown", "unstable_lockFocusAcrossFrames"], - _excluded3$5 = ["as", "onClick", "onKeyDown"], - _excluded4$4 = ["allowPinchZoom", "initialFocusRef", "isOpen", "onDismiss"]; - ({ - allowPinchZoom: PropTypes.bool, - dangerouslyBypassFocusLock: PropTypes.bool, - dangerouslyBypassScrollLock: PropTypes.bool, - initialFocusRef: /* @__PURE__ */__name(function initialFocusRef() { - return null; - }, "initialFocusRef"), - onDismiss: PropTypes.func - }); - var DialogOverlay = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function DialogOverlay2(_ref2, forwardedRef) { - var _ref$as = _ref2.as, - Comp = _ref$as === void 0 ? "div" : _ref$as, - _ref$isOpen = _ref2.isOpen, - isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen, - props2 = _objectWithoutPropertiesLoose$9(_ref2, _excluded$9); - (0, React.useEffect)(function () { - if (isOpen) { - window.__REACH_DISABLE_TOOLTIPS = true; - } else { - window.requestAnimationFrame(function () { - window.__REACH_DISABLE_TOOLTIPS = false; - }); - } - }, [isOpen]); - return isOpen ? /* @__PURE__ */(0, React.createElement)(Portal, { - "data-reach-dialog-wrapper": "" - }, /* @__PURE__ */(0, React.createElement)(DialogInner, _extends$9({ - ref: forwardedRef, - as: Comp - }, props2))) : null; - }, "DialogOverlay")); - var DialogInner = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function DialogInner2(_ref2, forwardedRef) { - var allowPinchZoom = _ref2.allowPinchZoom, - _ref2$as = _ref2.as, - Comp = _ref2$as === void 0 ? "div" : _ref2$as, - _ref2$dangerouslyBypa = _ref2.dangerouslyBypassFocusLock, - dangerouslyBypassFocusLock = _ref2$dangerouslyBypa === void 0 ? false : _ref2$dangerouslyBypa, - _ref2$dangerouslyBypa2 = _ref2.dangerouslyBypassScrollLock, - dangerouslyBypassScrollLock = _ref2$dangerouslyBypa2 === void 0 ? false : _ref2$dangerouslyBypa2, - initialFocusRef2 = _ref2.initialFocusRef, - onClick = _ref2.onClick, - _ref2$onDismiss = _ref2.onDismiss, - onDismiss = _ref2$onDismiss === void 0 ? noop : _ref2$onDismiss, - onKeyDown = _ref2.onKeyDown, - onMouseDown = _ref2.onMouseDown, - unstable_lockFocusAcrossFrames = _ref2.unstable_lockFocusAcrossFrames, - props2 = _objectWithoutPropertiesLoose$9(_ref2, _excluded2$5); - var mouseDownTarget = (0, React.useRef)(null); - var overlayNode = (0, React.useRef)(null); - var ref = useComposedRefs(overlayNode, forwardedRef); - var activateFocusLock = (0, React.useCallback)(function () { - if (initialFocusRef2 && initialFocusRef2.current) { - initialFocusRef2.current.focus(); - } - }, [initialFocusRef2]); - function handleClick(event) { - if (mouseDownTarget.current === event.target) { - event.stopPropagation(); - onDismiss(event); - } - } - __name(handleClick, "handleClick"); - function handleKeyDown(event) { - if (event.key === "Escape") { - event.stopPropagation(); - onDismiss(event); - } - } - __name(handleKeyDown, "handleKeyDown"); - function handleMouseDown(event) { - mouseDownTarget.current = event.target; - } - __name(handleMouseDown, "handleMouseDown"); - (0, React.useEffect)(function () { - return overlayNode.current ? createAriaHider(overlayNode.current) : void 0; - }, []); - return /* @__PURE__ */(0, React.createElement)(FocusLock, { - autoFocus: true, - returnFocus: true, - onActivation: activateFocusLock, - disabled: dangerouslyBypassFocusLock, - crossFrame: unstable_lockFocusAcrossFrames != null ? unstable_lockFocusAcrossFrames : true - }, /* @__PURE__ */(0, React.createElement)(RemoveScroll, { - allowPinchZoom, - enabled: !dangerouslyBypassScrollLock - }, /* @__PURE__ */(0, React.createElement)(Comp, _extends$9({}, props2, { - ref, - "data-reach-dialog-overlay": "", - onClick: composeEventHandlers(onClick, handleClick), - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown), - onMouseDown: composeEventHandlers(onMouseDown, handleMouseDown) - })))); - }, "DialogInner")); - var DialogContent = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function DialogContent2(_ref3, forwardedRef) { - var _ref3$as = _ref3.as, - Comp = _ref3$as === void 0 ? "div" : _ref3$as, - onClick = _ref3.onClick; - _ref3.onKeyDown; - var props2 = _objectWithoutPropertiesLoose$9(_ref3, _excluded3$5); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$9({ - "aria-modal": "true", - role: "dialog", - tabIndex: -1 - }, props2, { - ref: forwardedRef, - "data-reach-dialog-content": "", - onClick: composeEventHandlers(onClick, function (event) { - event.stopPropagation(); - }) - })); - }, "DialogContent")); - var Dialog$1 = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function Dialog(_ref4, forwardedRef) { - var _ref4$allowPinchZoom = _ref4.allowPinchZoom, - allowPinchZoom = _ref4$allowPinchZoom === void 0 ? false : _ref4$allowPinchZoom, - initialFocusRef2 = _ref4.initialFocusRef, - isOpen = _ref4.isOpen, - _ref4$onDismiss = _ref4.onDismiss, - onDismiss = _ref4$onDismiss === void 0 ? noop : _ref4$onDismiss, - props2 = _objectWithoutPropertiesLoose$9(_ref4, _excluded4$4); - return /* @__PURE__ */(0, React.createElement)(DialogOverlay, { - allowPinchZoom, - initialFocusRef: initialFocusRef2, - isOpen, - onDismiss - }, /* @__PURE__ */(0, React.createElement)(DialogContent, _extends$9({ - ref: forwardedRef - }, props2))); - }, "Dialog")); - function createAriaHider(dialogNode) { - var originalValues = []; - var rootNodes = []; - var ownerDocument = getOwnerDocument(dialogNode); - if (!dialogNode) { - return noop; - } - Array.prototype.forEach.call(ownerDocument.querySelectorAll("body > *"), function (node) { - var _dialogNode$parentNod, _dialogNode$parentNod2; - var portalNode = (_dialogNode$parentNod = dialogNode.parentNode) == null ? void 0 : (_dialogNode$parentNod2 = _dialogNode$parentNod.parentNode) == null ? void 0 : _dialogNode$parentNod2.parentNode; - if (node === portalNode) { - return; - } - var attr = node.getAttribute("aria-hidden"); - var alreadyHidden = attr !== null && attr !== "false"; - if (alreadyHidden) { - return; - } - originalValues.push(attr); - rootNodes.push(node); - node.setAttribute("aria-hidden", "true"); - }); - return function () { - rootNodes.forEach(function (node, index) { - var originalValue = originalValues[index]; - if (originalValue === null) { - node.removeAttribute("aria-hidden"); - } else { - node.setAttribute("aria-hidden", originalValue); - } - }); - }; - } - __name(createAriaHider, "createAriaHider"); - function _extends$8() { - _extends$8 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$8.apply(this, arguments); - } - __name(_extends$8, "_extends$8"); - function _objectWithoutPropertiesLoose$8(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$8, "_objectWithoutPropertiesLoose$8"); - var _excluded$8 = ["as", "style"]; - var VisuallyHidden = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function VisuallyHidden2(_ref2, ref) { - var _ref$as = _ref2.as, - Comp = _ref$as === void 0 ? "span" : _ref$as, - _ref$style = _ref2.style, - style2 = _ref$style === void 0 ? {} : _ref$style, - props2 = _objectWithoutPropertiesLoose$8(_ref2, _excluded$8); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$8({ - ref, - style: _extends$8({ - border: 0, - clip: "rect(0 0 0 0)", - height: "1px", - margin: "-1px", - overflow: "hidden", - padding: 0, - position: "absolute", - width: "1px", - whiteSpace: "nowrap", - wordWrap: "normal" - }, style2) - }, props2)); - }, "VisuallyHidden")); - var __defProp$D = Object.defineProperty; - var __name$D = /* @__PURE__ */__name((target2, value3) => __defProp$D(target2, "name", { - value: value3, - configurable: true - }), "__name$D"); - const createComponentGroup = /* @__PURE__ */__name$D((root2, children) => Object.entries(children).reduce((r2, _ref72) => { - let [key, value3] = _ref72; - r2[key] = value3; - return r2; - }, root2), "createComponentGroup"); - var dialog = /* @__PURE__ */(() => ":root{--reach-dialog: 1}[data-reach-dialog-overlay]{background:hsla(0,0%,0%,.33);position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}[data-reach-dialog-content]{width:50vw;margin:10vh auto;background:white;padding:2rem;outline:none}[data-reach-dialog-overlay]{align-items:center;background-color:hsla(var(--color-neutral),var(--alpha-background-heavy));display:flex;justify-content:center;z-index:10}[data-reach-dialog-content]{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-12);box-shadow:var(--popover-box-shadow);margin:0;max-height:80vh;max-width:80vw;overflow:auto;padding:0;width:unset}.graphiql-dialog-close>svg{color:hsla(var(--color-neutral),var(--alpha-secondary));display:block;height:var(--px-12);padding:var(--px-12);width:var(--px-12)}\n")(); - const DialogRoot = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx(Dialog$1, __spreadProps(__spreadValues({}, props2), { - ref - }))); - DialogRoot.displayName = "Dialog"; - const DialogClose = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsxs(UnStyledButton, __spreadProps(__spreadValues({}, props2), { - ref, - type: "button", - className: clsx("graphiql-dialog-close", props2.className), - children: [/* @__PURE__ */jsx(VisuallyHidden, { - children: "Close dialog" - }), /* @__PURE__ */jsx(CloseIcon, {})] - }))); - DialogClose.displayName = "Dialog.Close"; - const Dialog2 = createComponentGroup(DialogRoot, { - Close: DialogClose - }); - _exports.aJ = Dialog2; - var serverHandoffComplete = false; - var id = 0; - function genId() { - return ++id; - } - __name(genId, "genId"); - function useId(providedId) { - var _ref2; - if (typeof React.useId === "function") { - var _id = (0, React.useId)(providedId); - return providedId != null ? providedId : _id; - } - var initialId = providedId != null ? providedId : serverHandoffComplete ? genId() : null; - var _React$useState = (0, React.useState)(initialId), - id2 = _React$useState[0], - setId = _React$useState[1]; - useIsomorphicLayoutEffect(function () { - if (id2 === null) { - setId(genId()); - } - }, []); - (0, React.useEffect)(function () { - if (serverHandoffComplete === false) { - serverHandoffComplete = true; - } - }, []); - return (_ref2 = providedId != null ? providedId : id2) != null ? _ref2 : void 0; - } - __name(useId, "useId"); - var props = ["bottom", "height", "left", "right", "top", "width"]; - var rectChanged = /* @__PURE__ */__name(function rectChanged2(a2, b2) { - if (a2 === void 0) { - a2 = {}; - } - if (b2 === void 0) { - b2 = {}; - } - return props.some(function (prop2) { - return a2[prop2] !== b2[prop2]; - }); - }, "rectChanged"); - var observedNodes = /* @__PURE__ */new Map(); - var rafId; - var run = /* @__PURE__ */__name(function run2() { - var changedStates = []; - observedNodes.forEach(function (state2, node) { - var newRect = node.getBoundingClientRect(); - if (rectChanged(newRect, state2.rect)) { - state2.rect = newRect; - changedStates.push(state2); - } - }); - changedStates.forEach(function (state2) { - state2.callbacks.forEach(function (cb) { - return cb(state2.rect); - }); - }); - rafId = window.requestAnimationFrame(run2); - }, "run"); - function observeRect(node, cb) { - return { - observe: /* @__PURE__ */__name(function observe() { - var wasEmpty = observedNodes.size === 0; - if (observedNodes.has(node)) { - observedNodes.get(node).callbacks.push(cb); - } else { - observedNodes.set(node, { - rect: void 0, - hasRectChanged: false, - callbacks: [cb] - }); - } - if (wasEmpty) run(); - }, "observe"), - unobserve: /* @__PURE__ */__name(function unobserve() { - var state2 = observedNodes.get(node); - if (state2) { - var index = state2.callbacks.indexOf(cb); - if (index >= 0) state2.callbacks.splice(index, 1); - if (!state2.callbacks.length) observedNodes["delete"](node); - if (!observedNodes.size) cancelAnimationFrame(rafId); - } - }, "unobserve") - }; - } - __name(observeRect, "observeRect"); - function useRect(nodeRef, observeOrOptions, deprecated_onChange) { - var observe; - var onChange; - if (isBoolean(observeOrOptions)) { - observe = observeOrOptions; - } else { - var _observeOrOptions$obs; - observe = (_observeOrOptions$obs = observeOrOptions == null ? void 0 : observeOrOptions.observe) != null ? _observeOrOptions$obs : true; - onChange = observeOrOptions == null ? void 0 : observeOrOptions.onChange; - } - if (isFunction$1(deprecated_onChange)) { - onChange = deprecated_onChange; - } - var _React$useState = (0, React.useState)(nodeRef.current), - element = _React$useState[0], - setElement = _React$useState[1]; - var initialRectIsSet = (0, React.useRef)(false); - var initialRefIsSet = (0, React.useRef)(false); - var _React$useState2 = (0, React.useState)(null), - rect2 = _React$useState2[0], - setRect = _React$useState2[1]; - var onChangeRef = (0, React.useRef)(onChange); - useIsomorphicLayoutEffect(function () { - onChangeRef.current = onChange; - if (nodeRef.current !== element) { - setElement(nodeRef.current); - } - }); - useIsomorphicLayoutEffect(function () { - if (element && !initialRectIsSet.current) { - initialRectIsSet.current = true; - setRect(element.getBoundingClientRect()); - } - }, [element]); - useIsomorphicLayoutEffect(function () { - if (!observe) { - return; - } - var elem = element; - if (!initialRefIsSet.current) { - initialRefIsSet.current = true; - elem = nodeRef.current; - } - if (!elem) { - return; - } - var observer = observeRect(elem, function (rect3) { - onChangeRef.current == null ? void 0 : onChangeRef.current(rect3); - setRect(rect3); - }); - observer.observe(); - return function () { - observer.unobserve(); - }; - }, [observe, element, nodeRef]); - return rect2; - } - __name(useRect, "useRect"); - var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])']; - var candidateSelector = candidateSelectors.join(","); - var matches = typeof Element === "undefined" ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - function tabbable(el2, options) { - options = options || {}; - var regularTabbables = []; - var orderedTabbables = []; - var candidates = el2.querySelectorAll(candidateSelector); - if (options.includeContainer) { - if (matches.call(el2, candidateSelector)) { - candidates = Array.prototype.slice.apply(candidates); - candidates.unshift(el2); - } - } - var i, candidate, candidateTabindex; - for (i = 0; i < candidates.length; i++) { - candidate = candidates[i]; - if (!isNodeMatchingSelectorTabbable(candidate)) continue; - candidateTabindex = getTabindex(candidate); - if (candidateTabindex === 0) { - regularTabbables.push(candidate); - } else { - orderedTabbables.push({ - documentOrder: i, - tabIndex: candidateTabindex, - node: candidate - }); - } - } - var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function (a2) { - return a2.node; - }).concat(regularTabbables); - return tabbableNodes; - } - __name(tabbable, "tabbable"); - tabbable.isTabbable = isTabbable; - tabbable.isFocusable = isFocusable; - function isNodeMatchingSelectorTabbable(node) { - if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) { - return false; - } - return true; - } - __name(isNodeMatchingSelectorTabbable, "isNodeMatchingSelectorTabbable"); - function isTabbable(node) { - if (!node) throw new Error("No node provided"); - if (matches.call(node, candidateSelector) === false) return false; - return isNodeMatchingSelectorTabbable(node); - } - __name(isTabbable, "isTabbable"); - function isNodeMatchingSelectorFocusable(node) { - if (node.disabled || isHiddenInput(node) || isHidden(node)) { - return false; - } - return true; - } - __name(isNodeMatchingSelectorFocusable, "isNodeMatchingSelectorFocusable"); - var focusableCandidateSelector = candidateSelectors.concat("iframe").join(","); - function isFocusable(node) { - if (!node) throw new Error("No node provided"); - if (matches.call(node, focusableCandidateSelector) === false) return false; - return isNodeMatchingSelectorFocusable(node); - } - __name(isFocusable, "isFocusable"); - function getTabindex(node) { - var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10); - if (!isNaN(tabindexAttr)) return tabindexAttr; - if (isContentEditable(node)) return 0; - return node.tabIndex; - } - __name(getTabindex, "getTabindex"); - function sortOrderedTabbables(a2, b2) { - return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.tabIndex; - } - __name(sortOrderedTabbables, "sortOrderedTabbables"); - function isContentEditable(node) { - return node.contentEditable === "true"; - } - __name(isContentEditable, "isContentEditable"); - function isInput(node) { - return node.tagName === "INPUT"; - } - __name(isInput, "isInput"); - function isHiddenInput(node) { - return isInput(node) && node.type === "hidden"; - } - __name(isHiddenInput, "isHiddenInput"); - function isRadio(node) { - return isInput(node) && node.type === "radio"; - } - __name(isRadio, "isRadio"); - function isNonTabbableRadio(node) { - return isRadio(node) && !isTabbableRadio(node); - } - __name(isNonTabbableRadio, "isNonTabbableRadio"); - function getCheckedRadio(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].checked) { - return nodes[i]; - } - } - } - __name(getCheckedRadio, "getCheckedRadio"); - function isTabbableRadio(node) { - if (!node.name) return true; - var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]'); - var checked = getCheckedRadio(radioSet); - return !checked || checked === node; - } - __name(isTabbableRadio, "isTabbableRadio"); - function isHidden(node) { - return node.offsetParent === null || getComputedStyle(node).visibility === "hidden"; - } - __name(isHidden, "isHidden"); - var tabbable_1 = tabbable; - function _extends$7() { - _extends$7 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$7.apply(this, arguments); - } - __name(_extends$7, "_extends$7"); - function _objectWithoutPropertiesLoose$7(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$7, "_objectWithoutPropertiesLoose$7"); - var _excluded$7 = ["unstable_skipInitialPortalRender"], - _excluded2$4 = ["as", "targetRef", "position", "unstable_observableRefs"]; - var Popover = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function Popover2(_ref2, ref) { - var unstable_skipInitialPortalRender = _ref2.unstable_skipInitialPortalRender, - props2 = _objectWithoutPropertiesLoose$7(_ref2, _excluded$7); - return /* @__PURE__ */(0, React.createElement)(Portal, { - unstable_skipInitialRender: unstable_skipInitialPortalRender - }, /* @__PURE__ */(0, React.createElement)(PopoverImpl, _extends$7({ - ref - }, props2))); - }, "Popover")); - var PopoverImpl = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function PopoverImpl2(_ref2, forwardedRef) { - var _ref2$as = _ref2.as, - Comp = _ref2$as === void 0 ? "div" : _ref2$as, - targetRef = _ref2.targetRef, - _ref2$position = _ref2.position, - position = _ref2$position === void 0 ? positionDefault : _ref2$position, - _ref2$unstable_observ = _ref2.unstable_observableRefs, - unstable_observableRefs = _ref2$unstable_observ === void 0 ? [] : _ref2$unstable_observ, - props2 = _objectWithoutPropertiesLoose$7(_ref2, _excluded2$4); - var popoverRef = (0, React.useRef)(null); - var popoverRect = useRect(popoverRef, { - observe: !props2.hidden - }); - var targetRect = useRect(targetRef, { - observe: !props2.hidden - }); - var ref = useComposedRefs(popoverRef, forwardedRef); - useSimulateTabNavigationForReactTree(targetRef, popoverRef); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$7({ - "data-reach-popover": "", - ref - }, props2, { - style: _extends$7({ - position: "absolute" - }, getStyles$1.apply(void 0, [position, targetRect, popoverRect].concat(unstable_observableRefs)), props2.style) - })); - }, "PopoverImpl")); - function getStyles$1(position, targetRect, popoverRect) { - for (var _len = arguments.length, unstable_observableRefs = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { - unstable_observableRefs[_key - 3] = arguments[_key]; - } - return popoverRect ? position.apply(void 0, [targetRect, popoverRect].concat(unstable_observableRefs.map(function (ref) { - return ref.current; - }))) : { - visibility: "hidden" - }; - } - __name(getStyles$1, "getStyles$1"); - function getTopPosition(targetRect, popoverRect, isDirectionUp) { - return { - top: isDirectionUp ? targetRect.top - popoverRect.height + window.pageYOffset + "px" : targetRect.top + targetRect.height + window.pageYOffset + "px" - }; - } - __name(getTopPosition, "getTopPosition"); - var positionDefault = /* @__PURE__ */__name(function positionDefault2(targetRect, popoverRect) { - if (!targetRect || !popoverRect) { - return {}; - } - var _getCollisions = getCollisions(targetRect, popoverRect), - directionRight = _getCollisions.directionRight, - directionUp = _getCollisions.directionUp; - return _extends$7({ - left: directionRight ? targetRect.right - popoverRect.width + window.pageXOffset + "px" : targetRect.left + window.pageXOffset + "px" - }, getTopPosition(targetRect, popoverRect, directionUp)); - }, "positionDefault"); - var positionMatchWidth = /* @__PURE__ */__name(function positionMatchWidth2(targetRect, popoverRect) { - if (!targetRect || !popoverRect) { - return {}; - } - var _getCollisions3 = getCollisions(targetRect, popoverRect), - directionUp = _getCollisions3.directionUp; - return _extends$7({ - width: targetRect.width, - left: targetRect.left - }, getTopPosition(targetRect, popoverRect, directionUp)); - }, "positionMatchWidth"); - function getCollisions(targetRect, popoverRect, offsetLeft, offsetBottom) { - if (offsetLeft === void 0) { - offsetLeft = 0; - } - if (offsetBottom === void 0) { - offsetBottom = 0; - } - var collisions = { - top: targetRect.top - popoverRect.height < 0, - right: window.innerWidth < targetRect.left + popoverRect.width - offsetLeft, - bottom: window.innerHeight < targetRect.bottom + popoverRect.height - offsetBottom, - left: targetRect.left + targetRect.width - popoverRect.width < 0 - }; - var directionRight = collisions.right && !collisions.left; - var directionLeft = collisions.left && !collisions.right; - var directionUp = collisions.bottom && !collisions.top; - var directionDown = collisions.top && !collisions.bottom; - return { - directionRight, - directionLeft, - directionUp, - directionDown - }; - } - __name(getCollisions, "getCollisions"); - function useSimulateTabNavigationForReactTree(triggerRef, popoverRef) { - var ownerDocument = getOwnerDocument(triggerRef.current); - function handleKeyDown(event) { - if (event.key === "Tab" && popoverRef.current && tabbable_1(popoverRef.current).length === 0) { - return; - } - if (event.key === "Tab" && event.shiftKey) { - if (shiftTabbedFromElementAfterTrigger(event)) { - focusLastTabbableInPopover(event); - } else if (shiftTabbedOutOfPopover(event)) { - focusTriggerRef(event); - } else if (shiftTabbedToBrowserChrome(event)) { - disableTabbablesInPopover(); - } - } else if (event.key === "Tab") { - if (tabbedFromTriggerToPopover()) { - focusFirstPopoverTabbable(event); - } else if (tabbedOutOfPopover()) { - focusTabbableAfterTrigger(event); - } else if (tabbedToBrowserChrome(event)) { - disableTabbablesInPopover(); - } - } - } - __name(handleKeyDown, "handleKeyDown"); - (0, React.useEffect)(function () { - ownerDocument.addEventListener("keydown", handleKeyDown); - return function () { - ownerDocument.removeEventListener("keydown", handleKeyDown); - }; - }, []); - function getElementAfterTrigger() { - var elements = tabbable_1(ownerDocument); - var targetIndex = elements && triggerRef.current ? elements.indexOf(triggerRef.current) : -1; - var elementAfterTrigger = elements && elements[targetIndex + 1]; - return popoverRef.current && popoverRef.current.contains(elementAfterTrigger || null) ? false : elementAfterTrigger; - } - __name(getElementAfterTrigger, "getElementAfterTrigger"); - function tabbedFromTriggerToPopover() { - return triggerRef.current ? triggerRef.current === ownerDocument.activeElement : false; - } - __name(tabbedFromTriggerToPopover, "tabbedFromTriggerToPopover"); - function focusFirstPopoverTabbable(event) { - var elements = popoverRef.current && tabbable_1(popoverRef.current); - if (elements && elements[0]) { - event.preventDefault(); - elements[0].focus(); - } - } - __name(focusFirstPopoverTabbable, "focusFirstPopoverTabbable"); - function tabbedOutOfPopover() { - var inPopover = popoverRef.current ? popoverRef.current.contains(ownerDocument.activeElement || null) : false; - if (inPopover) { - var elements = popoverRef.current && tabbable_1(popoverRef.current); - return Boolean(elements && elements[elements.length - 1] === ownerDocument.activeElement); - } - return false; - } - __name(tabbedOutOfPopover, "tabbedOutOfPopover"); - function focusTabbableAfterTrigger(event) { - var elementAfterTrigger = getElementAfterTrigger(); - if (elementAfterTrigger) { - event.preventDefault(); - elementAfterTrigger.focus(); - } - } - __name(focusTabbableAfterTrigger, "focusTabbableAfterTrigger"); - function shiftTabbedFromElementAfterTrigger(event) { - if (!event.shiftKey) return; - var elementAfterTrigger = getElementAfterTrigger(); - return event.target === elementAfterTrigger; - } - __name(shiftTabbedFromElementAfterTrigger, "shiftTabbedFromElementAfterTrigger"); - function focusLastTabbableInPopover(event) { - var elements = popoverRef.current && tabbable_1(popoverRef.current); - var last = elements && elements[elements.length - 1]; - if (last) { - event.preventDefault(); - last.focus(); - } - } - __name(focusLastTabbableInPopover, "focusLastTabbableInPopover"); - function shiftTabbedOutOfPopover(event) { - var elements = popoverRef.current && tabbable_1(popoverRef.current); - if (elements) { - return elements.length === 0 ? false : event.target === elements[0]; - } - return false; - } - __name(shiftTabbedOutOfPopover, "shiftTabbedOutOfPopover"); - function focusTriggerRef(event) { - var _triggerRef$current; - event.preventDefault(); - (_triggerRef$current = triggerRef.current) == null ? void 0 : _triggerRef$current.focus(); - } - __name(focusTriggerRef, "focusTriggerRef"); - function tabbedToBrowserChrome(event) { - var elements = popoverRef.current ? tabbable_1(ownerDocument).filter(function (element) { - return !popoverRef.current.contains(element); - }) : null; - return elements ? event.target === elements[elements.length - 1] : false; - } - __name(tabbedToBrowserChrome, "tabbedToBrowserChrome"); - function shiftTabbedToBrowserChrome(event) { - return event.target === tabbable_1(ownerDocument)[0]; - } - __name(shiftTabbedToBrowserChrome, "shiftTabbedToBrowserChrome"); - var restoreTabIndexTuplés = []; - function disableTabbablesInPopover() { - var elements = popoverRef.current && tabbable_1(popoverRef.current); - if (elements) { - elements.forEach(function (element) { - restoreTabIndexTuplés.push([element, element.tabIndex]); - element.tabIndex = -1; - }); - ownerDocument.addEventListener("focusin", enableTabbablesInPopover); - } - } - __name(disableTabbablesInPopover, "disableTabbablesInPopover"); - function enableTabbablesInPopover() { - ownerDocument.removeEventListener("focusin", enableTabbablesInPopover); - restoreTabIndexTuplés.forEach(function (_ref3) { - var element = _ref3[0], - tabIndex = _ref3[1]; - element.tabIndex = tabIndex; - }); - } - __name(enableTabbablesInPopover, "enableTabbablesInPopover"); - } - __name(useSimulateTabNavigationForReactTree, "useSimulateTabNavigationForReactTree"); - function _objectWithoutPropertiesLoose$6(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$6, "_objectWithoutPropertiesLoose$6"); - function _extends$6() { - _extends$6 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$6.apply(this, arguments); - } - __name(_extends$6, "_extends$6"); - var _excluded$6 = ["element", "index"]; - function createDescendantContext(name2, initialValue) { - if (initialValue === void 0) { - initialValue = {}; - } - var descendants = []; - var ctx = /* @__PURE__ */(0, React.createContext)(_extends$6({ - descendants, - registerDescendant: noop, - unregisterDescendant: noop - }, initialValue)); - return ctx; - } - __name(createDescendantContext, "createDescendantContext"); - function useDescendant(descendant, context, indexProp) { - var forceUpdate = useForceUpdate(); - var _React$useContext = (0, React.useContext)(context), - registerDescendant = _React$useContext.registerDescendant, - unregisterDescendant = _React$useContext.unregisterDescendant, - descendants = _React$useContext.descendants; - var index = indexProp != null ? indexProp : descendants.findIndex(function (item) { - return item.element === descendant.element; - }); - useIsomorphicLayoutEffect(function () { - if (!descendant.element) forceUpdate(); - registerDescendant(_extends$6({}, descendant, { - index - })); - return function () { - unregisterDescendant(descendant.element); - }; - }, [descendant, forceUpdate, index, registerDescendant, unregisterDescendant].concat(Object.values(descendant))); - return index; - } - __name(useDescendant, "useDescendant"); - function useDescendantsInit() { - return (0, React.useState)([]); - } - __name(useDescendantsInit, "useDescendantsInit"); - function useDescendants(ctx) { - return (0, React.useContext)(ctx).descendants; - } - __name(useDescendants, "useDescendants"); - function DescendantProvider(_ref2) { - var Ctx = _ref2.context, - children = _ref2.children, - items = _ref2.items, - set2 = _ref2.set; - var registerDescendant = (0, React.useCallback)(function (_ref22) { - var element = _ref22.element, - explicitIndex = _ref22.index, - rest = _objectWithoutPropertiesLoose$6(_ref22, _excluded$6); - if (!element) { - return; - } - set2(function (items2) { - var newItems; - if (explicitIndex != null) { - return [].concat(items2, [_extends$6({}, rest, { - element, - index: explicitIndex - })]).sort(function (a2, b2) { - return a2.index - b2.index; - }); - } else if (items2.length === 0) { - newItems = [_extends$6({}, rest, { - element, - index: 0 - })]; - } else if (items2.find(function (item) { - return item.element === element; - })) { - newItems = items2; - } else { - var index = items2.findIndex(function (item) { - if (!item.element || !element) { - return false; - } - return Boolean(item.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING); - }); - var newItem = _extends$6({}, rest, { - element, - index - }); - if (index === -1) { - newItems = [].concat(items2, [newItem]); - } else { - newItems = [].concat(items2.slice(0, index), [newItem], items2.slice(index)); - } - } - return newItems.map(function (item, index2) { - return _extends$6({}, item, { - index: index2 - }); - }); - }); - }, []); - var unregisterDescendant = (0, React.useCallback)(function (element) { - if (!element) { - return; - } - set2(function (items2) { - return items2.filter(function (item) { - return element !== item.element; - }); - }); - }, []); - return /* @__PURE__ */(0, React.createElement)(Ctx.Provider, { - value: (0, React.useMemo)(function () { - return { - descendants: items, - registerDescendant, - unregisterDescendant - }; - }, [items, registerDescendant, unregisterDescendant]) - }, children); - } - __name(DescendantProvider, "DescendantProvider"); - function useDescendantKeyDown(context, options) { - var _React$useContext2 = (0, React.useContext)(context), - descendants = _React$useContext2.descendants; - var callback = options.callback, - currentIndex = options.currentIndex, - filter = options.filter, - _options$key = options.key, - key = _options$key === void 0 ? "index" : _options$key, - _options$orientation = options.orientation, - orientation = _options$orientation === void 0 ? "vertical" : _options$orientation, - _options$rotate = options.rotate, - rotate = _options$rotate === void 0 ? true : _options$rotate, - _options$rtl = options.rtl, - rtl = _options$rtl === void 0 ? false : _options$rtl; - return /* @__PURE__ */__name(function handleKeyDown(event) { - if (!["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"].includes(event.key)) { - return; - } - var index = currentIndex != null ? currentIndex : -1; - var selectableDescendants = filter ? descendants.filter(filter) : descendants; - if (!selectableDescendants.length) { - return; - } - var selectableIndex = selectableDescendants.findIndex(function (descendant) { - return descendant.index === currentIndex; - }); - function getNextOption() { - var atBottom = index === getLastOption().index; - return atBottom ? rotate ? getFirstOption() : selectableDescendants[selectableIndex] : selectableDescendants[(selectableIndex + 1) % selectableDescendants.length]; - } - __name(getNextOption, "getNextOption"); - function getPreviousOption() { - var atTop = index === getFirstOption().index; - return atTop ? rotate ? getLastOption() : selectableDescendants[selectableIndex] : selectableDescendants[(selectableIndex - 1 + selectableDescendants.length) % selectableDescendants.length]; - } - __name(getPreviousOption, "getPreviousOption"); - function getFirstOption() { - return selectableDescendants[0]; - } - __name(getFirstOption, "getFirstOption"); - function getLastOption() { - return selectableDescendants[selectableDescendants.length - 1]; - } - __name(getLastOption, "getLastOption"); - switch (event.key) { - case "ArrowDown": - if (orientation === "vertical" || orientation === "both") { - event.preventDefault(); - var next = getNextOption(); - callback(key === "option" ? next : next[key]); - } - break; - case "ArrowUp": - if (orientation === "vertical" || orientation === "both") { - event.preventDefault(); - var prev = getPreviousOption(); - callback(key === "option" ? prev : prev[key]); - } - break; - case "ArrowLeft": - if (orientation === "horizontal" || orientation === "both") { - event.preventDefault(); - var nextOrPrev = (rtl ? getNextOption : getPreviousOption)(); - callback(key === "option" ? nextOrPrev : nextOrPrev[key]); - } - break; - case "ArrowRight": - if (orientation === "horizontal" || orientation === "both") { - event.preventDefault(); - var prevOrNext = (rtl ? getPreviousOption : getNextOption)(); - callback(key === "option" ? prevOrNext : prevOrNext[key]); - } - break; - case "PageUp": - event.preventDefault(); - var prevOrFirst = (event.ctrlKey ? getPreviousOption : getFirstOption)(); - callback(key === "option" ? prevOrFirst : prevOrFirst[key]); - break; - case "Home": - event.preventDefault(); - var first = getFirstOption(); - callback(key === "option" ? first : first[key]); - break; - case "PageDown": - event.preventDefault(); - var nextOrLast = (event.ctrlKey ? getNextOption : getLastOption)(); - callback(key === "option" ? nextOrLast : nextOrLast[key]); - break; - case "End": - event.preventDefault(); - var last = getLastOption(); - callback(key === "option" ? last : last[key]); - break; - } - }, "handleKeyDown"); - } - __name(useDescendantKeyDown, "useDescendantKeyDown"); - function isRightClick(nativeEvent) { - return "which" in nativeEvent ? nativeEvent.which === 3 : "button" in nativeEvent ? nativeEvent.button === 2 : false; - } - __name(isRightClick, "isRightClick"); - function createStableCallbackHook(useEffectHook, callback) { - var callbackRef = (0, React.useRef)(callback); - useEffectHook(function () { - callbackRef.current = callback; - }); - return (0, React.useCallback)(function () { - callbackRef.current && callbackRef.current.apply(callbackRef, arguments); - }, []); - } - __name(createStableCallbackHook, "createStableCallbackHook"); - function useStableCallback(callback) { - return createStableCallbackHook(React.useEffect, callback); - } - __name(useStableCallback, "useStableCallback"); - function _objectWithoutPropertiesLoose$5(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$5, "_objectWithoutPropertiesLoose$5"); - var _excluded$5 = ["children"]; - function createNamedContext(name2, defaultValue2) { - var Ctx = /* @__PURE__ */(0, React.createContext)(defaultValue2); - return Ctx; - } - __name(createNamedContext, "createNamedContext"); - function createContext(rootName, defaultContext) { - var Ctx = /* @__PURE__ */(0, React.createContext)(defaultContext); - function Provider(props2) { - var children = props2.children, - context = _objectWithoutPropertiesLoose$5(props2, _excluded$5); - var value3 = (0, React.useMemo)(function () { - return context; - }, Object.values(context)); - return /* @__PURE__ */(0, React.createElement)(Ctx.Provider, { - value: value3 - }, children); - } - __name(Provider, "Provider"); - function useContext$1(childName) { - var context = (0, React.useContext)(Ctx); - if (context) { - return context; - } - if (defaultContext) { - return defaultContext; - } - throw Error(childName + " must be rendered inside of a " + rootName + " component."); - } - __name(useContext$1, "useContext$1"); - return [Provider, useContext$1]; - } - __name(createContext, "createContext"); - function makeId() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.filter(function (val) { - return val != null; - }).join("--"); - } - __name(makeId, "makeId"); - function useStatefulRefValue(ref, initialState2) { - var _useState = (0, React.useState)(initialState2), - state2 = _useState[0], - setState = _useState[1]; - var callbackRef = (0, React.useCallback)(function (refValue) { - ref.current = refValue; - setState(refValue); - }, []); - return [state2, callbackRef]; - } - __name(useStatefulRefValue, "useStatefulRefValue"); - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - var t$1; - !function (t2) { - t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped"; - }(t$1 || (t$1 = {})); - var n$1 = { - type: "xstate.init" - }; - function e$1(t2) { - return t2 === void 0 ? [] : [].concat(t2); - } - __name(e$1, "e$1"); - function r$1(t2) { - return { - type: "xstate.assign", - assignment: t2 - }; - } - __name(r$1, "r$1"); - function i$1(t2, n2) { - return typeof (t2 = typeof t2 == "string" && n2 && n2[t2] ? n2[t2] : t2) == "string" ? { - type: t2 - } : typeof t2 == "function" ? { - type: t2.name, - exec: t2 - } : t2; - } - __name(i$1, "i$1"); - function o(t2) { - return function (n2) { - return t2 === n2; - }; - } - __name(o, "o"); - function a(t2) { - return typeof t2 == "string" ? { - type: t2 - } : t2; - } - __name(a, "a"); - function u(t2, n2) { - return { - value: t2, - context: n2, - actions: [], - changed: false, - matches: o(t2) - }; - } - __name(u, "u"); - function c$1(t2, n2) { - n2 === void 0 && (n2 = {}); - var r2 = { - config: t2, - _options: n2, - initialState: { - value: t2.initial, - actions: e$1(t2.states[t2.initial].entry).map(function (t3) { - return i$1(t3, n2.actions); - }), - context: t2.context, - matches: o(t2.initial) - }, - transition: function (n3, c2) { - var s2, - f2, - l2 = typeof n3 == "string" ? { - value: n3, - context: t2.context - } : n3, - v2 = l2.value, - p2 = l2.context, - g2 = a(c2), - y2 = t2.states[v2]; - if (y2.on) { - var d2 = e$1(y2.on[g2.type]), - x2 = /* @__PURE__ */__name(function (n4) { - if (n4 === void 0) return { - value: u(v2, p2) - }; - var e2 = typeof n4 == "string" ? { - target: n4 - } : n4, - a2 = e2.target, - c3 = a2 === void 0 ? v2 : a2, - s3 = e2.actions, - f3 = s3 === void 0 ? [] : s3, - l3 = e2.cond, - d3 = p2; - if ((l3 === void 0 ? function () { - return true; - } : l3)(p2, g2)) { - var x3 = t2.states[c3], - m3 = false, - h3 = [].concat(y2.exit, f3, x3.entry).filter(function (t3) { - return t3; - }).map(function (t3) { - return i$1(t3, r2._options.actions); - }).filter(function (t3) { - if (t3.type === "xstate.assign") { - m3 = true; - var n5 = Object.assign({}, d3); - return typeof t3.assignment == "function" ? n5 = t3.assignment(d3, g2) : Object.keys(t3.assignment).forEach(function (e3) { - n5[e3] = typeof t3.assignment[e3] == "function" ? t3.assignment[e3](d3, g2) : t3.assignment[e3]; - }), d3 = n5, false; - } - return true; - }); - return { - value: { - value: c3, - context: d3, - actions: h3, - changed: c3 !== v2 || h3.length > 0 || m3, - matches: o(c3) - } - }; - } - }, "x"); - try { - for (var m2 = function (t3) { - var n4 = typeof Symbol == "function" && t3[Symbol.iterator], - e2 = 0; - return n4 ? n4.call(t3) : { - next: function () { - return t3 && e2 >= t3.length && (t3 = void 0), { - value: t3 && t3[e2++], - done: !t3 - }; - } - }; - }(d2), h2 = m2.next(); !h2.done; h2 = m2.next()) { - var S = x2(h2.value); - if (typeof S == "object") return S.value; - } - } catch (t3) { - s2 = { - error: t3 - }; - } finally { - try { - h2 && !h2.done && (f2 = m2.return) && f2.call(m2); - } finally { - if (s2) throw s2.error; - } - } - } - return u(v2, p2); - } - }; - return r2; - } - __name(c$1, "c$1"); - var s = /* @__PURE__ */__name(function (t2, n2) { - return t2.actions.forEach(function (e2) { - var r2 = e2.exec; - return r2 && r2(t2.context, n2); - }); - }, "s"); - function f$1(e2) { - var r2 = e2.initialState, - i = t$1.NotStarted, - o2 = /* @__PURE__ */new Set(), - u2 = { - _machine: e2, - send: function (n2) { - i === t$1.Running && (r2 = e2.transition(r2, n2), s(r2, a(n2)), o2.forEach(function (t2) { - return t2(r2); - })); - }, - subscribe: function (t2) { - return o2.add(t2), t2(r2), { - unsubscribe: function () { - return o2.delete(t2); - } - }; - }, - start: function () { - return i = t$1.Running, s(r2, n$1), u2; - }, - stop: function () { - return i = t$1.Stopped, o2.clear(), u2; - }, - get state() { - return r2; - }, - get status() { - return i; - } - }; - return u2; - } - __name(f$1, "f$1"); - function useConstant(fn) { - var ref = (0, React.useRef)(); - if (!ref.current) { - ref.current = { - v: fn() - }; - } - return ref.current.v; - } - __name(useConstant, "useConstant"); - function _extends$5() { - _extends$5 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$5.apply(this, arguments); - } - __name(_extends$5, "_extends$5"); - var getServiceState = /* @__PURE__ */__name(function getServiceState2(service) { - var currentValue; - service.subscribe(function (state2) { - currentValue = state2; - }).unsubscribe(); - return currentValue; - }, "getServiceState"); - function useMachine(initialMachine, refs, DEBUG2) { - var machineRef = (0, React.useRef)(initialMachine); - var service = useConstant(function () { - return f$1(machineRef.current).start(); - }); - var lastEventType = (0, React.useRef)(null); - var _React$useState = (0, React.useState)(function () { - return getServiceState(service); - }), - state2 = _React$useState[0], - setState = _React$useState[1]; - var send2 = (0, React.useCallback)(function (rawEvent) { - var event = isString$1(rawEvent) ? { - type: rawEvent - } : rawEvent; - var refValues = unwrapRefs(refs); - service.send(_extends$5({}, event, { - lastEventType: lastEventType.current, - refs: refValues - })); - lastEventType.current = event.type; - }, [DEBUG2]); - (0, React.useEffect)(function () { - service.subscribe( /* @__PURE__ */__name(function setStateIfChanged(newState) { - if (newState.changed) { - setState(newState); - } - }, "setStateIfChanged")); - return function () { - service.stop(); - }; - }, [service]); - (0, React.useEffect)(function () {}, [DEBUG2, state2]); - var memoizedState = (0, React.useMemo)(function () { - return _extends$5({}, state2, { - matches: /* @__PURE__ */__name(function matches2(value3) { - return value3 === state2.value; - }, "matches") - }); - }, [state2.changed, state2.context, state2.value]); - return [memoizedState, send2, service]; - } - __name(useMachine, "useMachine"); - function unwrapRefs(refs) { - return Object.entries(refs).reduce(function (value3, _ref2) { - var name2 = _ref2[0], - ref = _ref2[1]; - value3[name2] = ref.current; - return value3; - }, {}); - } - __name(unwrapRefs, "unwrapRefs"); - function useCreateMachine(machineDefinition, options) { - return useConstant(function () { - return c$1(machineDefinition, options); - }); - } - __name(useCreateMachine, "useCreateMachine"); - function _extends$4() { - _extends$4 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$4.apply(this, arguments); - } - __name(_extends$4, "_extends$4"); - function _objectWithoutPropertiesLoose$4(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$4, "_objectWithoutPropertiesLoose$4"); - var _commonEvents; - var ListboxStates; - (function (ListboxStates2) { - ListboxStates2["Idle"] = "IDLE"; - ListboxStates2["Open"] = "OPEN"; - ListboxStates2["Navigating"] = "NAVIGATING"; - ListboxStates2["Dragging"] = "DRAGGING"; - ListboxStates2["Interacting"] = "INTERACTING"; - })(ListboxStates || (ListboxStates = {})); - var ListboxEvents; - (function (ListboxEvents2) { - ListboxEvents2["ButtonMouseDown"] = "BUTTON_MOUSE_DOWN"; - ListboxEvents2["ButtonMouseUp"] = "BUTTON_MOUSE_UP"; - ListboxEvents2["Blur"] = "BLUR"; - ListboxEvents2["ClearNavSelection"] = "CLEAR_NAV_SELECTION"; - ListboxEvents2["ClearTypeahead"] = "CLEAR_TYPEAHEAD"; - ListboxEvents2["GetDerivedData"] = "GET_DERIVED_DATA"; - ListboxEvents2["KeyDownEscape"] = "KEY_DOWN_ESCAPE"; - ListboxEvents2["KeyDownEnter"] = "KEY_DOWN_ENTER"; - ListboxEvents2["KeyDownSpace"] = "KEY_DOWN_SPACE"; - ListboxEvents2["KeyDownNavigate"] = "KEY_DOWN_NAVIGATE"; - ListboxEvents2["KeyDownSearch"] = "KEY_DOWN_SEARCH"; - ListboxEvents2["KeyDownTab"] = "KEY_DOWN_TAB"; - ListboxEvents2["KeyDownShiftTab"] = "KEY_DOWN_SHIFT_TAB"; - ListboxEvents2["OptionTouchStart"] = "OPTION_TOUCH_START"; - ListboxEvents2["OptionMouseMove"] = "OPTION_MOUSE_MOVE"; - ListboxEvents2["OptionMouseEnter"] = "OPTION_MOUSE_ENTER"; - ListboxEvents2["OptionMouseDown"] = "OPTION_MOUSE_DOWN"; - ListboxEvents2["OptionMouseUp"] = "OPTION_MOUSE_UP"; - ListboxEvents2["OptionClick"] = "OPTION_CLICK"; - ListboxEvents2["ListMouseUp"] = "LIST_MOUSE_UP"; - ListboxEvents2["OptionPress"] = "OPTION_PRESS"; - ListboxEvents2["OutsideMouseDown"] = "OUTSIDE_MOUSE_DOWN"; - ListboxEvents2["OutsideMouseUp"] = "OUTSIDE_MOUSE_UP"; - ListboxEvents2["ValueChange"] = "VALUE_CHANGE"; - ListboxEvents2["PopoverPointerDown"] = "POPOVER_POINTER_DOWN"; - ListboxEvents2["PopoverPointerUp"] = "POPOVER_POINTER_UP"; - ListboxEvents2["UpdateAfterTypeahead"] = "UPDATE_AFTER_TYPEAHEAD"; - })(ListboxEvents || (ListboxEvents = {})); - var clearNavigationValue = /* @__PURE__ */r$1({ - navigationValue: null - }); - var clearTypeahead = /* @__PURE__ */r$1({ - typeaheadQuery: null - }); - var assignValue = /* @__PURE__ */r$1({ - value: /* @__PURE__ */__name(function value(_, event) { - return event.value; - }, "value") - }); - var navigate = /* @__PURE__ */r$1({ - navigationValue: /* @__PURE__ */__name(function navigationValue(data, event) { - return event.value; - }, "navigationValue") - }); - var navigateFromCurrentValue = /* @__PURE__ */r$1({ - navigationValue: /* @__PURE__ */__name(function navigationValue2(data) { - var selected = findOptionFromValue(data.value, data.options); - if (selected && !selected.disabled) { - return data.value; - } else { - var _data$options$find; - return ((_data$options$find = data.options.find(function (option) { - return !option.disabled; - })) == null ? void 0 : _data$options$find.value) || null; - } - }, "navigationValue") - }); - function listboxLostFocus(data, event) { - if (event.type === ListboxEvents.Blur) { - var _event$refs = event.refs, - list3 = _event$refs.list, - popover = _event$refs.popover; - var relatedTarget = event.relatedTarget; - var ownerDocument = getOwnerDocument(popover); - return !!((ownerDocument == null ? void 0 : ownerDocument.activeElement) !== list3 && popover && !popover.contains(relatedTarget || (ownerDocument == null ? void 0 : ownerDocument.activeElement))); - } - return false; - } - __name(listboxLostFocus, "listboxLostFocus"); - function clickedOutsideOfListbox(data, event) { - if (event.type === ListboxEvents.OutsideMouseDown || event.type === ListboxEvents.OutsideMouseUp) { - var _event$refs2 = event.refs, - button2 = _event$refs2.button, - popover = _event$refs2.popover; - var relatedTarget = event.relatedTarget; - return !!(relatedTarget !== button2 && button2 && !button2.contains(relatedTarget) && popover && !popover.contains(relatedTarget)); - } - return false; - } - __name(clickedOutsideOfListbox, "clickedOutsideOfListbox"); - function optionIsActive(data, event) { - return !!data.options.find(function (option) { - return option.value === data.navigationValue; - }); - } - __name(optionIsActive, "optionIsActive"); - function shouldNavigate(data, event) { - var _event$refs3 = event.refs, - popover = _event$refs3.popover, - list3 = _event$refs3.list; - var relatedTarget = event.relatedTarget; - if (popover && relatedTarget && popover.contains(relatedTarget) && relatedTarget !== list3) { - return false; - } - return optionIsActive(data); - } - __name(shouldNavigate, "shouldNavigate"); - function focusList(data, event) { - requestAnimationFrame(function () { - event.refs.list && event.refs.list.focus(); - }); - } - __name(focusList, "focusList"); - function focusButton(data, event) { - event.refs.button && event.refs.button.focus(); - } - __name(focusButton, "focusButton"); - function listboxIsNotDisabled(data, event) { - return !event.disabled; - } - __name(listboxIsNotDisabled, "listboxIsNotDisabled"); - function optionIsNavigable(data, event) { - if (event.type === ListboxEvents.OptionTouchStart) { - if (event && event.disabled) { - return false; - } - } - return true; - } - __name(optionIsNavigable, "optionIsNavigable"); - function optionIsSelectable(data, event) { - if ("disabled" in event && event.disabled) { - return false; - } - if ("value" in event) { - return event.value != null; - } - return data.navigationValue != null; - } - __name(optionIsSelectable, "optionIsSelectable"); - function selectOption(data, event) { - event.callback && event.callback(event.value); - } - __name(selectOption, "selectOption"); - function submitForm(data, event) { - if (event.type !== ListboxEvents.KeyDownEnter) { - return; - } - var hiddenInput = event.refs.hiddenInput; - if (hiddenInput && hiddenInput.form) { - var submitButton = hiddenInput.form.querySelector("button:not([type]),[type='submit']"); - submitButton && submitButton.click(); - } - } - __name(submitForm, "submitForm"); - var setTypeahead = /* @__PURE__ */r$1({ - typeaheadQuery: /* @__PURE__ */__name(function typeaheadQuery(data, event) { - return (data.typeaheadQuery || "") + event.query; - }, "typeaheadQuery") - }); - var setValueFromTypeahead = /* @__PURE__ */r$1({ - value: /* @__PURE__ */__name(function value2(data, event) { - if (event.type === ListboxEvents.UpdateAfterTypeahead && event.query) { - var match2 = findOptionFromTypeahead(data.options, event.query); - if (match2 && !match2.disabled) { - event.callback && event.callback(match2.value); - return match2.value; - } - } - return data.value; - }, "value") - }); - var setNavSelectionFromTypeahead = /* @__PURE__ */r$1({ - navigationValue: /* @__PURE__ */__name(function navigationValue3(data, event) { - if (event.type === ListboxEvents.UpdateAfterTypeahead && event.query) { - var match2 = findOptionFromTypeahead(data.options, event.query); - if (match2 && !match2.disabled) { - return match2.value; - } - } - return data.navigationValue; - }, "navigationValue") - }); - var commonEvents = (_commonEvents = {}, _commonEvents[ListboxEvents.GetDerivedData] = { - actions: /* @__PURE__ */r$1(function (ctx, event) { - return _extends$4({}, ctx, event.data); - }) - }, _commonEvents[ListboxEvents.ValueChange] = { - actions: [assignValue, selectOption] - }, _commonEvents); - var createMachineDefinition = /* @__PURE__ */__name(function createMachineDefinition2(_ref2) { - var _extends2, _extends3, _extends4, _extends5, _extends6, _states2; - var value3 = _ref2.value; - return { - id: "listbox", - initial: ListboxStates.Idle, - context: { - value: value3, - options: [], - navigationValue: null, - typeaheadQuery: null - }, - states: (_states2 = {}, _states2[ListboxStates.Idle] = { - on: _extends$4({}, commonEvents, (_extends2 = {}, _extends2[ListboxEvents.ButtonMouseDown] = { - target: ListboxStates.Open, - actions: [navigateFromCurrentValue], - cond: listboxIsNotDisabled - }, _extends2[ListboxEvents.KeyDownSpace] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, focusList], - cond: listboxIsNotDisabled - }, _extends2[ListboxEvents.KeyDownSearch] = { - target: ListboxStates.Idle, - actions: setTypeahead, - cond: listboxIsNotDisabled - }, _extends2[ListboxEvents.UpdateAfterTypeahead] = { - target: ListboxStates.Idle, - actions: [setValueFromTypeahead], - cond: listboxIsNotDisabled - }, _extends2[ListboxEvents.ClearTypeahead] = { - target: ListboxStates.Idle, - actions: clearTypeahead - }, _extends2[ListboxEvents.KeyDownNavigate] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, clearTypeahead, focusList], - cond: listboxIsNotDisabled - }, _extends2[ListboxEvents.KeyDownEnter] = { - actions: [submitForm], - cond: listboxIsNotDisabled - }, _extends2)) - }, _states2[ListboxStates.Interacting] = { - entry: [clearNavigationValue], - on: _extends$4({}, commonEvents, (_extends3 = {}, _extends3[ListboxEvents.ClearNavSelection] = { - actions: [clearNavigationValue, focusList] - }, _extends3[ListboxEvents.KeyDownEnter] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends3[ListboxEvents.KeyDownSpace] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends3[ListboxEvents.ButtonMouseDown] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends3[ListboxEvents.KeyDownEscape] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends3[ListboxEvents.OptionMouseDown] = { - target: ListboxStates.Dragging - }, _extends3[ListboxEvents.OutsideMouseDown] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Dragging, - actions: clearTypeahead, - cond: optionIsActive - }], _extends3[ListboxEvents.OutsideMouseUp] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends3[ListboxEvents.KeyDownEnter] = ListboxStates.Interacting, _extends3[ListboxEvents.Blur] = [{ - target: ListboxStates.Idle, - cond: listboxLostFocus, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: shouldNavigate - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends3[ListboxEvents.OptionTouchStart] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends3[ListboxEvents.OptionClick] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends3[ListboxEvents.OptionPress] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends3[ListboxEvents.OptionMouseEnter] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends3[ListboxEvents.KeyDownNavigate] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead, focusList] - }, _extends3)) - }, _states2[ListboxStates.Open] = { - on: _extends$4({}, commonEvents, (_extends4 = {}, _extends4[ListboxEvents.ClearNavSelection] = { - actions: [clearNavigationValue] - }, _extends4[ListboxEvents.KeyDownEnter] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends4[ListboxEvents.KeyDownSpace] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends4[ListboxEvents.ButtonMouseDown] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends4[ListboxEvents.KeyDownEscape] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends4[ListboxEvents.OptionMouseDown] = { - target: ListboxStates.Dragging - }, _extends4[ListboxEvents.OutsideMouseDown] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Dragging, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends4[ListboxEvents.OutsideMouseUp] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends4[ListboxEvents.Blur] = [{ - target: ListboxStates.Idle, - cond: listboxLostFocus, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: shouldNavigate - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends4[ListboxEvents.ButtonMouseUp] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, focusList] - }, _extends4[ListboxEvents.ListMouseUp] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, focusList] - }, _extends4[ListboxEvents.OptionTouchStart] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends4[ListboxEvents.OptionClick] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends4[ListboxEvents.OptionPress] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends4[ListboxEvents.KeyDownNavigate] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead, focusList] - }, _extends4[ListboxEvents.KeyDownSearch] = { - target: ListboxStates.Navigating, - actions: setTypeahead - }, _extends4[ListboxEvents.UpdateAfterTypeahead] = { - actions: [setNavSelectionFromTypeahead] - }, _extends4[ListboxEvents.ClearTypeahead] = { - actions: clearTypeahead - }, _extends4[ListboxEvents.OptionMouseMove] = [{ - target: ListboxStates.Dragging, - actions: [navigate], - cond: optionIsNavigable - }, { - target: ListboxStates.Dragging - }], _extends4)) - }, _states2[ListboxStates.Dragging] = { - on: _extends$4({}, commonEvents, (_extends5 = {}, _extends5[ListboxEvents.ClearNavSelection] = { - actions: [clearNavigationValue] - }, _extends5[ListboxEvents.KeyDownEnter] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends5[ListboxEvents.KeyDownSpace] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends5[ListboxEvents.ButtonMouseDown] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends5[ListboxEvents.KeyDownEscape] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends5[ListboxEvents.OptionMouseDown] = { - target: ListboxStates.Dragging - }, _extends5[ListboxEvents.OutsideMouseDown] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends5[ListboxEvents.OutsideMouseUp] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive, - actions: focusList - }, { - target: ListboxStates.Interacting, - actions: [clearTypeahead, focusList] - }], _extends5[ListboxEvents.Blur] = [{ - target: ListboxStates.Idle, - cond: listboxLostFocus, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: shouldNavigate - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends5[ListboxEvents.ButtonMouseUp] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, focusList] - }, _extends5[ListboxEvents.OptionTouchStart] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends5[ListboxEvents.OptionClick] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends5[ListboxEvents.OptionPress] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends5[ListboxEvents.OptionMouseEnter] = { - target: ListboxStates.Dragging, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends5[ListboxEvents.KeyDownNavigate] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead, focusList] - }, _extends5[ListboxEvents.KeyDownSearch] = { - target: ListboxStates.Navigating, - actions: setTypeahead - }, _extends5[ListboxEvents.UpdateAfterTypeahead] = { - actions: [setNavSelectionFromTypeahead] - }, _extends5[ListboxEvents.ClearTypeahead] = { - actions: clearTypeahead - }, _extends5[ListboxEvents.OptionMouseMove] = [{ - target: ListboxStates.Navigating, - actions: [navigate], - cond: optionIsNavigable - }, { - target: ListboxStates.Navigating - }], _extends5[ListboxEvents.OptionMouseUp] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends5)) - }, _states2[ListboxStates.Navigating] = { - on: _extends$4({}, commonEvents, (_extends6 = {}, _extends6[ListboxEvents.ClearNavSelection] = { - actions: [clearNavigationValue, focusList] - }, _extends6[ListboxEvents.KeyDownEnter] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends6[ListboxEvents.KeyDownSpace] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends6[ListboxEvents.ButtonMouseDown] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends6[ListboxEvents.KeyDownEscape] = { - target: ListboxStates.Idle, - actions: [focusButton] - }, _extends6[ListboxEvents.OptionMouseDown] = { - target: ListboxStates.Dragging - }, _extends6[ListboxEvents.OutsideMouseDown] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends6[ListboxEvents.OutsideMouseUp] = [{ - target: ListboxStates.Idle, - cond: clickedOutsideOfListbox, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: optionIsActive - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends6[ListboxEvents.Blur] = [{ - target: ListboxStates.Idle, - cond: listboxLostFocus, - actions: clearTypeahead - }, { - target: ListboxStates.Navigating, - cond: shouldNavigate - }, { - target: ListboxStates.Interacting, - actions: clearTypeahead - }], _extends6[ListboxEvents.ButtonMouseUp] = { - target: ListboxStates.Navigating, - actions: [navigateFromCurrentValue, focusList] - }, _extends6[ListboxEvents.OptionTouchStart] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends6[ListboxEvents.OptionClick] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends6[ListboxEvents.OptionPress] = { - target: ListboxStates.Idle, - actions: [assignValue, clearTypeahead, focusButton, selectOption], - cond: optionIsSelectable - }, _extends6[ListboxEvents.OptionMouseEnter] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead], - cond: optionIsNavigable - }, _extends6[ListboxEvents.KeyDownNavigate] = { - target: ListboxStates.Navigating, - actions: [navigate, clearTypeahead, focusList] - }, _extends6[ListboxEvents.KeyDownSearch] = { - target: ListboxStates.Navigating, - actions: setTypeahead - }, _extends6[ListboxEvents.UpdateAfterTypeahead] = { - actions: [setNavSelectionFromTypeahead] - }, _extends6[ListboxEvents.ClearTypeahead] = { - actions: clearTypeahead - }, _extends6[ListboxEvents.OptionMouseMove] = [{ - target: ListboxStates.Navigating, - actions: [navigate], - cond: optionIsNavigable - }, { - target: ListboxStates.Navigating - }], _extends6)) - }, _states2) - }; - }, "createMachineDefinition"); - function findOptionFromTypeahead(options, string) { - if (string === void 0) { - string = ""; - } - if (!string) return null; - var found = options.find(function (option) { - return !option.disabled && option.label && option.label.toLowerCase().startsWith(string.toLowerCase()); - }); - return found || null; - } - __name(findOptionFromTypeahead, "findOptionFromTypeahead"); - function findOptionFromValue(value3, options) { - return value3 ? options.find(function (option) { - return option.value === value3; - }) : void 0; - } - __name(findOptionFromValue, "findOptionFromValue"); - var _excluded$4 = ["as", "aria-labelledby", "aria-label", "children", "defaultValue", "disabled", "form", "name", "onChange", "required", "value", "__componentName"], - _excluded2$3 = ["arrow", "button", "children", "portal"], - _excluded3$4 = ["aria-label", "arrow", "as", "children", "onKeyDown", "onMouseDown", "onMouseUp"], - _excluded4$3 = ["as", "children"], - _excluded5$3 = ["as", "position", "onBlur", "onKeyDown", "onMouseUp", "portal", "unstable_observableRefs"], - _excluded6 = ["as"], - _excluded7$2 = ["as", "children", "disabled", "index", "label", "onClick", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseUp", "onTouchStart", "value"]; - var DEBUG = false; - var ListboxDescendantContext = /* @__PURE__ */createDescendantContext(); - var ListboxContext = /* @__PURE__ */createNamedContext("ListboxContext", {}); - var ListboxInput = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxInput2(_ref2, forwardedRef) { - var _ref$as = _ref2.as, - Comp = _ref$as === void 0 ? "div" : _ref$as, - ariaLabelledBy = _ref2["aria-labelledby"], - ariaLabel = _ref2["aria-label"], - children = _ref2.children, - defaultValue2 = _ref2.defaultValue, - _ref$disabled = _ref2.disabled, - disabled = _ref$disabled === void 0 ? false : _ref$disabled, - form = _ref2.form, - name2 = _ref2.name, - onChange = _ref2.onChange, - required = _ref2.required, - valueProp = _ref2.value; - _ref2.__componentName; - var props2 = _objectWithoutPropertiesLoose$4(_ref2, _excluded$4); - var isControlled = (0, React.useRef)(valueProp != null); - var _useDescendantsInit = useDescendantsInit(), - options = _useDescendantsInit[0], - setOptions = _useDescendantsInit[1]; - var buttonRef = (0, React.useRef)(null); - var hiddenInputRef = (0, React.useRef)(null); - var highlightedOptionRef = (0, React.useRef)(null); - var inputRef = (0, React.useRef)(null); - var listRef = (0, React.useRef)(null); - var popoverRef = (0, React.useRef)(null); - var selectedOptionRef = (0, React.useRef)(null); - var machine = useCreateMachine(createMachineDefinition({ - value: (isControlled.current ? valueProp : defaultValue2) || null - })); - var _useMachine = useMachine(machine, { - button: buttonRef, - hiddenInput: hiddenInputRef, - highlightedOption: highlightedOptionRef, - input: inputRef, - list: listRef, - popover: popoverRef, - selectedOption: selectedOptionRef - }, DEBUG), - state2 = _useMachine[0], - send2 = _useMachine[1]; - function handleValueChange(newValue) { - if (newValue !== state2.context.value) { - onChange == null ? void 0 : onChange(newValue); - } - } - __name(handleValueChange, "handleValueChange"); - var _id = useId(props2.id); - var id2 = props2.id || makeId("listbox-input", _id); - var ref = useComposedRefs(inputRef, forwardedRef); - var valueLabel = (0, React.useMemo)(function () { - var selected = options.find(function (option) { - return option.value === state2.context.value; - }); - return selected ? selected.label : null; - }, [options, state2.context.value]); - var isExpanded = isListboxExpanded(state2.value); - var context = { - ariaLabel, - ariaLabelledBy, - buttonRef, - disabled, - highlightedOptionRef, - isExpanded, - listboxId: id2, - listboxValueLabel: valueLabel, - listRef, - onValueChange: handleValueChange, - popoverRef, - selectedOptionRef, - send: send2, - state: state2.value, - stateData: state2.context - }; - var mounted = (0, React.useRef)(false); - if (!isControlled.current && defaultValue2 == null && !mounted.current && options.length) { - mounted.current = true; - var first = options.find(function (option) { - return !option.disabled; - }); - if (first && first.value) { - send2({ - type: ListboxEvents.ValueChange, - value: first.value - }); - } - } - useControlledStateSync(valueProp, state2.context.value, function () { - send2({ - type: ListboxEvents.ValueChange, - value: valueProp - }); - }); - useIsomorphicLayoutEffect(function () { - send2({ - type: ListboxEvents.GetDerivedData, - data: { - options - } - }); - }, [options, send2]); - (0, React.useEffect)(function () { - function handleMouseDown(event) { - var target2 = event.target, - relatedTarget = event.relatedTarget; - if (!popoverContainsEventTarget$1(popoverRef.current, target2)) { - send2({ - type: ListboxEvents.OutsideMouseDown, - relatedTarget: relatedTarget || target2 - }); - } - } - __name(handleMouseDown, "handleMouseDown"); - if (isExpanded) { - window.addEventListener("mousedown", handleMouseDown); - } - return function () { - window.removeEventListener("mousedown", handleMouseDown); - }; - }, [send2, isExpanded]); - (0, React.useEffect)(function () { - function handleMouseUp(event) { - var target2 = event.target, - relatedTarget = event.relatedTarget; - if (!popoverContainsEventTarget$1(popoverRef.current, target2)) { - send2({ - type: ListboxEvents.OutsideMouseUp, - relatedTarget: relatedTarget || target2 - }); - } - } - __name(handleMouseUp, "handleMouseUp"); - if (isExpanded) { - window.addEventListener("mouseup", handleMouseUp); - } - return function () { - window.removeEventListener("mouseup", handleMouseUp); - }; - }, [send2, isExpanded]); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$4({}, props2, { - ref, - "data-reach-listbox-input": "", - "data-state": isExpanded ? "expanded" : "closed", - "data-value": state2.context.value, - id: id2 - }), /* @__PURE__ */(0, React.createElement)(ListboxContext.Provider, { - value: context - }, /* @__PURE__ */(0, React.createElement)(DescendantProvider, { - context: ListboxDescendantContext, - items: options, - set: setOptions - }, isFunction$1(children) ? children({ - id: id2, - isExpanded, - value: state2.context.value, - selectedOptionRef, - highlightedOptionRef, - valueLabel, - expanded: isExpanded - }) : children, (form || name2 || required) && /* @__PURE__ */(0, React.createElement)("input", { - ref: hiddenInputRef, - "data-reach-listbox-hidden-input": "", - disabled, - form, - name: name2, - readOnly: true, - required, - tabIndex: -1, - type: "hidden", - value: state2.context.value || "" - })))); - }, "ListboxInput")); - var Listbox$1 = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function Listbox(_ref2, forwardedRef) { - var _ref2$arrow = _ref2.arrow, - arrow = _ref2$arrow === void 0 ? "\u25BC" : _ref2$arrow, - button2 = _ref2.button, - children = _ref2.children, - _ref2$portal = _ref2.portal, - portal = _ref2$portal === void 0 ? true : _ref2$portal, - props2 = _objectWithoutPropertiesLoose$4(_ref2, _excluded2$3); - return /* @__PURE__ */(0, React.createElement)(ListboxInput, _extends$4({}, props2, { - __componentName: "Listbox", - ref: forwardedRef - }), function (_ref3) { - var value3 = _ref3.value, - valueLabel = _ref3.valueLabel; - return /* @__PURE__ */(0, React.createElement)(React.Fragment, null, /* @__PURE__ */(0, React.createElement)(ListboxButton$1, { - arrow, - children: button2 ? isFunction$1(button2) ? button2({ - value: value3, - label: valueLabel - }) : button2 : void 0 - }), /* @__PURE__ */(0, React.createElement)(ListboxPopover2, { - portal - }, /* @__PURE__ */(0, React.createElement)(ListboxList, null, children))); - }); - }, "Listbox")); - var ListboxButtonImpl = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxButton(_ref4, forwardedRef) { - var ariaLabel = _ref4["aria-label"], - _ref4$arrow = _ref4.arrow, - arrow = _ref4$arrow === void 0 ? false : _ref4$arrow, - _ref4$as = _ref4.as, - Comp = _ref4$as === void 0 ? "span" : _ref4$as, - children = _ref4.children, - onKeyDown = _ref4.onKeyDown, - onMouseDown = _ref4.onMouseDown, - onMouseUp = _ref4.onMouseUp, - props2 = _objectWithoutPropertiesLoose$4(_ref4, _excluded3$4); - var _React$useContext = (0, React.useContext)(ListboxContext), - buttonRef = _React$useContext.buttonRef, - send2 = _React$useContext.send, - ariaLabelledBy = _React$useContext.ariaLabelledBy, - disabled = _React$useContext.disabled, - isExpanded = _React$useContext.isExpanded, - listboxId = _React$useContext.listboxId, - stateData = _React$useContext.stateData, - listboxValueLabel = _React$useContext.listboxValueLabel; - var listboxValue = stateData.value; - var ref = useComposedRefs(buttonRef, forwardedRef); - var handleKeyDown = useKeyDown$1(); - function handleMouseDown(event) { - if (!isRightClick(event.nativeEvent)) { - event.preventDefault(); - event.stopPropagation(); - send2({ - type: ListboxEvents.ButtonMouseDown, - disabled - }); - } - } - __name(handleMouseDown, "handleMouseDown"); - function handleMouseUp(event) { - if (!isRightClick(event.nativeEvent)) { - event.preventDefault(); - event.stopPropagation(); - send2({ - type: ListboxEvents.ButtonMouseUp - }); - } - } - __name(handleMouseUp, "handleMouseUp"); - var id2 = makeId("button", listboxId); - var label = (0, React.useMemo)(function () { - if (!children) { - return listboxValueLabel; - } else if (isFunction$1(children)) { - return children({ - isExpanded, - label: listboxValueLabel, - value: listboxValue, - expanded: isExpanded - }); - } - return children; - }, [children, listboxValueLabel, isExpanded, listboxValue]); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$4({ - "aria-disabled": disabled || void 0, - "aria-expanded": isExpanded || void 0, - "aria-haspopup": "listbox", - "aria-labelledby": ariaLabel ? void 0 : [ariaLabelledBy, id2].filter(Boolean).join(" "), - "aria-label": ariaLabel, - role: "button", - tabIndex: disabled ? -1 : 0 - }, props2, { - ref, - "data-reach-listbox-button": "", - id: id2, - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown), - onMouseDown: composeEventHandlers(onMouseDown, handleMouseDown), - onMouseUp: composeEventHandlers(onMouseUp, handleMouseUp) - }), label, arrow && /* @__PURE__ */(0, React.createElement)(ListboxArrow2, null, isBoolean(arrow) ? null : arrow)); - }, "ListboxButton")); - var ListboxButton$1 = /* @__PURE__ */(0, React.memo)(ListboxButtonImpl); - var ListboxArrowImpl = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxArrow(_ref5, forwardedRef) { - var _ref5$as = _ref5.as, - Comp = _ref5$as === void 0 ? "span" : _ref5$as, - children = _ref5.children, - props2 = _objectWithoutPropertiesLoose$4(_ref5, _excluded4$3); - var _React$useContext2 = (0, React.useContext)(ListboxContext), - isExpanded = _React$useContext2.isExpanded; - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$4({ - "aria-hidden": true - }, props2, { - ref: forwardedRef, - "data-reach-listbox-arrow": "", - "data-expanded": isExpanded ? "" : void 0 - }), isFunction$1(children) ? children({ - isExpanded, - expanded: isExpanded - }) : children || "\u25BC"); - }, "ListboxArrow")); - var ListboxArrow2 = /* @__PURE__ */(0, React.memo)(ListboxArrowImpl); - var ListboxPopoverImpl = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxPopover(_ref6, forwardedRef) { - var _ref6$as = _ref6.as, - Comp = _ref6$as === void 0 ? "div" : _ref6$as, - _ref6$position = _ref6.position, - position = _ref6$position === void 0 ? positionMatchWidth : _ref6$position, - onBlur3 = _ref6.onBlur, - onKeyDown = _ref6.onKeyDown, - onMouseUp = _ref6.onMouseUp, - _ref6$portal = _ref6.portal, - portal = _ref6$portal === void 0 ? true : _ref6$portal, - unstable_observableRefs = _ref6.unstable_observableRefs, - props2 = _objectWithoutPropertiesLoose$4(_ref6, _excluded5$3); - var _React$useContext3 = (0, React.useContext)(ListboxContext), - isExpanded = _React$useContext3.isExpanded, - buttonRef = _React$useContext3.buttonRef, - popoverRef = _React$useContext3.popoverRef, - send2 = _React$useContext3.send; - var ref = useComposedRefs(popoverRef, forwardedRef); - var handleKeyDown = useKeyDown$1(); - function handleMouseUp() { - send2({ - type: ListboxEvents.ListMouseUp - }); - } - __name(handleMouseUp, "handleMouseUp"); - var commonProps = _extends$4({ - hidden: !isExpanded, - tabIndex: -1 - }, props2, { - ref, - "data-reach-listbox-popover": "", - onMouseUp: composeEventHandlers(onMouseUp, handleMouseUp), - onBlur: composeEventHandlers(onBlur3, handleBlur), - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown) - }); - function handleBlur(event) { - var nativeEvent = event.nativeEvent; - requestAnimationFrame(function () { - send2({ - type: ListboxEvents.Blur, - relatedTarget: nativeEvent.relatedTarget || nativeEvent.target - }); - }); - } - __name(handleBlur, "handleBlur"); - return portal ? /* @__PURE__ */(0, React.createElement)(Popover, _extends$4({}, commonProps, { - as: Comp, - targetRef: buttonRef, - position, - unstable_observableRefs, - unstable_skipInitialPortalRender: true - })) : /* @__PURE__ */(0, React.createElement)(Comp, commonProps); - }, "ListboxPopover")); - var ListboxPopover2 = /* @__PURE__ */(0, React.memo)(ListboxPopoverImpl); - var ListboxList = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxList2(_ref7, forwardedRef) { - var _ref7$as = _ref7.as, - Comp = _ref7$as === void 0 ? "ul" : _ref7$as, - props2 = _objectWithoutPropertiesLoose$4(_ref7, _excluded6); - var _React$useContext4 = (0, React.useContext)(ListboxContext), - listRef = _React$useContext4.listRef, - ariaLabel = _React$useContext4.ariaLabel, - ariaLabelledBy = _React$useContext4.ariaLabelledBy, - isExpanded = _React$useContext4.isExpanded, - listboxId = _React$useContext4.listboxId, - _React$useContext4$st = _React$useContext4.stateData, - value3 = _React$useContext4$st.value, - navigationValue4 = _React$useContext4$st.navigationValue; - var ref = useComposedRefs(forwardedRef, listRef); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$4({ - "aria-activedescendant": useOptionId(isExpanded ? navigationValue4 : value3), - "aria-labelledby": ariaLabel ? void 0 : ariaLabelledBy, - "aria-label": ariaLabel, - role: "listbox", - tabIndex: -1 - }, props2, { - ref, - "data-reach-listbox-list": "", - id: makeId("listbox", listboxId) - })); - }, "ListboxList")); - var ListboxOption = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function ListboxOption2(_ref8, forwardedRef) { - var _ref8$as = _ref8.as, - Comp = _ref8$as === void 0 ? "li" : _ref8$as, - children = _ref8.children, - disabled = _ref8.disabled, - indexProp = _ref8.index, - labelProp = _ref8.label, - onClick = _ref8.onClick, - onMouseDown = _ref8.onMouseDown, - onMouseEnter = _ref8.onMouseEnter, - onMouseLeave = _ref8.onMouseLeave, - onMouseMove = _ref8.onMouseMove, - onMouseUp = _ref8.onMouseUp, - onTouchStart = _ref8.onTouchStart, - value3 = _ref8.value, - props2 = _objectWithoutPropertiesLoose$4(_ref8, _excluded7$2); - var _React$useContext5 = (0, React.useContext)(ListboxContext), - highlightedOptionRef = _React$useContext5.highlightedOptionRef, - selectedOptionRef = _React$useContext5.selectedOptionRef, - send2 = _React$useContext5.send, - isExpanded = _React$useContext5.isExpanded, - onValueChange = _React$useContext5.onValueChange, - state2 = _React$useContext5.state, - _React$useContext5$st = _React$useContext5.stateData, - listboxValue = _React$useContext5$st.value, - navigationValue4 = _React$useContext5$st.navigationValue; - var _React$useState = (0, React.useState)(labelProp), - labelState = _React$useState[0], - setLabel = _React$useState[1]; - var label = labelProp || labelState || ""; - var ownRef = (0, React.useRef)(null); - var _useStatefulRefValue = useStatefulRefValue(ownRef, null), - element = _useStatefulRefValue[0], - handleRefSet = _useStatefulRefValue[1]; - var descendant = (0, React.useMemo)(function () { - return { - element, - value: value3, - label, - disabled: !!disabled - }; - }, [disabled, element, label, value3]); - useDescendant(descendant, ListboxDescendantContext, indexProp); - var getLabelFromDomNode = (0, React.useCallback)(function (node) { - if (!labelProp && node) { - setLabel(function (prevState) { - if (node.textContent && prevState !== node.textContent) { - return node.textContent; - } - return prevState || ""; - }); - } - }, [labelProp]); - var isHighlighted = navigationValue4 ? navigationValue4 === value3 : false; - var isSelected = listboxValue === value3; - var ref = useComposedRefs(getLabelFromDomNode, forwardedRef, handleRefSet, isSelected ? selectedOptionRef : null, isHighlighted ? highlightedOptionRef : null); - function handleMouseEnter() { - send2({ - type: ListboxEvents.OptionMouseEnter, - value: value3, - disabled: !!disabled - }); - } - __name(handleMouseEnter, "handleMouseEnter"); - function handleTouchStart() { - send2({ - type: ListboxEvents.OptionTouchStart, - value: value3, - disabled: !!disabled - }); - } - __name(handleTouchStart, "handleTouchStart"); - function handleMouseLeave() { - send2({ - type: ListboxEvents.ClearNavSelection - }); - } - __name(handleMouseLeave, "handleMouseLeave"); - function handleMouseDown(event) { - if (!isRightClick(event.nativeEvent)) { - event.preventDefault(); - send2({ - type: ListboxEvents.OptionMouseDown - }); - } - } - __name(handleMouseDown, "handleMouseDown"); - function handleMouseUp(event) { - if (!isRightClick(event.nativeEvent)) { - send2({ - type: ListboxEvents.OptionMouseUp, - value: value3, - callback: onValueChange, - disabled: !!disabled - }); - } - } - __name(handleMouseUp, "handleMouseUp"); - function handleClick(event) { - if (!isRightClick(event.nativeEvent)) { - send2({ - type: ListboxEvents.OptionClick, - value: value3, - callback: onValueChange, - disabled: !!disabled - }); - } - } - __name(handleClick, "handleClick"); - function handleMouseMove() { - if (state2 === ListboxStates.Open || navigationValue4 !== value3) { - send2({ - type: ListboxEvents.OptionMouseMove, - value: value3, - disabled: !!disabled - }); - } - } - __name(handleMouseMove, "handleMouseMove"); - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$4({ - "aria-selected": (isExpanded ? isHighlighted : isSelected) || void 0, - "aria-disabled": disabled || void 0, - role: "option" - }, props2, { - ref, - id: useOptionId(value3), - "data-reach-listbox-option": "", - "data-current-nav": isHighlighted ? "" : void 0, - "data-current-selected": isSelected ? "" : void 0, - "data-label": label, - "data-value": value3, - onClick: composeEventHandlers(onClick, handleClick), - onMouseDown: composeEventHandlers(onMouseDown, handleMouseDown), - onMouseEnter: composeEventHandlers(onMouseEnter, handleMouseEnter), - onMouseLeave: composeEventHandlers(onMouseLeave, handleMouseLeave), - onMouseMove: composeEventHandlers(onMouseMove, handleMouseMove), - onMouseUp: composeEventHandlers(onMouseUp, handleMouseUp), - onTouchStart: composeEventHandlers(onTouchStart, handleTouchStart) - }), children); - }, "ListboxOption")); - function isListboxExpanded(state2) { - return [ListboxStates.Navigating, ListboxStates.Open, ListboxStates.Dragging, ListboxStates.Interacting].includes(state2); - } - __name(isListboxExpanded, "isListboxExpanded"); - function useKeyDown$1() { - var _React$useContext9 = (0, React.useContext)(ListboxContext), - send2 = _React$useContext9.send, - listboxDisabled = _React$useContext9.disabled, - onValueChange = _React$useContext9.onValueChange, - _React$useContext9$st = _React$useContext9.stateData, - navigationValue4 = _React$useContext9$st.navigationValue, - typeaheadQuery2 = _React$useContext9$st.typeaheadQuery; - var options = useDescendants(ListboxDescendantContext); - var stableOnValueChange = useStableCallback(onValueChange); - (0, React.useEffect)(function () { - if (typeaheadQuery2) { - send2({ - type: ListboxEvents.UpdateAfterTypeahead, - query: typeaheadQuery2, - callback: stableOnValueChange - }); - } - var timeout = window.setTimeout(function () { - if (typeaheadQuery2 != null) { - send2({ - type: ListboxEvents.ClearTypeahead - }); - } - }, 1e3); - return function () { - window.clearTimeout(timeout); - }; - }, [stableOnValueChange, send2, typeaheadQuery2]); - var index = options.findIndex(function (_ref11) { - var value3 = _ref11.value; - return value3 === navigationValue4; - }); - var handleKeyDown = composeEventHandlers(function (event) { - var key = event.key; - var isSearching = isString$1(key) && key.length === 1; - var navOption = options.find(function (option) { - return option.value === navigationValue4; - }); - switch (key) { - case "Enter": - send2({ - type: ListboxEvents.KeyDownEnter, - value: navigationValue4, - callback: onValueChange, - disabled: !!(navOption != null && navOption.disabled || listboxDisabled) - }); - return; - case " ": - event.preventDefault(); - send2({ - type: ListboxEvents.KeyDownSpace, - value: navigationValue4, - callback: onValueChange, - disabled: !!(navOption != null && navOption.disabled || listboxDisabled) - }); - return; - case "Escape": - send2({ - type: ListboxEvents.KeyDownEscape - }); - return; - case "Tab": - var eventType = event.shiftKey ? ListboxEvents.KeyDownShiftTab : ListboxEvents.KeyDownTab; - send2({ - type: eventType - }); - return; - default: - if (isSearching) { - send2({ - type: ListboxEvents.KeyDownSearch, - query: key, - disabled: listboxDisabled - }); - } - return; - } - }, useDescendantKeyDown(ListboxDescendantContext, { - currentIndex: index, - orientation: "vertical", - key: "index", - rotate: true, - filter: /* @__PURE__ */__name(function filter(option) { - return !option.disabled; - }, "filter"), - callback: /* @__PURE__ */__name(function callback(nextIndex) { - send2({ - type: ListboxEvents.KeyDownNavigate, - value: options[nextIndex].value, - disabled: listboxDisabled - }); - }, "callback") - })); - return handleKeyDown; - } - __name(useKeyDown$1, "useKeyDown$1"); - function useOptionId(value3) { - var _React$useContext10 = (0, React.useContext)(ListboxContext), - listboxId = _React$useContext10.listboxId; - return value3 ? makeId("option-" + value3, listboxId) : void 0; - } - __name(useOptionId, "useOptionId"); - function popoverContainsEventTarget$1(popover, target2) { - return !!(popover && popover.contains(target2)); - } - __name(popoverContainsEventTarget$1, "popoverContainsEventTarget$1"); - function useControlledStateSync(controlPropValue, internalValue, send2) { - var _React$useRef = (0, React.useRef)(controlPropValue != null), - isControlled = _React$useRef.current; - if (isControlled && controlPropValue !== internalValue) { - send2(); - } - } - __name(useControlledStateSync, "useControlledStateSync"); - function usePrevious(value3) { - var ref = (0, React.useRef)(null); - (0, React.useEffect)(function () { - ref.current = value3; - }, [value3]); - return ref.current; - } - __name(usePrevious, "usePrevious"); - function _objectWithoutPropertiesLoose$3(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$3, "_objectWithoutPropertiesLoose$3"); - function _extends$3() { - _extends$3 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$3.apply(this, arguments); - } - __name(_extends$3, "_extends$3"); - var _excluded$3 = ["onKeyDown", "onMouseDown", "id", "ref"], - _excluded3$3 = ["index", "isLink", "onClick", "onDragStart", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseUp", "onSelect", "disabled", "onFocus", "valueText", "ref"], - _excluded5$2 = ["id", "onKeyDown", "ref"], - _excluded7$1 = ["onBlur", "portal", "position", "ref"]; - var CLEAR_SELECTION_INDEX = "CLEAR_SELECTION_INDEX"; - var CLICK_MENU_ITEM = "CLICK_MENU_ITEM"; - var CLOSE_MENU = "CLOSE_MENU"; - var OPEN_MENU_AT_FIRST_ITEM = "OPEN_MENU_AT_FIRST_ITEM"; - var OPEN_MENU_AT_INDEX = "OPEN_MENU_AT_INDEX"; - var OPEN_MENU_CLEARED = "OPEN_MENU_CLEARED"; - var SEARCH_FOR_ITEM = "SEARCH_FOR_ITEM"; - var SELECT_ITEM_AT_INDEX = "SELECT_ITEM_AT_INDEX"; - var SET_BUTTON_ID = "SET_BUTTON_ID"; - var DropdownDescendantContext = /* @__PURE__ */createDescendantContext(); - var _createContext = /* @__PURE__ */createContext("Dropdown"), - DropdownProvider = _createContext[0], - useDropdownContext = _createContext[1]; - var initialState = { - triggerId: null, - isExpanded: false, - typeaheadQuery: "", - selectionIndex: -1 - }; - var DropdownProvider_ = /* @__PURE__ */__name(function DropdownProvider_2(_ref2) { - var id2 = _ref2.id, - children = _ref2.children; - var triggerRef = (0, React.useRef)(null); - var dropdownRef = (0, React.useRef)(null); - var popoverRef = (0, React.useRef)(null); - var _useDescendantsInit = useDescendantsInit(), - descendants = _useDescendantsInit[0], - setDescendants = _useDescendantsInit[1]; - var _id = useId(id2); - var dropdownId = id2 || makeId("menu", _id); - var triggerId = makeId("menu-button", dropdownId); - var _React$useReducer = (0, React.useReducer)(reducer$1, _extends$3({}, initialState, { - triggerId - })), - state2 = _React$useReducer[0], - dispatch = _React$useReducer[1]; - var triggerClickedRef = (0, React.useRef)(false); - var selectCallbacks = (0, React.useRef)([]); - var readyToSelect = (0, React.useRef)(false); - var mouseDownStartPosRef = (0, React.useRef)({ - x: 0, - y: 0 - }); - (0, React.useEffect)(function () { - if (state2.isExpanded) { - window.__REACH_DISABLE_TOOLTIPS = true; - window.requestAnimationFrame(function () { - focus(dropdownRef.current); - }); - } else { - window.__REACH_DISABLE_TOOLTIPS = false; - } - }, [state2.isExpanded]); - return /* @__PURE__ */(0, React.createElement)(DescendantProvider, { - context: DropdownDescendantContext, - items: descendants, - set: setDescendants - }, /* @__PURE__ */(0, React.createElement)(DropdownProvider, { - dispatch, - dropdownId, - dropdownRef, - mouseDownStartPosRef, - popoverRef, - readyToSelect, - selectCallbacks, - state: state2, - triggerClickedRef, - triggerRef - }, isFunction$1(children) ? children({ - isExpanded: state2.isExpanded, - isOpen: state2.isExpanded - }) : children)); - }, "DropdownProvider_"); - function useDropdownTrigger(_ref2) { - var onKeyDown = _ref2.onKeyDown, - onMouseDown = _ref2.onMouseDown, - id2 = _ref2.id, - forwardedRef = _ref2.ref, - props2 = _objectWithoutPropertiesLoose$3(_ref2, _excluded$3); - var _useDropdownContext = useDropdownContext("useDropdownTrigger"), - dispatch = _useDropdownContext.dispatch, - dropdownId = _useDropdownContext.dropdownId, - mouseDownStartPosRef = _useDropdownContext.mouseDownStartPosRef, - triggerClickedRef = _useDropdownContext.triggerClickedRef, - triggerRef = _useDropdownContext.triggerRef, - _useDropdownContext$s = _useDropdownContext.state, - triggerId = _useDropdownContext$s.triggerId, - isExpanded = _useDropdownContext$s.isExpanded; - var ref = useComposedRefs(triggerRef, forwardedRef); - var items = useDropdownDescendants(); - var firstNonDisabledIndex = (0, React.useMemo)(function () { - return items.findIndex(function (item) { - return !item.disabled; - }); - }, [items]); - (0, React.useEffect)(function () { - if (id2 != null && id2 !== triggerId) { - dispatch({ - type: SET_BUTTON_ID, - payload: id2 - }); - } - }, [triggerId, dispatch, id2]); - function handleKeyDown(event) { - switch (event.key) { - case "ArrowDown": - case "ArrowUp": - event.preventDefault(); - dispatch({ - type: OPEN_MENU_AT_INDEX, - payload: { - index: firstNonDisabledIndex - } - }); - break; - case "Enter": - case " ": - dispatch({ - type: OPEN_MENU_AT_INDEX, - payload: { - index: firstNonDisabledIndex - } - }); - break; - } - } - __name(handleKeyDown, "handleKeyDown"); - function handleMouseDown(event) { - if (isRightClick(event.nativeEvent)) { - return; - } - mouseDownStartPosRef.current = { - x: event.clientX, - y: event.clientY - }; - if (!isExpanded) { - triggerClickedRef.current = true; - } - if (isExpanded) { - dispatch({ - type: CLOSE_MENU - }); - } else { - dispatch({ - type: OPEN_MENU_CLEARED - }); - } - } - __name(handleMouseDown, "handleMouseDown"); - return { - data: { - isExpanded, - controls: dropdownId - }, - props: _extends$3({}, props2, { - ref, - id: triggerId || void 0, - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown), - onMouseDown: composeEventHandlers(onMouseDown, handleMouseDown), - type: "button" - }) - }; - } - __name(useDropdownTrigger, "useDropdownTrigger"); - function useDropdownItem(_ref4) { - var indexProp = _ref4.index, - _ref4$isLink = _ref4.isLink, - isLink = _ref4$isLink === void 0 ? false : _ref4$isLink, - onClick = _ref4.onClick, - onDragStart = _ref4.onDragStart, - onMouseDown = _ref4.onMouseDown, - onMouseEnter = _ref4.onMouseEnter, - onMouseLeave = _ref4.onMouseLeave, - onMouseMove = _ref4.onMouseMove, - onMouseUp = _ref4.onMouseUp, - onSelect = _ref4.onSelect, - disabled = _ref4.disabled, - onFocus3 = _ref4.onFocus, - valueTextProp = _ref4.valueText, - forwardedRef = _ref4.ref, - props2 = _objectWithoutPropertiesLoose$3(_ref4, _excluded3$3); - var _useDropdownContext2 = useDropdownContext("useDropdownItem"), - dispatch = _useDropdownContext2.dispatch, - dropdownRef = _useDropdownContext2.dropdownRef, - mouseDownStartPosRef = _useDropdownContext2.mouseDownStartPosRef, - readyToSelect = _useDropdownContext2.readyToSelect, - selectCallbacks = _useDropdownContext2.selectCallbacks, - triggerRef = _useDropdownContext2.triggerRef, - _useDropdownContext2$ = _useDropdownContext2.state, - selectionIndex = _useDropdownContext2$.selectionIndex, - isExpanded = _useDropdownContext2$.isExpanded; - var ownRef = (0, React.useRef)(null); - var _React$useState = (0, React.useState)(valueTextProp || ""), - valueText = _React$useState[0], - setValueText = _React$useState[1]; - var setValueTextFromDOM = (0, React.useCallback)(function (node) { - if (!valueTextProp && node != null && node.textContent) { - setValueText(node.textContent); - } - }, [valueTextProp]); - var mouseEventStarted = (0, React.useRef)(false); - var _useStatefulRefValue = useStatefulRefValue(ownRef, null), - element = _useStatefulRefValue[0], - handleRefSet = _useStatefulRefValue[1]; - var descendant = (0, React.useMemo)(function () { - return { - element, - key: valueText, - disabled, - isLink - }; - }, [disabled, element, isLink, valueText]); - var index = useDescendant(descendant, DropdownDescendantContext, indexProp); - var isSelected = index === selectionIndex && !disabled; - var ref = useComposedRefs(forwardedRef, handleRefSet, setValueTextFromDOM); - selectCallbacks.current[index] = onSelect; - function select() { - focus(triggerRef.current); - onSelect && onSelect(); - dispatch({ - type: CLICK_MENU_ITEM - }); - } - __name(select, "select"); - function handleClick(event) { - if (isRightClick(event.nativeEvent)) { - return; - } - if (isLink) { - if (disabled) { - event.preventDefault(); - } else { - select(); - } - } - } - __name(handleClick, "handleClick"); - function handleDragStart(event) { - if (isLink) { - event.preventDefault(); - } - } - __name(handleDragStart, "handleDragStart"); - function handleMouseDown(event) { - if (isRightClick(event.nativeEvent)) { - return; - } - if (isLink) { - mouseEventStarted.current = true; - } else { - event.preventDefault(); - } - } - __name(handleMouseDown, "handleMouseDown"); - function handleMouseEnter(event) { - var doc = getOwnerDocument(dropdownRef.current); - if (!isSelected && index != null && !disabled) { - if (dropdownRef != null && dropdownRef.current && dropdownRef.current !== doc.activeElement && ownRef.current !== doc.activeElement) { - dropdownRef.current.focus(); - } - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index - } - }); - } - } - __name(handleMouseEnter, "handleMouseEnter"); - function handleMouseLeave(event) { - dispatch({ - type: CLEAR_SELECTION_INDEX - }); - } - __name(handleMouseLeave, "handleMouseLeave"); - function handleMouseMove(event) { - if (!readyToSelect.current) { - var threshold = 8; - var deltaX = Math.abs(event.clientX - mouseDownStartPosRef.current.x); - var deltaY = Math.abs(event.clientY - mouseDownStartPosRef.current.y); - if (deltaX > threshold || deltaY > threshold) { - readyToSelect.current = true; - } - } - if (!isSelected && index != null && !disabled) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index, - dropdownRef - } - }); - } - } - __name(handleMouseMove, "handleMouseMove"); - function handleFocus() { - readyToSelect.current = true; - if (!isSelected && index != null && !disabled) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index - } - }); - } - } - __name(handleFocus, "handleFocus"); - function handleMouseUp(event) { - if (isRightClick(event.nativeEvent)) { - return; - } - if (!readyToSelect.current) { - readyToSelect.current = true; - return; - } - if (isLink) { - if (mouseEventStarted.current) { - mouseEventStarted.current = false; - } else if (ownRef.current) { - ownRef.current.click(); - } - } else { - if (!disabled) { - select(); - } - } - } - __name(handleMouseUp, "handleMouseUp"); - (0, React.useEffect)(function () { - if (isExpanded) { - var id2 = window.setTimeout(function () { - readyToSelect.current = true; - }, 400); - return function () { - window.clearTimeout(id2); - }; - } else { - readyToSelect.current = false; - } - }, [isExpanded, readyToSelect]); - (0, React.useEffect)(function () { - var ownerDocument = getOwnerDocument(ownRef.current); - ownerDocument.addEventListener("mouseup", listener); - return function () { - ownerDocument.removeEventListener("mouseup", listener); - }; - function listener() { - mouseEventStarted.current = false; - } - __name(listener, "listener"); - }, []); - return { - data: { - disabled - }, - props: _extends$3({ - id: useItemId(index), - tabIndex: -1 - }, props2, { - ref, - "data-disabled": disabled ? "" : void 0, - "data-selected": isSelected ? "" : void 0, - "data-valuetext": valueText, - onClick: composeEventHandlers(onClick, handleClick), - onDragStart: composeEventHandlers(onDragStart, handleDragStart), - onMouseDown: composeEventHandlers(onMouseDown, handleMouseDown), - onMouseEnter: composeEventHandlers(onMouseEnter, handleMouseEnter), - onMouseLeave: composeEventHandlers(onMouseLeave, handleMouseLeave), - onMouseMove: composeEventHandlers(onMouseMove, handleMouseMove), - onFocus: composeEventHandlers(onFocus3, handleFocus), - onMouseUp: composeEventHandlers(onMouseUp, handleMouseUp) - }) - }; - } - __name(useDropdownItem, "useDropdownItem"); - function useDropdownItems(_ref6) { - _ref6.id; - var onKeyDown = _ref6.onKeyDown, - forwardedRef = _ref6.ref, - props2 = _objectWithoutPropertiesLoose$3(_ref6, _excluded5$2); - var _useDropdownContext3 = useDropdownContext("useDropdownItems"), - dispatch = _useDropdownContext3.dispatch, - triggerRef = _useDropdownContext3.triggerRef, - dropdownRef = _useDropdownContext3.dropdownRef, - selectCallbacks = _useDropdownContext3.selectCallbacks, - dropdownId = _useDropdownContext3.dropdownId, - _useDropdownContext3$ = _useDropdownContext3.state, - isExpanded = _useDropdownContext3$.isExpanded, - triggerId = _useDropdownContext3$.triggerId, - selectionIndex = _useDropdownContext3$.selectionIndex, - typeaheadQuery2 = _useDropdownContext3$.typeaheadQuery; - var items = useDropdownDescendants(); - var ref = useComposedRefs(dropdownRef, forwardedRef); - (0, React.useEffect)(function () { - var match2 = findItemFromTypeahead(items, typeaheadQuery2); - if (typeaheadQuery2 && match2 != null) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index: match2, - dropdownRef - } - }); - } - var timeout = window.setTimeout(function () { - return typeaheadQuery2 && dispatch({ - type: SEARCH_FOR_ITEM, - payload: "" - }); - }, 1e3); - return function () { - return window.clearTimeout(timeout); - }; - }, [dispatch, items, typeaheadQuery2, dropdownRef]); - var prevItemsLength = usePrevious(items.length); - var prevSelected = usePrevious(items[selectionIndex]); - var prevSelectionIndex = usePrevious(selectionIndex); - (0, React.useEffect)(function () { - if (selectionIndex > items.length - 1) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index: items.length - 1, - dropdownRef - } - }); - } else if (prevItemsLength !== items.length && selectionIndex > -1 && prevSelected && prevSelectionIndex === selectionIndex && items[selectionIndex] !== prevSelected) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index: items.findIndex(function (i) { - return i.key === (prevSelected == null ? void 0 : prevSelected.key); - }), - dropdownRef - } - }); - } - }, [dropdownRef, dispatch, items, prevItemsLength, prevSelected, prevSelectionIndex, selectionIndex]); - var handleKeyDown = composeEventHandlers( /* @__PURE__ */__name(function handleKeyDown2(event) { - var key = event.key; - if (!isExpanded) { - return; - } - switch (key) { - case "Enter": - case " ": - var selected = items.find(function (item) { - return item.index === selectionIndex; - }); - if (selected && !selected.disabled) { - event.preventDefault(); - if (selected.isLink && selected.element) { - selected.element.click(); - } else { - focus(triggerRef.current); - selectCallbacks.current[selected.index] && selectCallbacks.current[selected.index](); - dispatch({ - type: CLICK_MENU_ITEM - }); - } - } - break; - case "Escape": - focus(triggerRef.current); - dispatch({ - type: CLOSE_MENU - }); - break; - case "Tab": - event.preventDefault(); - break; - default: - if (isString$1(key) && key.length === 1) { - var query = typeaheadQuery2 + key.toLowerCase(); - dispatch({ - type: SEARCH_FOR_ITEM, - payload: query - }); - } - break; - } - }, "handleKeyDown"), useDescendantKeyDown(DropdownDescendantContext, { - currentIndex: selectionIndex, - orientation: "vertical", - rotate: false, - filter: /* @__PURE__ */__name(function filter(item) { - return !item.disabled; - }, "filter"), - callback: /* @__PURE__ */__name(function callback(index) { - dispatch({ - type: SELECT_ITEM_AT_INDEX, - payload: { - index, - dropdownRef - } - }); - }, "callback"), - key: "index" - })); - return { - data: { - activeDescendant: useItemId(selectionIndex) || void 0, - triggerId - }, - props: _extends$3({ - tabIndex: -1 - }, props2, { - ref, - id: dropdownId, - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown) - }) - }; - } - __name(useDropdownItems, "useDropdownItems"); - function useDropdownPopover(_ref8) { - var onBlur3 = _ref8.onBlur, - _ref8$portal = _ref8.portal, - portal = _ref8$portal === void 0 ? true : _ref8$portal, - position = _ref8.position, - forwardedRef = _ref8.ref, - props2 = _objectWithoutPropertiesLoose$3(_ref8, _excluded7$1); - var _useDropdownContext4 = useDropdownContext("useDropdownPopover"), - triggerRef = _useDropdownContext4.triggerRef, - triggerClickedRef = _useDropdownContext4.triggerClickedRef, - dispatch = _useDropdownContext4.dispatch, - dropdownRef = _useDropdownContext4.dropdownRef, - popoverRef = _useDropdownContext4.popoverRef, - isExpanded = _useDropdownContext4.state.isExpanded; - var ref = useComposedRefs(popoverRef, forwardedRef); - (0, React.useEffect)(function () { - if (!isExpanded) { - return; - } - var ownerDocument = getOwnerDocument(popoverRef.current); - function listener(event) { - if (triggerClickedRef.current) { - triggerClickedRef.current = false; - } else if (!popoverContainsEventTarget(popoverRef.current, event.target)) { - dispatch({ - type: CLOSE_MENU - }); - } - } - __name(listener, "listener"); - ownerDocument.addEventListener("mousedown", listener); - return function () { - ownerDocument.removeEventListener("mousedown", listener); - }; - }, [triggerClickedRef, triggerRef, dispatch, dropdownRef, popoverRef, isExpanded]); - return { - data: { - portal, - position, - targetRef: triggerRef, - isExpanded - }, - props: _extends$3({ - ref, - hidden: !isExpanded, - onBlur: composeEventHandlers(onBlur3, function (event) { - if (event.currentTarget.contains(event.relatedTarget)) { - return; - } - dispatch({ - type: CLOSE_MENU - }); - }) - }, props2) - }; - } - __name(useDropdownPopover, "useDropdownPopover"); - function findItemFromTypeahead(items, string) { - if (string === void 0) { - string = ""; - } - if (!string) { - return null; - } - var found = items.find(function (item) { - var _item$element, _item$element$dataset, _item$element$dataset2; - return item.disabled ? false : (_item$element = item.element) == null ? void 0 : (_item$element$dataset = _item$element.dataset) == null ? void 0 : (_item$element$dataset2 = _item$element$dataset.valuetext) == null ? void 0 : _item$element$dataset2.toLowerCase().startsWith(string); - }); - return found ? items.indexOf(found) : null; - } - __name(findItemFromTypeahead, "findItemFromTypeahead"); - function useItemId(index) { - var _useDropdownContext5 = useDropdownContext("useItemId"), - dropdownId = _useDropdownContext5.dropdownId; - return index != null && index > -1 ? makeId("option-" + index, dropdownId) : void 0; - } - __name(useItemId, "useItemId"); - function focus(element) { - element && element.focus(); - } - __name(focus, "focus"); - function popoverContainsEventTarget(popover, target2) { - return !!(popover && popover.contains(target2)); - } - __name(popoverContainsEventTarget, "popoverContainsEventTarget"); - function reducer$1(state2, action) { - if (action === void 0) { - action = {}; - } - switch (action.type) { - case CLICK_MENU_ITEM: - return _extends$3({}, state2, { - isExpanded: false, - selectionIndex: -1 - }); - case CLOSE_MENU: - return _extends$3({}, state2, { - isExpanded: false, - selectionIndex: -1 - }); - case OPEN_MENU_AT_FIRST_ITEM: - return _extends$3({}, state2, { - isExpanded: true, - selectionIndex: 0 - }); - case OPEN_MENU_AT_INDEX: - return _extends$3({}, state2, { - isExpanded: true, - selectionIndex: action.payload.index - }); - case OPEN_MENU_CLEARED: - return _extends$3({}, state2, { - isExpanded: true, - selectionIndex: -1 - }); - case SELECT_ITEM_AT_INDEX: - { - var _action$payload$dropd = action.payload.dropdownRef, - dropdownRef = _action$payload$dropd === void 0 ? { - current: null - } : _action$payload$dropd; - if (action.payload.index >= 0 && action.payload.index !== state2.selectionIndex) { - if (dropdownRef.current) { - var doc = getOwnerDocument(dropdownRef.current); - if (dropdownRef.current !== (doc == null ? void 0 : doc.activeElement)) { - dropdownRef.current.focus(); - } - } - return _extends$3({}, state2, { - selectionIndex: action.payload.max != null ? Math.min(Math.max(action.payload.index, 0), action.payload.max) : Math.max(action.payload.index, 0) - }); - } - return state2; - } - case CLEAR_SELECTION_INDEX: - return _extends$3({}, state2, { - selectionIndex: -1 - }); - case SET_BUTTON_ID: - return _extends$3({}, state2, { - triggerId: action.payload - }); - case SEARCH_FOR_ITEM: - if (typeof action.payload !== "undefined") { - return _extends$3({}, state2, { - typeaheadQuery: action.payload - }); - } - return state2; - default: - return state2; - } - } - __name(reducer$1, "reducer$1"); - function useDropdownDescendants() { - return useDescendants(DropdownDescendantContext); - } - __name(useDropdownDescendants, "useDropdownDescendants"); - var reactIs = { - exports: {} - }; - var reactIs_production_min = {}; - /** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - var b = typeof Symbol === "function" && Symbol.for, - c = b ? Symbol.for("react.element") : 60103, - d = b ? Symbol.for("react.portal") : 60106, - e = b ? Symbol.for("react.fragment") : 60107, - f = b ? Symbol.for("react.strict_mode") : 60108, - g = b ? Symbol.for("react.profiler") : 60114, - h = b ? Symbol.for("react.provider") : 60109, - k = b ? Symbol.for("react.context") : 60110, - l = b ? Symbol.for("react.async_mode") : 60111, - m = b ? Symbol.for("react.concurrent_mode") : 60111, - n = b ? Symbol.for("react.forward_ref") : 60112, - p = b ? Symbol.for("react.suspense") : 60113, - q = b ? Symbol.for("react.suspense_list") : 60120, - r = b ? Symbol.for("react.memo") : 60115, - t = b ? Symbol.for("react.lazy") : 60116, - v = b ? Symbol.for("react.block") : 60121, - w = b ? Symbol.for("react.fundamental") : 60117, - x = b ? Symbol.for("react.responder") : 60118, - y = b ? Symbol.for("react.scope") : 60119; - function z(a2) { - if (typeof a2 === "object" && a2 !== null) { - var u2 = a2.$$typeof; - switch (u2) { - case c: - switch (a2 = a2.type, a2) { - case l: - case m: - case e: - case g: - case f: - case p: - return a2; - default: - switch (a2 = a2 && a2.$$typeof, a2) { - case k: - case n: - case t: - case r: - case h: - return a2; - default: - return u2; - } - } - case d: - return u2; - } - } - } - __name(z, "z"); - function A(a2) { - return z(a2) === m; - } - __name(A, "A"); - reactIs_production_min.AsyncMode = l; - reactIs_production_min.ConcurrentMode = m; - reactIs_production_min.ContextConsumer = k; - reactIs_production_min.ContextProvider = h; - reactIs_production_min.Element = c; - reactIs_production_min.ForwardRef = n; - reactIs_production_min.Fragment = e; - reactIs_production_min.Lazy = t; - reactIs_production_min.Memo = r; - reactIs_production_min.Portal = d; - reactIs_production_min.Profiler = g; - reactIs_production_min.StrictMode = f; - reactIs_production_min.Suspense = p; - reactIs_production_min.isAsyncMode = function (a2) { - return A(a2) || z(a2) === l; - }; - reactIs_production_min.isConcurrentMode = A; - reactIs_production_min.isContextConsumer = function (a2) { - return z(a2) === k; - }; - reactIs_production_min.isContextProvider = function (a2) { - return z(a2) === h; - }; - reactIs_production_min.isElement = function (a2) { - return typeof a2 === "object" && a2 !== null && a2.$$typeof === c; - }; - reactIs_production_min.isForwardRef = function (a2) { - return z(a2) === n; - }; - reactIs_production_min.isFragment = function (a2) { - return z(a2) === e; - }; - reactIs_production_min.isLazy = function (a2) { - return z(a2) === t; - }; - reactIs_production_min.isMemo = function (a2) { - return z(a2) === r; - }; - reactIs_production_min.isPortal = function (a2) { - return z(a2) === d; - }; - reactIs_production_min.isProfiler = function (a2) { - return z(a2) === g; - }; - reactIs_production_min.isStrictMode = function (a2) { - return z(a2) === f; - }; - reactIs_production_min.isSuspense = function (a2) { - return z(a2) === p; - }; - reactIs_production_min.isValidElementType = function (a2) { - return typeof a2 === "string" || typeof a2 === "function" || a2 === e || a2 === m || a2 === g || a2 === f || a2 === p || a2 === q || typeof a2 === "object" && a2 !== null && (a2.$$typeof === t || a2.$$typeof === r || a2.$$typeof === h || a2.$$typeof === k || a2.$$typeof === n || a2.$$typeof === w || a2.$$typeof === x || a2.$$typeof === y || a2.$$typeof === v); - }; - reactIs_production_min.typeOf = z; - { - reactIs.exports = reactIs_production_min; - } - function _extends$2() { - _extends$2 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$2.apply(this, arguments); - } - __name(_extends$2, "_extends$2"); - function _objectWithoutPropertiesLoose$2(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$2, "_objectWithoutPropertiesLoose$2"); - var _excluded$2 = ["as", "id", "children"], - _excluded2$2 = ["as"], - _excluded3$2 = ["as"], - _excluded4$2 = ["as"], - _excluded5$1 = ["as"], - _excluded7 = ["portal"], - _excluded8 = ["as"]; - var Menu$1 = /* @__PURE__ */(0, React.forwardRef)(function (_ref2, forwardedRef) { - var _ref$as = _ref2.as, - Comp = _ref$as === void 0 ? React.Fragment : _ref$as, - id2 = _ref2.id, - children = _ref2.children, - rest = _objectWithoutPropertiesLoose$2(_ref2, _excluded$2); - var parentIsFragment = (0, React.useMemo)(function () { - try { - return reactIs.exports.isFragment( /* @__PURE__ */(0, React.createElement)(Comp, null)); - } catch (err) { - return false; - } - }, [Comp]); - var props2 = parentIsFragment ? {} : _extends$2({ - ref: forwardedRef, - id: id2, - "data-reach-menu": "" - }, rest); - return /* @__PURE__ */(0, React.createElement)(Comp, props2, /* @__PURE__ */(0, React.createElement)(DropdownProvider_, { - id: id2, - children - })); - }); - var MenuButton$1 = /* @__PURE__ */(0, React.forwardRef)(function (_ref2, forwardedRef) { - var _ref2$as = _ref2.as, - Comp = _ref2$as === void 0 ? "button" : _ref2$as, - rest = _objectWithoutPropertiesLoose$2(_ref2, _excluded2$2); - var _useDropdownTrigger = useDropdownTrigger(_extends$2({}, rest, { - ref: forwardedRef - })), - _useDropdownTrigger$d = _useDropdownTrigger.data, - isExpanded = _useDropdownTrigger$d.isExpanded, - controls = _useDropdownTrigger$d.controls, - props2 = _useDropdownTrigger.props; - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$2({ - "aria-expanded": isExpanded ? true : void 0, - "aria-haspopup": true, - "aria-controls": controls - }, props2, { - "data-reach-menu-button": "" - })); - }); - var MenuItemImpl = /* @__PURE__ */(0, React.forwardRef)(function (_ref3, forwardedRef) { - var _ref3$as = _ref3.as, - Comp = _ref3$as === void 0 ? "div" : _ref3$as, - rest = _objectWithoutPropertiesLoose$2(_ref3, _excluded3$2); - var _useDropdownItem = useDropdownItem(_extends$2({}, rest, { - ref: forwardedRef - })), - disabled = _useDropdownItem.data.disabled, - props2 = _useDropdownItem.props; - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$2({ - role: "menuitem" - }, props2, { - "aria-disabled": disabled || void 0, - "data-reach-menu-item": "" - })); - }); - var MenuItem = /* @__PURE__ */(0, React.forwardRef)(function (_ref4, forwardedRef) { - var _ref4$as = _ref4.as, - as = _ref4$as === void 0 ? "div" : _ref4$as, - props2 = _objectWithoutPropertiesLoose$2(_ref4, _excluded4$2); - return /* @__PURE__ */(0, React.createElement)(MenuItemImpl, _extends$2({}, props2, { - ref: forwardedRef, - as - })); - }); - var MenuItems = /* @__PURE__ */(0, React.forwardRef)(function (_ref5, forwardedRef) { - var _ref5$as = _ref5.as, - Comp = _ref5$as === void 0 ? "div" : _ref5$as, - rest = _objectWithoutPropertiesLoose$2(_ref5, _excluded5$1); - var _useDropdownItems = useDropdownItems(_extends$2({}, rest, { - ref: forwardedRef - })), - _useDropdownItems$dat = _useDropdownItems.data, - activeDescendant = _useDropdownItems$dat.activeDescendant, - triggerId = _useDropdownItems$dat.triggerId, - props2 = _useDropdownItems.props; - return /* @__PURE__ */(0, React.createElement)(Comp, _extends$2({ - "aria-activedescendant": activeDescendant, - "aria-labelledby": triggerId || void 0, - role: "menu" - }, props2, { - "data-reach-menu-items": "" - })); - }); - var MenuList = /* @__PURE__ */(0, React.forwardRef)(function (_ref7, forwardedRef) { - var _ref7$portal = _ref7.portal, - portal = _ref7$portal === void 0 ? true : _ref7$portal, - props2 = _objectWithoutPropertiesLoose$2(_ref7, _excluded7); - return /* @__PURE__ */(0, React.createElement)(MenuPopover, { - portal - }, /* @__PURE__ */(0, React.createElement)(MenuItems, _extends$2({}, props2, { - ref: forwardedRef, - "data-reach-menu-list": "" - }))); - }); - var MenuPopover = /* @__PURE__ */(0, React.forwardRef)(function (_ref8, forwardedRef) { - var _ref8$as = _ref8.as, - Comp = _ref8$as === void 0 ? "div" : _ref8$as, - rest = _objectWithoutPropertiesLoose$2(_ref8, _excluded8); - var _useDropdownPopover = useDropdownPopover(_extends$2({}, rest, { - ref: forwardedRef - })), - _useDropdownPopover$d = _useDropdownPopover.data, - portal = _useDropdownPopover$d.portal, - targetRef = _useDropdownPopover$d.targetRef, - position = _useDropdownPopover$d.position, - props2 = _useDropdownPopover.props; - var sharedProps = { - "data-reach-menu-popover": "" - }; - return portal ? /* @__PURE__ */(0, React.createElement)(Popover, _extends$2({}, props2, sharedProps, { - as: Comp, - targetRef, - position, - unstable_skipInitialPortalRender: true - })) : /* @__PURE__ */(0, React.createElement)(Comp, _extends$2({}, props2, sharedProps)); - }); - var dropdown = /* @__PURE__ */(() => ":root{--reach-listbox: 1}[data-reach-listbox-popover]{display:block;position:absolute;min-width:-moz-fit-content;min-width:-webkit-min-content;min-width:min-content;padding:.25rem 0;background:hsl(0,0%,100%);outline:none;border:solid 1px hsla(0,0%,0%,.25)}[data-reach-listbox-popover]:focus-within{box-shadow:0 0 4px Highlight;outline:-webkit-focus-ring-color auto 4px}[data-reach-listbox-popover][hidden]{display:none}[data-reach-listbox-list]{margin:0;padding:0;list-style:none}[data-reach-listbox-list]:focus{box-shadow:none;outline:none}[data-reach-listbox-option]{display:block;margin:0;padding:.25rem .5rem;white-space:nowrap;user-select:none}[data-reach-listbox-option][data-current-nav]{background:hsl(211,81%,46%);color:#fff}[data-reach-listbox-option][data-current-selected]{font-weight:bolder}[data-reach-listbox-option][data-current-selected][data-confirming]{animation:flash .1s;animation-iteration-count:1}[data-reach-listbox-option][aria-disabled=true]{opacity:.5}[data-reach-listbox-button]{display:inline-flex;align-items:center;justify-content:space-between;padding:1px 10px 2px;border:1px solid;border-color:rgb(216,216,216) rgb(209,209,209) rgb(186,186,186);cursor:default;user-select:none}[data-reach-listbox-button][aria-disabled=true]{opacity:.5}[data-reach-listbox-arrow]{margin-left:.5rem;display:block;font-size:.5em}[data-reach-listbox-group-label]{display:block;margin:0;padding:.25rem .5rem;white-space:nowrap;user-select:none;font-weight:bolder}@keyframes flash{0%{background:hsla(211,81%,36%,1);color:#fff;opacity:1}50%{opacity:.5;background:inherit;color:inherit}to{background:hsla(211,81%,36%,1);color:#fff;opacity:1}}:root{--reach-menu-button: 1}[data-reach-menu]{position:relative}[data-reach-menu-popover]{display:block;position:absolute}[data-reach-menu-popover][hidden]{display:none}[data-reach-menu-list],[data-reach-menu-items]{display:block;white-space:nowrap;border:solid 1px hsla(0,0%,0%,.25);background:hsla(0,100%,100%,.99);outline:none;padding:1rem 0;font-size:85%}[data-reach-menu-item]{display:block;user-select:none}[data-reach-menu-item]{cursor:pointer;display:block;color:inherit;font:inherit;text-decoration:initial;padding:5px 20px}[data-reach-menu-item][data-selected]{background:hsl(211,81%,36%);color:#fff;outline:none}[data-reach-menu-item][aria-disabled]{opacity:.5;cursor:not-allowed}[data-reach-listbox-popover],[data-reach-menu-list]{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);font-size:inherit;max-width:250px;padding:var(--px-4)}[data-reach-listbox-option],[data-reach-menu-item]{border-radius:var(--border-radius-4);font-size:inherit;margin:var(--px-4);overflow:hidden;padding:var(--px-6) var(--px-8);text-overflow:ellipsis;white-space:nowrap}[data-reach-listbox-option][data-selected],[data-reach-menu-item][data-selected],[data-reach-listbox-option][data-current-nav],[data-reach-menu-item][data-current-nav],[data-reach-listbox-option]:hover,[data-reach-menu-item]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light));color:inherit}[data-reach-listbox-option]:not(:first-child),[data-reach-menu-item]:not(:first-child){margin-top:0}[data-reach-listbox-button]{border:none;cursor:pointer;padding:0}\n")(); - const MenuButton = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx(MenuButton$1, __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-un-styled", props2.className) - }))); - MenuButton.displayName = "MenuButton"; - const Menu = createComponentGroup(Menu$1, { - Button: MenuButton, - Item: MenuItem, - List: MenuList - }); - _exports.aK = Menu; - const ListboxButton2 = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx(ListboxButton$1, __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-un-styled", props2.className) - }))); - ListboxButton2.displayName = "ListboxButton"; - const Listbox2 = createComponentGroup(Listbox$1, { - Button: ListboxButton2, - Input: ListboxInput, - Option: ListboxOption, - Popover: ListboxPopover2 - }); - _exports.aL = Listbox2; - var utils$1 = {}; - const Aacute = "\xC1"; - const aacute = "\xE1"; - const Abreve = "\u0102"; - const abreve = "\u0103"; - const ac = "\u223E"; - const acd = "\u223F"; - const acE = "\u223E\u0333"; - const Acirc = "\xC2"; - const acirc = "\xE2"; - const acute = "\xB4"; - const Acy = "\u0410"; - const acy = "\u0430"; - const AElig = "\xC6"; - const aelig = "\xE6"; - const af = "\u2061"; - const Afr = "\u{1D504}"; - const afr = "\u{1D51E}"; - const Agrave = "\xC0"; - const agrave = "\xE0"; - const alefsym = "\u2135"; - const aleph = "\u2135"; - const Alpha = "\u0391"; - const alpha = "\u03B1"; - const Amacr = "\u0100"; - const amacr = "\u0101"; - const amalg = "\u2A3F"; - const amp = "&"; - const AMP = "&"; - const andand = "\u2A55"; - const And = "\u2A53"; - const and = "\u2227"; - const andd = "\u2A5C"; - const andslope = "\u2A58"; - const andv = "\u2A5A"; - const ang = "\u2220"; - const ange = "\u29A4"; - const angle = "\u2220"; - const angmsdaa = "\u29A8"; - const angmsdab = "\u29A9"; - const angmsdac = "\u29AA"; - const angmsdad = "\u29AB"; - const angmsdae = "\u29AC"; - const angmsdaf = "\u29AD"; - const angmsdag = "\u29AE"; - const angmsdah = "\u29AF"; - const angmsd = "\u2221"; - const angrt = "\u221F"; - const angrtvb = "\u22BE"; - const angrtvbd = "\u299D"; - const angsph = "\u2222"; - const angst = "\xC5"; - const angzarr = "\u237C"; - const Aogon = "\u0104"; - const aogon = "\u0105"; - const Aopf = "\u{1D538}"; - const aopf = "\u{1D552}"; - const apacir = "\u2A6F"; - const ap = "\u2248"; - const apE = "\u2A70"; - const ape = "\u224A"; - const apid = "\u224B"; - const apos = "'"; - const ApplyFunction = "\u2061"; - const approx = "\u2248"; - const approxeq = "\u224A"; - const Aring = "\xC5"; - const aring = "\xE5"; - const Ascr = "\u{1D49C}"; - const ascr = "\u{1D4B6}"; - const Assign = "\u2254"; - const ast = "*"; - const asymp = "\u2248"; - const asympeq = "\u224D"; - const Atilde = "\xC3"; - const atilde = "\xE3"; - const Auml = "\xC4"; - const auml = "\xE4"; - const awconint = "\u2233"; - const awint = "\u2A11"; - const backcong = "\u224C"; - const backepsilon = "\u03F6"; - const backprime = "\u2035"; - const backsim = "\u223D"; - const backsimeq = "\u22CD"; - const Backslash = "\u2216"; - const Barv = "\u2AE7"; - const barvee = "\u22BD"; - const barwed = "\u2305"; - const Barwed = "\u2306"; - const barwedge = "\u2305"; - const bbrk = "\u23B5"; - const bbrktbrk = "\u23B6"; - const bcong = "\u224C"; - const Bcy = "\u0411"; - const bcy = "\u0431"; - const bdquo = "\u201E"; - const becaus = "\u2235"; - const because = "\u2235"; - const Because = "\u2235"; - const bemptyv = "\u29B0"; - const bepsi = "\u03F6"; - const bernou = "\u212C"; - const Bernoullis = "\u212C"; - const Beta = "\u0392"; - const beta = "\u03B2"; - const beth = "\u2136"; - const between = "\u226C"; - const Bfr = "\u{1D505}"; - const bfr = "\u{1D51F}"; - const bigcap = "\u22C2"; - const bigcirc = "\u25EF"; - const bigcup = "\u22C3"; - const bigodot = "\u2A00"; - const bigoplus = "\u2A01"; - const bigotimes = "\u2A02"; - const bigsqcup = "\u2A06"; - const bigstar = "\u2605"; - const bigtriangledown = "\u25BD"; - const bigtriangleup = "\u25B3"; - const biguplus = "\u2A04"; - const bigvee = "\u22C1"; - const bigwedge = "\u22C0"; - const bkarow = "\u290D"; - const blacklozenge = "\u29EB"; - const blacksquare = "\u25AA"; - const blacktriangle = "\u25B4"; - const blacktriangledown = "\u25BE"; - const blacktriangleleft = "\u25C2"; - const blacktriangleright = "\u25B8"; - const blank = "\u2423"; - const blk12 = "\u2592"; - const blk14 = "\u2591"; - const blk34 = "\u2593"; - const block$1 = "\u2588"; - const bne = "=\u20E5"; - const bnequiv = "\u2261\u20E5"; - const bNot = "\u2AED"; - const bnot = "\u2310"; - const Bopf = "\u{1D539}"; - const bopf = "\u{1D553}"; - const bot = "\u22A5"; - const bottom = "\u22A5"; - const bowtie = "\u22C8"; - const boxbox = "\u29C9"; - const boxdl = "\u2510"; - const boxdL = "\u2555"; - const boxDl = "\u2556"; - const boxDL = "\u2557"; - const boxdr = "\u250C"; - const boxdR = "\u2552"; - const boxDr = "\u2553"; - const boxDR = "\u2554"; - const boxh = "\u2500"; - const boxH = "\u2550"; - const boxhd = "\u252C"; - const boxHd = "\u2564"; - const boxhD = "\u2565"; - const boxHD = "\u2566"; - const boxhu = "\u2534"; - const boxHu = "\u2567"; - const boxhU = "\u2568"; - const boxHU = "\u2569"; - const boxminus = "\u229F"; - const boxplus = "\u229E"; - const boxtimes = "\u22A0"; - const boxul = "\u2518"; - const boxuL = "\u255B"; - const boxUl = "\u255C"; - const boxUL = "\u255D"; - const boxur = "\u2514"; - const boxuR = "\u2558"; - const boxUr = "\u2559"; - const boxUR = "\u255A"; - const boxv = "\u2502"; - const boxV = "\u2551"; - const boxvh = "\u253C"; - const boxvH = "\u256A"; - const boxVh = "\u256B"; - const boxVH = "\u256C"; - const boxvl = "\u2524"; - const boxvL = "\u2561"; - const boxVl = "\u2562"; - const boxVL = "\u2563"; - const boxvr = "\u251C"; - const boxvR = "\u255E"; - const boxVr = "\u255F"; - const boxVR = "\u2560"; - const bprime = "\u2035"; - const breve = "\u02D8"; - const Breve = "\u02D8"; - const brvbar = "\xA6"; - const bscr = "\u{1D4B7}"; - const Bscr = "\u212C"; - const bsemi = "\u204F"; - const bsim = "\u223D"; - const bsime = "\u22CD"; - const bsolb = "\u29C5"; - const bsol = "\\"; - const bsolhsub = "\u27C8"; - const bull = "\u2022"; - const bullet = "\u2022"; - const bump = "\u224E"; - const bumpE = "\u2AAE"; - const bumpe = "\u224F"; - const Bumpeq = "\u224E"; - const bumpeq = "\u224F"; - const Cacute = "\u0106"; - const cacute = "\u0107"; - const capand = "\u2A44"; - const capbrcup = "\u2A49"; - const capcap = "\u2A4B"; - const cap = "\u2229"; - const Cap = "\u22D2"; - const capcup = "\u2A47"; - const capdot = "\u2A40"; - const CapitalDifferentialD = "\u2145"; - const caps = "\u2229\uFE00"; - const caret = "\u2041"; - const caron = "\u02C7"; - const Cayleys = "\u212D"; - const ccaps = "\u2A4D"; - const Ccaron = "\u010C"; - const ccaron = "\u010D"; - const Ccedil = "\xC7"; - const ccedil = "\xE7"; - const Ccirc = "\u0108"; - const ccirc = "\u0109"; - const Cconint = "\u2230"; - const ccups = "\u2A4C"; - const ccupssm = "\u2A50"; - const Cdot = "\u010A"; - const cdot = "\u010B"; - const cedil = "\xB8"; - const Cedilla = "\xB8"; - const cemptyv = "\u29B2"; - const cent = "\xA2"; - const centerdot = "\xB7"; - const CenterDot = "\xB7"; - const cfr = "\u{1D520}"; - const Cfr = "\u212D"; - const CHcy = "\u0427"; - const chcy = "\u0447"; - const check = "\u2713"; - const checkmark = "\u2713"; - const Chi = "\u03A7"; - const chi = "\u03C7"; - const circ = "\u02C6"; - const circeq = "\u2257"; - const circlearrowleft = "\u21BA"; - const circlearrowright = "\u21BB"; - const circledast = "\u229B"; - const circledcirc = "\u229A"; - const circleddash = "\u229D"; - const CircleDot = "\u2299"; - const circledR = "\xAE"; - const circledS = "\u24C8"; - const CircleMinus = "\u2296"; - const CirclePlus = "\u2295"; - const CircleTimes = "\u2297"; - const cir = "\u25CB"; - const cirE = "\u29C3"; - const cire = "\u2257"; - const cirfnint = "\u2A10"; - const cirmid = "\u2AEF"; - const cirscir = "\u29C2"; - const ClockwiseContourIntegral = "\u2232"; - const CloseCurlyDoubleQuote = "\u201D"; - const CloseCurlyQuote = "\u2019"; - const clubs = "\u2663"; - const clubsuit = "\u2663"; - const colon = ":"; - const Colon = "\u2237"; - const Colone = "\u2A74"; - const colone = "\u2254"; - const coloneq = "\u2254"; - const comma = ","; - const commat = "@"; - const comp = "\u2201"; - const compfn = "\u2218"; - const complement = "\u2201"; - const complexes = "\u2102"; - const cong = "\u2245"; - const congdot = "\u2A6D"; - const Congruent = "\u2261"; - const conint = "\u222E"; - const Conint = "\u222F"; - const ContourIntegral = "\u222E"; - const copf = "\u{1D554}"; - const Copf = "\u2102"; - const coprod = "\u2210"; - const Coproduct = "\u2210"; - const copy$1 = "\xA9"; - const COPY = "\xA9"; - const copysr = "\u2117"; - const CounterClockwiseContourIntegral = "\u2233"; - const crarr = "\u21B5"; - const cross = "\u2717"; - const Cross = "\u2A2F"; - const Cscr = "\u{1D49E}"; - const cscr = "\u{1D4B8}"; - const csub = "\u2ACF"; - const csube = "\u2AD1"; - const csup = "\u2AD0"; - const csupe = "\u2AD2"; - const ctdot = "\u22EF"; - const cudarrl = "\u2938"; - const cudarrr = "\u2935"; - const cuepr = "\u22DE"; - const cuesc = "\u22DF"; - const cularr = "\u21B6"; - const cularrp = "\u293D"; - const cupbrcap = "\u2A48"; - const cupcap = "\u2A46"; - const CupCap = "\u224D"; - const cup = "\u222A"; - const Cup = "\u22D3"; - const cupcup = "\u2A4A"; - const cupdot = "\u228D"; - const cupor = "\u2A45"; - const cups = "\u222A\uFE00"; - const curarr = "\u21B7"; - const curarrm = "\u293C"; - const curlyeqprec = "\u22DE"; - const curlyeqsucc = "\u22DF"; - const curlyvee = "\u22CE"; - const curlywedge = "\u22CF"; - const curren = "\xA4"; - const curvearrowleft = "\u21B6"; - const curvearrowright = "\u21B7"; - const cuvee = "\u22CE"; - const cuwed = "\u22CF"; - const cwconint = "\u2232"; - const cwint = "\u2231"; - const cylcty = "\u232D"; - const dagger = "\u2020"; - const Dagger = "\u2021"; - const daleth = "\u2138"; - const darr = "\u2193"; - const Darr = "\u21A1"; - const dArr = "\u21D3"; - const dash = "\u2010"; - const Dashv = "\u2AE4"; - const dashv = "\u22A3"; - const dbkarow = "\u290F"; - const dblac = "\u02DD"; - const Dcaron = "\u010E"; - const dcaron = "\u010F"; - const Dcy = "\u0414"; - const dcy = "\u0434"; - const ddagger = "\u2021"; - const ddarr = "\u21CA"; - const DD = "\u2145"; - const dd = "\u2146"; - const DDotrahd = "\u2911"; - const ddotseq = "\u2A77"; - const deg = "\xB0"; - const Del = "\u2207"; - const Delta = "\u0394"; - const delta = "\u03B4"; - const demptyv = "\u29B1"; - const dfisht = "\u297F"; - const Dfr = "\u{1D507}"; - const dfr = "\u{1D521}"; - const dHar = "\u2965"; - const dharl = "\u21C3"; - const dharr = "\u21C2"; - const DiacriticalAcute = "\xB4"; - const DiacriticalDot = "\u02D9"; - const DiacriticalDoubleAcute = "\u02DD"; - const DiacriticalGrave = "`"; - const DiacriticalTilde = "\u02DC"; - const diam = "\u22C4"; - const diamond = "\u22C4"; - const Diamond = "\u22C4"; - const diamondsuit = "\u2666"; - const diams = "\u2666"; - const die = "\xA8"; - const DifferentialD = "\u2146"; - const digamma = "\u03DD"; - const disin = "\u22F2"; - const div = "\xF7"; - const divide = "\xF7"; - const divideontimes = "\u22C7"; - const divonx = "\u22C7"; - const DJcy = "\u0402"; - const djcy = "\u0452"; - const dlcorn = "\u231E"; - const dlcrop = "\u230D"; - const dollar = "$"; - const Dopf = "\u{1D53B}"; - const dopf = "\u{1D555}"; - const Dot = "\xA8"; - const dot = "\u02D9"; - const DotDot = "\u20DC"; - const doteq = "\u2250"; - const doteqdot = "\u2251"; - const DotEqual = "\u2250"; - const dotminus = "\u2238"; - const dotplus = "\u2214"; - const dotsquare = "\u22A1"; - const doublebarwedge = "\u2306"; - const DoubleContourIntegral = "\u222F"; - const DoubleDot = "\xA8"; - const DoubleDownArrow = "\u21D3"; - const DoubleLeftArrow = "\u21D0"; - const DoubleLeftRightArrow = "\u21D4"; - const DoubleLeftTee = "\u2AE4"; - const DoubleLongLeftArrow = "\u27F8"; - const DoubleLongLeftRightArrow = "\u27FA"; - const DoubleLongRightArrow = "\u27F9"; - const DoubleRightArrow = "\u21D2"; - const DoubleRightTee = "\u22A8"; - const DoubleUpArrow = "\u21D1"; - const DoubleUpDownArrow = "\u21D5"; - const DoubleVerticalBar = "\u2225"; - const DownArrowBar = "\u2913"; - const downarrow = "\u2193"; - const DownArrow = "\u2193"; - const Downarrow = "\u21D3"; - const DownArrowUpArrow = "\u21F5"; - const DownBreve = "\u0311"; - const downdownarrows = "\u21CA"; - const downharpoonleft = "\u21C3"; - const downharpoonright = "\u21C2"; - const DownLeftRightVector = "\u2950"; - const DownLeftTeeVector = "\u295E"; - const DownLeftVectorBar = "\u2956"; - const DownLeftVector = "\u21BD"; - const DownRightTeeVector = "\u295F"; - const DownRightVectorBar = "\u2957"; - const DownRightVector = "\u21C1"; - const DownTeeArrow = "\u21A7"; - const DownTee = "\u22A4"; - const drbkarow = "\u2910"; - const drcorn = "\u231F"; - const drcrop = "\u230C"; - const Dscr = "\u{1D49F}"; - const dscr = "\u{1D4B9}"; - const DScy = "\u0405"; - const dscy = "\u0455"; - const dsol = "\u29F6"; - const Dstrok = "\u0110"; - const dstrok = "\u0111"; - const dtdot = "\u22F1"; - const dtri = "\u25BF"; - const dtrif = "\u25BE"; - const duarr = "\u21F5"; - const duhar = "\u296F"; - const dwangle = "\u29A6"; - const DZcy = "\u040F"; - const dzcy = "\u045F"; - const dzigrarr = "\u27FF"; - const Eacute = "\xC9"; - const eacute = "\xE9"; - const easter = "\u2A6E"; - const Ecaron = "\u011A"; - const ecaron = "\u011B"; - const Ecirc = "\xCA"; - const ecirc = "\xEA"; - const ecir = "\u2256"; - const ecolon = "\u2255"; - const Ecy = "\u042D"; - const ecy = "\u044D"; - const eDDot = "\u2A77"; - const Edot = "\u0116"; - const edot = "\u0117"; - const eDot = "\u2251"; - const ee = "\u2147"; - const efDot = "\u2252"; - const Efr = "\u{1D508}"; - const efr = "\u{1D522}"; - const eg = "\u2A9A"; - const Egrave = "\xC8"; - const egrave = "\xE8"; - const egs = "\u2A96"; - const egsdot = "\u2A98"; - const el = "\u2A99"; - const Element$1 = "\u2208"; - const elinters = "\u23E7"; - const ell = "\u2113"; - const els = "\u2A95"; - const elsdot = "\u2A97"; - const Emacr = "\u0112"; - const emacr = "\u0113"; - const empty = "\u2205"; - const emptyset = "\u2205"; - const EmptySmallSquare = "\u25FB"; - const emptyv = "\u2205"; - const EmptyVerySmallSquare = "\u25AB"; - const emsp13 = "\u2004"; - const emsp14 = "\u2005"; - const emsp = "\u2003"; - const ENG = "\u014A"; - const eng = "\u014B"; - const ensp = "\u2002"; - const Eogon = "\u0118"; - const eogon = "\u0119"; - const Eopf = "\u{1D53C}"; - const eopf = "\u{1D556}"; - const epar = "\u22D5"; - const eparsl = "\u29E3"; - const eplus = "\u2A71"; - const epsi = "\u03B5"; - const Epsilon = "\u0395"; - const epsilon = "\u03B5"; - const epsiv = "\u03F5"; - const eqcirc = "\u2256"; - const eqcolon = "\u2255"; - const eqsim = "\u2242"; - const eqslantgtr = "\u2A96"; - const eqslantless = "\u2A95"; - const Equal = "\u2A75"; - const equals = "="; - const EqualTilde = "\u2242"; - const equest = "\u225F"; - const Equilibrium = "\u21CC"; - const equiv = "\u2261"; - const equivDD = "\u2A78"; - const eqvparsl = "\u29E5"; - const erarr = "\u2971"; - const erDot = "\u2253"; - const escr = "\u212F"; - const Escr = "\u2130"; - const esdot = "\u2250"; - const Esim = "\u2A73"; - const esim = "\u2242"; - const Eta = "\u0397"; - const eta = "\u03B7"; - const ETH = "\xD0"; - const eth = "\xF0"; - const Euml = "\xCB"; - const euml = "\xEB"; - const euro = "\u20AC"; - const excl = "!"; - const exist = "\u2203"; - const Exists = "\u2203"; - const expectation = "\u2130"; - const exponentiale = "\u2147"; - const ExponentialE = "\u2147"; - const fallingdotseq = "\u2252"; - const Fcy = "\u0424"; - const fcy = "\u0444"; - const female = "\u2640"; - const ffilig = "\uFB03"; - const fflig = "\uFB00"; - const ffllig = "\uFB04"; - const Ffr = "\u{1D509}"; - const ffr = "\u{1D523}"; - const filig = "\uFB01"; - const FilledSmallSquare = "\u25FC"; - const FilledVerySmallSquare = "\u25AA"; - const fjlig = "fj"; - const flat = "\u266D"; - const fllig = "\uFB02"; - const fltns = "\u25B1"; - const fnof = "\u0192"; - const Fopf = "\u{1D53D}"; - const fopf = "\u{1D557}"; - const forall = "\u2200"; - const ForAll = "\u2200"; - const fork = "\u22D4"; - const forkv = "\u2AD9"; - const Fouriertrf = "\u2131"; - const fpartint = "\u2A0D"; - const frac12 = "\xBD"; - const frac13 = "\u2153"; - const frac14 = "\xBC"; - const frac15 = "\u2155"; - const frac16 = "\u2159"; - const frac18 = "\u215B"; - const frac23 = "\u2154"; - const frac25 = "\u2156"; - const frac34 = "\xBE"; - const frac35 = "\u2157"; - const frac38 = "\u215C"; - const frac45 = "\u2158"; - const frac56 = "\u215A"; - const frac58 = "\u215D"; - const frac78 = "\u215E"; - const frasl = "\u2044"; - const frown = "\u2322"; - const fscr = "\u{1D4BB}"; - const Fscr = "\u2131"; - const gacute = "\u01F5"; - const Gamma = "\u0393"; - const gamma = "\u03B3"; - const Gammad = "\u03DC"; - const gammad = "\u03DD"; - const gap = "\u2A86"; - const Gbreve = "\u011E"; - const gbreve = "\u011F"; - const Gcedil = "\u0122"; - const Gcirc = "\u011C"; - const gcirc = "\u011D"; - const Gcy = "\u0413"; - const gcy = "\u0433"; - const Gdot = "\u0120"; - const gdot = "\u0121"; - const ge = "\u2265"; - const gE = "\u2267"; - const gEl = "\u2A8C"; - const gel = "\u22DB"; - const geq = "\u2265"; - const geqq = "\u2267"; - const geqslant = "\u2A7E"; - const gescc = "\u2AA9"; - const ges = "\u2A7E"; - const gesdot = "\u2A80"; - const gesdoto = "\u2A82"; - const gesdotol = "\u2A84"; - const gesl = "\u22DB\uFE00"; - const gesles = "\u2A94"; - const Gfr = "\u{1D50A}"; - const gfr = "\u{1D524}"; - const gg = "\u226B"; - const Gg = "\u22D9"; - const ggg = "\u22D9"; - const gimel = "\u2137"; - const GJcy = "\u0403"; - const gjcy = "\u0453"; - const gla = "\u2AA5"; - const gl = "\u2277"; - const glE = "\u2A92"; - const glj = "\u2AA4"; - const gnap = "\u2A8A"; - const gnapprox = "\u2A8A"; - const gne = "\u2A88"; - const gnE = "\u2269"; - const gneq = "\u2A88"; - const gneqq = "\u2269"; - const gnsim = "\u22E7"; - const Gopf = "\u{1D53E}"; - const gopf = "\u{1D558}"; - const grave = "`"; - const GreaterEqual = "\u2265"; - const GreaterEqualLess = "\u22DB"; - const GreaterFullEqual = "\u2267"; - const GreaterGreater = "\u2AA2"; - const GreaterLess = "\u2277"; - const GreaterSlantEqual = "\u2A7E"; - const GreaterTilde = "\u2273"; - const Gscr = "\u{1D4A2}"; - const gscr = "\u210A"; - const gsim = "\u2273"; - const gsime = "\u2A8E"; - const gsiml = "\u2A90"; - const gtcc = "\u2AA7"; - const gtcir = "\u2A7A"; - const gt = ">"; - const GT = ">"; - const Gt = "\u226B"; - const gtdot = "\u22D7"; - const gtlPar = "\u2995"; - const gtquest = "\u2A7C"; - const gtrapprox = "\u2A86"; - const gtrarr = "\u2978"; - const gtrdot = "\u22D7"; - const gtreqless = "\u22DB"; - const gtreqqless = "\u2A8C"; - const gtrless = "\u2277"; - const gtrsim = "\u2273"; - const gvertneqq = "\u2269\uFE00"; - const gvnE = "\u2269\uFE00"; - const Hacek = "\u02C7"; - const hairsp = "\u200A"; - const half = "\xBD"; - const hamilt = "\u210B"; - const HARDcy = "\u042A"; - const hardcy = "\u044A"; - const harrcir = "\u2948"; - const harr = "\u2194"; - const hArr = "\u21D4"; - const harrw = "\u21AD"; - const Hat = "^"; - const hbar = "\u210F"; - const Hcirc = "\u0124"; - const hcirc = "\u0125"; - const hearts = "\u2665"; - const heartsuit = "\u2665"; - const hellip = "\u2026"; - const hercon = "\u22B9"; - const hfr = "\u{1D525}"; - const Hfr = "\u210C"; - const HilbertSpace = "\u210B"; - const hksearow = "\u2925"; - const hkswarow = "\u2926"; - const hoarr = "\u21FF"; - const homtht = "\u223B"; - const hookleftarrow = "\u21A9"; - const hookrightarrow = "\u21AA"; - const hopf = "\u{1D559}"; - const Hopf = "\u210D"; - const horbar = "\u2015"; - const HorizontalLine = "\u2500"; - const hscr = "\u{1D4BD}"; - const Hscr = "\u210B"; - const hslash = "\u210F"; - const Hstrok = "\u0126"; - const hstrok = "\u0127"; - const HumpDownHump = "\u224E"; - const HumpEqual = "\u224F"; - const hybull = "\u2043"; - const hyphen = "\u2010"; - const Iacute = "\xCD"; - const iacute = "\xED"; - const ic = "\u2063"; - const Icirc = "\xCE"; - const icirc = "\xEE"; - const Icy = "\u0418"; - const icy = "\u0438"; - const Idot = "\u0130"; - const IEcy = "\u0415"; - const iecy = "\u0435"; - const iexcl = "\xA1"; - const iff = "\u21D4"; - const ifr = "\u{1D526}"; - const Ifr = "\u2111"; - const Igrave = "\xCC"; - const igrave = "\xEC"; - const ii = "\u2148"; - const iiiint = "\u2A0C"; - const iiint = "\u222D"; - const iinfin = "\u29DC"; - const iiota = "\u2129"; - const IJlig = "\u0132"; - const ijlig = "\u0133"; - const Imacr = "\u012A"; - const imacr = "\u012B"; - const image$1 = "\u2111"; - const ImaginaryI = "\u2148"; - const imagline = "\u2110"; - const imagpart = "\u2111"; - const imath = "\u0131"; - const Im = "\u2111"; - const imof = "\u22B7"; - const imped = "\u01B5"; - const Implies = "\u21D2"; - const incare = "\u2105"; - const infin = "\u221E"; - const infintie = "\u29DD"; - const inodot = "\u0131"; - const intcal = "\u22BA"; - const int = "\u222B"; - const Int = "\u222C"; - const integers = "\u2124"; - const Integral = "\u222B"; - const intercal = "\u22BA"; - const Intersection = "\u22C2"; - const intlarhk = "\u2A17"; - const intprod = "\u2A3C"; - const InvisibleComma = "\u2063"; - const InvisibleTimes = "\u2062"; - const IOcy = "\u0401"; - const iocy = "\u0451"; - const Iogon = "\u012E"; - const iogon = "\u012F"; - const Iopf = "\u{1D540}"; - const iopf = "\u{1D55A}"; - const Iota = "\u0399"; - const iota = "\u03B9"; - const iprod = "\u2A3C"; - const iquest = "\xBF"; - const iscr = "\u{1D4BE}"; - const Iscr = "\u2110"; - const isin = "\u2208"; - const isindot = "\u22F5"; - const isinE = "\u22F9"; - const isins = "\u22F4"; - const isinsv = "\u22F3"; - const isinv = "\u2208"; - const it = "\u2062"; - const Itilde = "\u0128"; - const itilde = "\u0129"; - const Iukcy = "\u0406"; - const iukcy = "\u0456"; - const Iuml = "\xCF"; - const iuml = "\xEF"; - const Jcirc = "\u0134"; - const jcirc = "\u0135"; - const Jcy = "\u0419"; - const jcy = "\u0439"; - const Jfr = "\u{1D50D}"; - const jfr = "\u{1D527}"; - const jmath = "\u0237"; - const Jopf = "\u{1D541}"; - const jopf = "\u{1D55B}"; - const Jscr = "\u{1D4A5}"; - const jscr = "\u{1D4BF}"; - const Jsercy = "\u0408"; - const jsercy = "\u0458"; - const Jukcy = "\u0404"; - const jukcy = "\u0454"; - const Kappa = "\u039A"; - const kappa = "\u03BA"; - const kappav = "\u03F0"; - const Kcedil = "\u0136"; - const kcedil = "\u0137"; - const Kcy = "\u041A"; - const kcy = "\u043A"; - const Kfr = "\u{1D50E}"; - const kfr = "\u{1D528}"; - const kgreen = "\u0138"; - const KHcy = "\u0425"; - const khcy = "\u0445"; - const KJcy = "\u040C"; - const kjcy = "\u045C"; - const Kopf = "\u{1D542}"; - const kopf = "\u{1D55C}"; - const Kscr = "\u{1D4A6}"; - const kscr = "\u{1D4C0}"; - const lAarr = "\u21DA"; - const Lacute = "\u0139"; - const lacute = "\u013A"; - const laemptyv = "\u29B4"; - const lagran = "\u2112"; - const Lambda = "\u039B"; - const lambda = "\u03BB"; - const lang = "\u27E8"; - const Lang = "\u27EA"; - const langd = "\u2991"; - const langle = "\u27E8"; - const lap = "\u2A85"; - const Laplacetrf = "\u2112"; - const laquo = "\xAB"; - const larrb = "\u21E4"; - const larrbfs = "\u291F"; - const larr = "\u2190"; - const Larr = "\u219E"; - const lArr = "\u21D0"; - const larrfs = "\u291D"; - const larrhk = "\u21A9"; - const larrlp = "\u21AB"; - const larrpl = "\u2939"; - const larrsim = "\u2973"; - const larrtl = "\u21A2"; - const latail = "\u2919"; - const lAtail = "\u291B"; - const lat = "\u2AAB"; - const late = "\u2AAD"; - const lates = "\u2AAD\uFE00"; - const lbarr = "\u290C"; - const lBarr = "\u290E"; - const lbbrk = "\u2772"; - const lbrace = "{"; - const lbrack = "["; - const lbrke = "\u298B"; - const lbrksld = "\u298F"; - const lbrkslu = "\u298D"; - const Lcaron = "\u013D"; - const lcaron = "\u013E"; - const Lcedil = "\u013B"; - const lcedil = "\u013C"; - const lceil = "\u2308"; - const lcub = "{"; - const Lcy = "\u041B"; - const lcy = "\u043B"; - const ldca = "\u2936"; - const ldquo = "\u201C"; - const ldquor = "\u201E"; - const ldrdhar = "\u2967"; - const ldrushar = "\u294B"; - const ldsh = "\u21B2"; - const le = "\u2264"; - const lE = "\u2266"; - const LeftAngleBracket = "\u27E8"; - const LeftArrowBar = "\u21E4"; - const leftarrow = "\u2190"; - const LeftArrow = "\u2190"; - const Leftarrow = "\u21D0"; - const LeftArrowRightArrow = "\u21C6"; - const leftarrowtail = "\u21A2"; - const LeftCeiling = "\u2308"; - const LeftDoubleBracket = "\u27E6"; - const LeftDownTeeVector = "\u2961"; - const LeftDownVectorBar = "\u2959"; - const LeftDownVector = "\u21C3"; - const LeftFloor = "\u230A"; - const leftharpoondown = "\u21BD"; - const leftharpoonup = "\u21BC"; - const leftleftarrows = "\u21C7"; - const leftrightarrow = "\u2194"; - const LeftRightArrow = "\u2194"; - const Leftrightarrow = "\u21D4"; - const leftrightarrows = "\u21C6"; - const leftrightharpoons = "\u21CB"; - const leftrightsquigarrow = "\u21AD"; - const LeftRightVector = "\u294E"; - const LeftTeeArrow = "\u21A4"; - const LeftTee = "\u22A3"; - const LeftTeeVector = "\u295A"; - const leftthreetimes = "\u22CB"; - const LeftTriangleBar = "\u29CF"; - const LeftTriangle = "\u22B2"; - const LeftTriangleEqual = "\u22B4"; - const LeftUpDownVector = "\u2951"; - const LeftUpTeeVector = "\u2960"; - const LeftUpVectorBar = "\u2958"; - const LeftUpVector = "\u21BF"; - const LeftVectorBar = "\u2952"; - const LeftVector = "\u21BC"; - const lEg = "\u2A8B"; - const leg = "\u22DA"; - const leq = "\u2264"; - const leqq = "\u2266"; - const leqslant = "\u2A7D"; - const lescc = "\u2AA8"; - const les = "\u2A7D"; - const lesdot = "\u2A7F"; - const lesdoto = "\u2A81"; - const lesdotor = "\u2A83"; - const lesg = "\u22DA\uFE00"; - const lesges = "\u2A93"; - const lessapprox = "\u2A85"; - const lessdot = "\u22D6"; - const lesseqgtr = "\u22DA"; - const lesseqqgtr = "\u2A8B"; - const LessEqualGreater = "\u22DA"; - const LessFullEqual = "\u2266"; - const LessGreater = "\u2276"; - const lessgtr = "\u2276"; - const LessLess = "\u2AA1"; - const lesssim = "\u2272"; - const LessSlantEqual = "\u2A7D"; - const LessTilde = "\u2272"; - const lfisht = "\u297C"; - const lfloor = "\u230A"; - const Lfr = "\u{1D50F}"; - const lfr = "\u{1D529}"; - const lg = "\u2276"; - const lgE = "\u2A91"; - const lHar = "\u2962"; - const lhard = "\u21BD"; - const lharu = "\u21BC"; - const lharul = "\u296A"; - const lhblk = "\u2584"; - const LJcy = "\u0409"; - const ljcy = "\u0459"; - const llarr = "\u21C7"; - const ll = "\u226A"; - const Ll = "\u22D8"; - const llcorner = "\u231E"; - const Lleftarrow = "\u21DA"; - const llhard = "\u296B"; - const lltri = "\u25FA"; - const Lmidot = "\u013F"; - const lmidot = "\u0140"; - const lmoustache = "\u23B0"; - const lmoust = "\u23B0"; - const lnap = "\u2A89"; - const lnapprox = "\u2A89"; - const lne = "\u2A87"; - const lnE = "\u2268"; - const lneq = "\u2A87"; - const lneqq = "\u2268"; - const lnsim = "\u22E6"; - const loang = "\u27EC"; - const loarr = "\u21FD"; - const lobrk = "\u27E6"; - const longleftarrow = "\u27F5"; - const LongLeftArrow = "\u27F5"; - const Longleftarrow = "\u27F8"; - const longleftrightarrow = "\u27F7"; - const LongLeftRightArrow = "\u27F7"; - const Longleftrightarrow = "\u27FA"; - const longmapsto = "\u27FC"; - const longrightarrow = "\u27F6"; - const LongRightArrow = "\u27F6"; - const Longrightarrow = "\u27F9"; - const looparrowleft = "\u21AB"; - const looparrowright = "\u21AC"; - const lopar = "\u2985"; - const Lopf = "\u{1D543}"; - const lopf = "\u{1D55D}"; - const loplus = "\u2A2D"; - const lotimes = "\u2A34"; - const lowast = "\u2217"; - const lowbar = "_"; - const LowerLeftArrow = "\u2199"; - const LowerRightArrow = "\u2198"; - const loz = "\u25CA"; - const lozenge = "\u25CA"; - const lozf = "\u29EB"; - const lpar = "("; - const lparlt = "\u2993"; - const lrarr = "\u21C6"; - const lrcorner = "\u231F"; - const lrhar = "\u21CB"; - const lrhard = "\u296D"; - const lrm = "\u200E"; - const lrtri = "\u22BF"; - const lsaquo = "\u2039"; - const lscr = "\u{1D4C1}"; - const Lscr = "\u2112"; - const lsh = "\u21B0"; - const Lsh = "\u21B0"; - const lsim = "\u2272"; - const lsime = "\u2A8D"; - const lsimg = "\u2A8F"; - const lsqb = "["; - const lsquo = "\u2018"; - const lsquor = "\u201A"; - const Lstrok = "\u0141"; - const lstrok = "\u0142"; - const ltcc = "\u2AA6"; - const ltcir = "\u2A79"; - const lt = "<"; - const LT = "<"; - const Lt = "\u226A"; - const ltdot = "\u22D6"; - const lthree = "\u22CB"; - const ltimes = "\u22C9"; - const ltlarr = "\u2976"; - const ltquest = "\u2A7B"; - const ltri = "\u25C3"; - const ltrie = "\u22B4"; - const ltrif = "\u25C2"; - const ltrPar = "\u2996"; - const lurdshar = "\u294A"; - const luruhar = "\u2966"; - const lvertneqq = "\u2268\uFE00"; - const lvnE = "\u2268\uFE00"; - const macr = "\xAF"; - const male = "\u2642"; - const malt = "\u2720"; - const maltese = "\u2720"; - const map$1 = "\u21A6"; - const mapsto = "\u21A6"; - const mapstodown = "\u21A7"; - const mapstoleft = "\u21A4"; - const mapstoup = "\u21A5"; - const marker = "\u25AE"; - const mcomma = "\u2A29"; - const Mcy = "\u041C"; - const mcy = "\u043C"; - const mdash = "\u2014"; - const mDDot = "\u223A"; - const measuredangle = "\u2221"; - const MediumSpace = "\u205F"; - const Mellintrf = "\u2133"; - const Mfr = "\u{1D510}"; - const mfr = "\u{1D52A}"; - const mho = "\u2127"; - const micro = "\xB5"; - const midast = "*"; - const midcir = "\u2AF0"; - const mid = "\u2223"; - const middot = "\xB7"; - const minusb = "\u229F"; - const minus = "\u2212"; - const minusd = "\u2238"; - const minusdu = "\u2A2A"; - const MinusPlus = "\u2213"; - const mlcp = "\u2ADB"; - const mldr = "\u2026"; - const mnplus = "\u2213"; - const models = "\u22A7"; - const Mopf = "\u{1D544}"; - const mopf = "\u{1D55E}"; - const mp = "\u2213"; - const mscr = "\u{1D4C2}"; - const Mscr = "\u2133"; - const mstpos = "\u223E"; - const Mu = "\u039C"; - const mu = "\u03BC"; - const multimap = "\u22B8"; - const mumap = "\u22B8"; - const nabla = "\u2207"; - const Nacute = "\u0143"; - const nacute = "\u0144"; - const nang = "\u2220\u20D2"; - const nap = "\u2249"; - const napE = "\u2A70\u0338"; - const napid = "\u224B\u0338"; - const napos = "\u0149"; - const napprox = "\u2249"; - const natural = "\u266E"; - const naturals = "\u2115"; - const natur = "\u266E"; - const nbsp = "\xA0"; - const nbump = "\u224E\u0338"; - const nbumpe = "\u224F\u0338"; - const ncap = "\u2A43"; - const Ncaron = "\u0147"; - const ncaron = "\u0148"; - const Ncedil = "\u0145"; - const ncedil = "\u0146"; - const ncong = "\u2247"; - const ncongdot = "\u2A6D\u0338"; - const ncup = "\u2A42"; - const Ncy = "\u041D"; - const ncy = "\u043D"; - const ndash = "\u2013"; - const nearhk = "\u2924"; - const nearr = "\u2197"; - const neArr = "\u21D7"; - const nearrow = "\u2197"; - const ne = "\u2260"; - const nedot = "\u2250\u0338"; - const NegativeMediumSpace = "\u200B"; - const NegativeThickSpace = "\u200B"; - const NegativeThinSpace = "\u200B"; - const NegativeVeryThinSpace = "\u200B"; - const nequiv = "\u2262"; - const nesear = "\u2928"; - const nesim = "\u2242\u0338"; - const NestedGreaterGreater = "\u226B"; - const NestedLessLess = "\u226A"; - const NewLine = "\n"; - const nexist = "\u2204"; - const nexists = "\u2204"; - const Nfr = "\u{1D511}"; - const nfr = "\u{1D52B}"; - const ngE = "\u2267\u0338"; - const nge = "\u2271"; - const ngeq = "\u2271"; - const ngeqq = "\u2267\u0338"; - const ngeqslant = "\u2A7E\u0338"; - const nges = "\u2A7E\u0338"; - const nGg = "\u22D9\u0338"; - const ngsim = "\u2275"; - const nGt = "\u226B\u20D2"; - const ngt = "\u226F"; - const ngtr = "\u226F"; - const nGtv = "\u226B\u0338"; - const nharr = "\u21AE"; - const nhArr = "\u21CE"; - const nhpar = "\u2AF2"; - const ni = "\u220B"; - const nis = "\u22FC"; - const nisd = "\u22FA"; - const niv = "\u220B"; - const NJcy = "\u040A"; - const njcy = "\u045A"; - const nlarr = "\u219A"; - const nlArr = "\u21CD"; - const nldr = "\u2025"; - const nlE = "\u2266\u0338"; - const nle = "\u2270"; - const nleftarrow = "\u219A"; - const nLeftarrow = "\u21CD"; - const nleftrightarrow = "\u21AE"; - const nLeftrightarrow = "\u21CE"; - const nleq = "\u2270"; - const nleqq = "\u2266\u0338"; - const nleqslant = "\u2A7D\u0338"; - const nles = "\u2A7D\u0338"; - const nless = "\u226E"; - const nLl = "\u22D8\u0338"; - const nlsim = "\u2274"; - const nLt = "\u226A\u20D2"; - const nlt = "\u226E"; - const nltri = "\u22EA"; - const nltrie = "\u22EC"; - const nLtv = "\u226A\u0338"; - const nmid = "\u2224"; - const NoBreak = "\u2060"; - const NonBreakingSpace = "\xA0"; - const nopf = "\u{1D55F}"; - const Nopf = "\u2115"; - const Not = "\u2AEC"; - const not = "\xAC"; - const NotCongruent = "\u2262"; - const NotCupCap = "\u226D"; - const NotDoubleVerticalBar = "\u2226"; - const NotElement = "\u2209"; - const NotEqual = "\u2260"; - const NotEqualTilde = "\u2242\u0338"; - const NotExists = "\u2204"; - const NotGreater = "\u226F"; - const NotGreaterEqual = "\u2271"; - const NotGreaterFullEqual = "\u2267\u0338"; - const NotGreaterGreater = "\u226B\u0338"; - const NotGreaterLess = "\u2279"; - const NotGreaterSlantEqual = "\u2A7E\u0338"; - const NotGreaterTilde = "\u2275"; - const NotHumpDownHump = "\u224E\u0338"; - const NotHumpEqual = "\u224F\u0338"; - const notin = "\u2209"; - const notindot = "\u22F5\u0338"; - const notinE = "\u22F9\u0338"; - const notinva = "\u2209"; - const notinvb = "\u22F7"; - const notinvc = "\u22F6"; - const NotLeftTriangleBar = "\u29CF\u0338"; - const NotLeftTriangle = "\u22EA"; - const NotLeftTriangleEqual = "\u22EC"; - const NotLess = "\u226E"; - const NotLessEqual = "\u2270"; - const NotLessGreater = "\u2278"; - const NotLessLess = "\u226A\u0338"; - const NotLessSlantEqual = "\u2A7D\u0338"; - const NotLessTilde = "\u2274"; - const NotNestedGreaterGreater = "\u2AA2\u0338"; - const NotNestedLessLess = "\u2AA1\u0338"; - const notni = "\u220C"; - const notniva = "\u220C"; - const notnivb = "\u22FE"; - const notnivc = "\u22FD"; - const NotPrecedes = "\u2280"; - const NotPrecedesEqual = "\u2AAF\u0338"; - const NotPrecedesSlantEqual = "\u22E0"; - const NotReverseElement = "\u220C"; - const NotRightTriangleBar = "\u29D0\u0338"; - const NotRightTriangle = "\u22EB"; - const NotRightTriangleEqual = "\u22ED"; - const NotSquareSubset = "\u228F\u0338"; - const NotSquareSubsetEqual = "\u22E2"; - const NotSquareSuperset = "\u2290\u0338"; - const NotSquareSupersetEqual = "\u22E3"; - const NotSubset = "\u2282\u20D2"; - const NotSubsetEqual = "\u2288"; - const NotSucceeds = "\u2281"; - const NotSucceedsEqual = "\u2AB0\u0338"; - const NotSucceedsSlantEqual = "\u22E1"; - const NotSucceedsTilde = "\u227F\u0338"; - const NotSuperset = "\u2283\u20D2"; - const NotSupersetEqual = "\u2289"; - const NotTilde = "\u2241"; - const NotTildeEqual = "\u2244"; - const NotTildeFullEqual = "\u2247"; - const NotTildeTilde = "\u2249"; - const NotVerticalBar = "\u2224"; - const nparallel = "\u2226"; - const npar = "\u2226"; - const nparsl = "\u2AFD\u20E5"; - const npart = "\u2202\u0338"; - const npolint = "\u2A14"; - const npr = "\u2280"; - const nprcue = "\u22E0"; - const nprec = "\u2280"; - const npreceq = "\u2AAF\u0338"; - const npre = "\u2AAF\u0338"; - const nrarrc = "\u2933\u0338"; - const nrarr = "\u219B"; - const nrArr = "\u21CF"; - const nrarrw = "\u219D\u0338"; - const nrightarrow = "\u219B"; - const nRightarrow = "\u21CF"; - const nrtri = "\u22EB"; - const nrtrie = "\u22ED"; - const nsc = "\u2281"; - const nsccue = "\u22E1"; - const nsce = "\u2AB0\u0338"; - const Nscr = "\u{1D4A9}"; - const nscr = "\u{1D4C3}"; - const nshortmid = "\u2224"; - const nshortparallel = "\u2226"; - const nsim = "\u2241"; - const nsime = "\u2244"; - const nsimeq = "\u2244"; - const nsmid = "\u2224"; - const nspar = "\u2226"; - const nsqsube = "\u22E2"; - const nsqsupe = "\u22E3"; - const nsub = "\u2284"; - const nsubE = "\u2AC5\u0338"; - const nsube = "\u2288"; - const nsubset = "\u2282\u20D2"; - const nsubseteq = "\u2288"; - const nsubseteqq = "\u2AC5\u0338"; - const nsucc = "\u2281"; - const nsucceq = "\u2AB0\u0338"; - const nsup = "\u2285"; - const nsupE = "\u2AC6\u0338"; - const nsupe = "\u2289"; - const nsupset = "\u2283\u20D2"; - const nsupseteq = "\u2289"; - const nsupseteqq = "\u2AC6\u0338"; - const ntgl = "\u2279"; - const Ntilde = "\xD1"; - const ntilde = "\xF1"; - const ntlg = "\u2278"; - const ntriangleleft = "\u22EA"; - const ntrianglelefteq = "\u22EC"; - const ntriangleright = "\u22EB"; - const ntrianglerighteq = "\u22ED"; - const Nu = "\u039D"; - const nu = "\u03BD"; - const num = "#"; - const numero = "\u2116"; - const numsp = "\u2007"; - const nvap = "\u224D\u20D2"; - const nvdash = "\u22AC"; - const nvDash = "\u22AD"; - const nVdash = "\u22AE"; - const nVDash = "\u22AF"; - const nvge = "\u2265\u20D2"; - const nvgt = ">\u20D2"; - const nvHarr = "\u2904"; - const nvinfin = "\u29DE"; - const nvlArr = "\u2902"; - const nvle = "\u2264\u20D2"; - const nvlt = "<\u20D2"; - const nvltrie = "\u22B4\u20D2"; - const nvrArr = "\u2903"; - const nvrtrie = "\u22B5\u20D2"; - const nvsim = "\u223C\u20D2"; - const nwarhk = "\u2923"; - const nwarr = "\u2196"; - const nwArr = "\u21D6"; - const nwarrow = "\u2196"; - const nwnear = "\u2927"; - const Oacute = "\xD3"; - const oacute = "\xF3"; - const oast = "\u229B"; - const Ocirc = "\xD4"; - const ocirc = "\xF4"; - const ocir = "\u229A"; - const Ocy = "\u041E"; - const ocy = "\u043E"; - const odash = "\u229D"; - const Odblac = "\u0150"; - const odblac = "\u0151"; - const odiv = "\u2A38"; - const odot = "\u2299"; - const odsold = "\u29BC"; - const OElig = "\u0152"; - const oelig = "\u0153"; - const ofcir = "\u29BF"; - const Ofr = "\u{1D512}"; - const ofr = "\u{1D52C}"; - const ogon = "\u02DB"; - const Ograve = "\xD2"; - const ograve = "\xF2"; - const ogt = "\u29C1"; - const ohbar = "\u29B5"; - const ohm = "\u03A9"; - const oint = "\u222E"; - const olarr = "\u21BA"; - const olcir = "\u29BE"; - const olcross = "\u29BB"; - const oline = "\u203E"; - const olt = "\u29C0"; - const Omacr = "\u014C"; - const omacr = "\u014D"; - const Omega = "\u03A9"; - const omega = "\u03C9"; - const Omicron = "\u039F"; - const omicron = "\u03BF"; - const omid = "\u29B6"; - const ominus = "\u2296"; - const Oopf = "\u{1D546}"; - const oopf = "\u{1D560}"; - const opar = "\u29B7"; - const OpenCurlyDoubleQuote = "\u201C"; - const OpenCurlyQuote = "\u2018"; - const operp = "\u29B9"; - const oplus = "\u2295"; - const orarr = "\u21BB"; - const Or = "\u2A54"; - const or = "\u2228"; - const ord = "\u2A5D"; - const order = "\u2134"; - const orderof = "\u2134"; - const ordf = "\xAA"; - const ordm = "\xBA"; - const origof = "\u22B6"; - const oror = "\u2A56"; - const orslope = "\u2A57"; - const orv = "\u2A5B"; - const oS = "\u24C8"; - const Oscr = "\u{1D4AA}"; - const oscr = "\u2134"; - const Oslash = "\xD8"; - const oslash = "\xF8"; - const osol = "\u2298"; - const Otilde = "\xD5"; - const otilde = "\xF5"; - const otimesas = "\u2A36"; - const Otimes = "\u2A37"; - const otimes = "\u2297"; - const Ouml = "\xD6"; - const ouml = "\xF6"; - const ovbar = "\u233D"; - const OverBar = "\u203E"; - const OverBrace = "\u23DE"; - const OverBracket = "\u23B4"; - const OverParenthesis = "\u23DC"; - const para = "\xB6"; - const parallel = "\u2225"; - const par = "\u2225"; - const parsim = "\u2AF3"; - const parsl = "\u2AFD"; - const part = "\u2202"; - const PartialD = "\u2202"; - const Pcy = "\u041F"; - const pcy = "\u043F"; - const percnt = "%"; - const period = "."; - const permil = "\u2030"; - const perp = "\u22A5"; - const pertenk = "\u2031"; - const Pfr = "\u{1D513}"; - const pfr = "\u{1D52D}"; - const Phi = "\u03A6"; - const phi = "\u03C6"; - const phiv = "\u03D5"; - const phmmat = "\u2133"; - const phone = "\u260E"; - const Pi = "\u03A0"; - const pi = "\u03C0"; - const pitchfork = "\u22D4"; - const piv = "\u03D6"; - const planck = "\u210F"; - const planckh = "\u210E"; - const plankv = "\u210F"; - const plusacir = "\u2A23"; - const plusb = "\u229E"; - const pluscir = "\u2A22"; - const plus = "+"; - const plusdo = "\u2214"; - const plusdu = "\u2A25"; - const pluse = "\u2A72"; - const PlusMinus = "\xB1"; - const plusmn = "\xB1"; - const plussim = "\u2A26"; - const plustwo = "\u2A27"; - const pm = "\xB1"; - const Poincareplane = "\u210C"; - const pointint = "\u2A15"; - const popf = "\u{1D561}"; - const Popf = "\u2119"; - const pound = "\xA3"; - const prap = "\u2AB7"; - const Pr = "\u2ABB"; - const pr = "\u227A"; - const prcue = "\u227C"; - const precapprox = "\u2AB7"; - const prec = "\u227A"; - const preccurlyeq = "\u227C"; - const Precedes = "\u227A"; - const PrecedesEqual = "\u2AAF"; - const PrecedesSlantEqual = "\u227C"; - const PrecedesTilde = "\u227E"; - const preceq = "\u2AAF"; - const precnapprox = "\u2AB9"; - const precneqq = "\u2AB5"; - const precnsim = "\u22E8"; - const pre = "\u2AAF"; - const prE = "\u2AB3"; - const precsim = "\u227E"; - const prime = "\u2032"; - const Prime = "\u2033"; - const primes = "\u2119"; - const prnap = "\u2AB9"; - const prnE = "\u2AB5"; - const prnsim = "\u22E8"; - const prod = "\u220F"; - const Product = "\u220F"; - const profalar = "\u232E"; - const profline = "\u2312"; - const profsurf = "\u2313"; - const prop = "\u221D"; - const Proportional = "\u221D"; - const Proportion = "\u2237"; - const propto = "\u221D"; - const prsim = "\u227E"; - const prurel = "\u22B0"; - const Pscr = "\u{1D4AB}"; - const pscr = "\u{1D4C5}"; - const Psi = "\u03A8"; - const psi = "\u03C8"; - const puncsp = "\u2008"; - const Qfr = "\u{1D514}"; - const qfr = "\u{1D52E}"; - const qint = "\u2A0C"; - const qopf = "\u{1D562}"; - const Qopf = "\u211A"; - const qprime = "\u2057"; - const Qscr = "\u{1D4AC}"; - const qscr = "\u{1D4C6}"; - const quaternions = "\u210D"; - const quatint = "\u2A16"; - const quest = "?"; - const questeq = "\u225F"; - const quot = '"'; - const QUOT = '"'; - const rAarr = "\u21DB"; - const race = "\u223D\u0331"; - const Racute = "\u0154"; - const racute = "\u0155"; - const radic = "\u221A"; - const raemptyv = "\u29B3"; - const rang = "\u27E9"; - const Rang = "\u27EB"; - const rangd = "\u2992"; - const range = "\u29A5"; - const rangle = "\u27E9"; - const raquo = "\xBB"; - const rarrap = "\u2975"; - const rarrb = "\u21E5"; - const rarrbfs = "\u2920"; - const rarrc = "\u2933"; - const rarr = "\u2192"; - const Rarr = "\u21A0"; - const rArr = "\u21D2"; - const rarrfs = "\u291E"; - const rarrhk = "\u21AA"; - const rarrlp = "\u21AC"; - const rarrpl = "\u2945"; - const rarrsim = "\u2974"; - const Rarrtl = "\u2916"; - const rarrtl = "\u21A3"; - const rarrw = "\u219D"; - const ratail = "\u291A"; - const rAtail = "\u291C"; - const ratio = "\u2236"; - const rationals = "\u211A"; - const rbarr = "\u290D"; - const rBarr = "\u290F"; - const RBarr = "\u2910"; - const rbbrk = "\u2773"; - const rbrace = "}"; - const rbrack = "]"; - const rbrke = "\u298C"; - const rbrksld = "\u298E"; - const rbrkslu = "\u2990"; - const Rcaron = "\u0158"; - const rcaron = "\u0159"; - const Rcedil = "\u0156"; - const rcedil = "\u0157"; - const rceil = "\u2309"; - const rcub = "}"; - const Rcy = "\u0420"; - const rcy = "\u0440"; - const rdca = "\u2937"; - const rdldhar = "\u2969"; - const rdquo = "\u201D"; - const rdquor = "\u201D"; - const rdsh = "\u21B3"; - const real = "\u211C"; - const realine = "\u211B"; - const realpart = "\u211C"; - const reals = "\u211D"; - const Re = "\u211C"; - const rect = "\u25AD"; - const reg = "\xAE"; - const REG = "\xAE"; - const ReverseElement = "\u220B"; - const ReverseEquilibrium = "\u21CB"; - const ReverseUpEquilibrium = "\u296F"; - const rfisht = "\u297D"; - const rfloor = "\u230B"; - const rfr = "\u{1D52F}"; - const Rfr = "\u211C"; - const rHar = "\u2964"; - const rhard = "\u21C1"; - const rharu = "\u21C0"; - const rharul = "\u296C"; - const Rho = "\u03A1"; - const rho = "\u03C1"; - const rhov = "\u03F1"; - const RightAngleBracket = "\u27E9"; - const RightArrowBar = "\u21E5"; - const rightarrow = "\u2192"; - const RightArrow = "\u2192"; - const Rightarrow = "\u21D2"; - const RightArrowLeftArrow = "\u21C4"; - const rightarrowtail = "\u21A3"; - const RightCeiling = "\u2309"; - const RightDoubleBracket = "\u27E7"; - const RightDownTeeVector = "\u295D"; - const RightDownVectorBar = "\u2955"; - const RightDownVector = "\u21C2"; - const RightFloor = "\u230B"; - const rightharpoondown = "\u21C1"; - const rightharpoonup = "\u21C0"; - const rightleftarrows = "\u21C4"; - const rightleftharpoons = "\u21CC"; - const rightrightarrows = "\u21C9"; - const rightsquigarrow = "\u219D"; - const RightTeeArrow = "\u21A6"; - const RightTee = "\u22A2"; - const RightTeeVector = "\u295B"; - const rightthreetimes = "\u22CC"; - const RightTriangleBar = "\u29D0"; - const RightTriangle = "\u22B3"; - const RightTriangleEqual = "\u22B5"; - const RightUpDownVector = "\u294F"; - const RightUpTeeVector = "\u295C"; - const RightUpVectorBar = "\u2954"; - const RightUpVector = "\u21BE"; - const RightVectorBar = "\u2953"; - const RightVector = "\u21C0"; - const ring = "\u02DA"; - const risingdotseq = "\u2253"; - const rlarr = "\u21C4"; - const rlhar = "\u21CC"; - const rlm = "\u200F"; - const rmoustache = "\u23B1"; - const rmoust = "\u23B1"; - const rnmid = "\u2AEE"; - const roang = "\u27ED"; - const roarr = "\u21FE"; - const robrk = "\u27E7"; - const ropar = "\u2986"; - const ropf = "\u{1D563}"; - const Ropf = "\u211D"; - const roplus = "\u2A2E"; - const rotimes = "\u2A35"; - const RoundImplies = "\u2970"; - const rpar = ")"; - const rpargt = "\u2994"; - const rppolint = "\u2A12"; - const rrarr = "\u21C9"; - const Rrightarrow = "\u21DB"; - const rsaquo = "\u203A"; - const rscr = "\u{1D4C7}"; - const Rscr = "\u211B"; - const rsh = "\u21B1"; - const Rsh = "\u21B1"; - const rsqb = "]"; - const rsquo = "\u2019"; - const rsquor = "\u2019"; - const rthree = "\u22CC"; - const rtimes = "\u22CA"; - const rtri = "\u25B9"; - const rtrie = "\u22B5"; - const rtrif = "\u25B8"; - const rtriltri = "\u29CE"; - const RuleDelayed = "\u29F4"; - const ruluhar = "\u2968"; - const rx = "\u211E"; - const Sacute = "\u015A"; - const sacute = "\u015B"; - const sbquo = "\u201A"; - const scap = "\u2AB8"; - const Scaron = "\u0160"; - const scaron = "\u0161"; - const Sc = "\u2ABC"; - const sc = "\u227B"; - const sccue = "\u227D"; - const sce = "\u2AB0"; - const scE = "\u2AB4"; - const Scedil = "\u015E"; - const scedil = "\u015F"; - const Scirc = "\u015C"; - const scirc = "\u015D"; - const scnap = "\u2ABA"; - const scnE = "\u2AB6"; - const scnsim = "\u22E9"; - const scpolint = "\u2A13"; - const scsim = "\u227F"; - const Scy = "\u0421"; - const scy = "\u0441"; - const sdotb = "\u22A1"; - const sdot = "\u22C5"; - const sdote = "\u2A66"; - const searhk = "\u2925"; - const searr = "\u2198"; - const seArr = "\u21D8"; - const searrow = "\u2198"; - const sect = "\xA7"; - const semi = ";"; - const seswar = "\u2929"; - const setminus = "\u2216"; - const setmn = "\u2216"; - const sext = "\u2736"; - const Sfr = "\u{1D516}"; - const sfr = "\u{1D530}"; - const sfrown = "\u2322"; - const sharp = "\u266F"; - const SHCHcy = "\u0429"; - const shchcy = "\u0449"; - const SHcy = "\u0428"; - const shcy = "\u0448"; - const ShortDownArrow = "\u2193"; - const ShortLeftArrow = "\u2190"; - const shortmid = "\u2223"; - const shortparallel = "\u2225"; - const ShortRightArrow = "\u2192"; - const ShortUpArrow = "\u2191"; - const shy = "\xAD"; - const Sigma = "\u03A3"; - const sigma = "\u03C3"; - const sigmaf = "\u03C2"; - const sigmav = "\u03C2"; - const sim = "\u223C"; - const simdot = "\u2A6A"; - const sime = "\u2243"; - const simeq = "\u2243"; - const simg = "\u2A9E"; - const simgE = "\u2AA0"; - const siml = "\u2A9D"; - const simlE = "\u2A9F"; - const simne = "\u2246"; - const simplus = "\u2A24"; - const simrarr = "\u2972"; - const slarr = "\u2190"; - const SmallCircle = "\u2218"; - const smallsetminus = "\u2216"; - const smashp = "\u2A33"; - const smeparsl = "\u29E4"; - const smid = "\u2223"; - const smile = "\u2323"; - const smt = "\u2AAA"; - const smte = "\u2AAC"; - const smtes = "\u2AAC\uFE00"; - const SOFTcy = "\u042C"; - const softcy = "\u044C"; - const solbar = "\u233F"; - const solb = "\u29C4"; - const sol = "/"; - const Sopf = "\u{1D54A}"; - const sopf = "\u{1D564}"; - const spades = "\u2660"; - const spadesuit = "\u2660"; - const spar = "\u2225"; - const sqcap = "\u2293"; - const sqcaps = "\u2293\uFE00"; - const sqcup = "\u2294"; - const sqcups = "\u2294\uFE00"; - const Sqrt = "\u221A"; - const sqsub = "\u228F"; - const sqsube = "\u2291"; - const sqsubset = "\u228F"; - const sqsubseteq = "\u2291"; - const sqsup = "\u2290"; - const sqsupe = "\u2292"; - const sqsupset = "\u2290"; - const sqsupseteq = "\u2292"; - const square = "\u25A1"; - const Square = "\u25A1"; - const SquareIntersection = "\u2293"; - const SquareSubset = "\u228F"; - const SquareSubsetEqual = "\u2291"; - const SquareSuperset = "\u2290"; - const SquareSupersetEqual = "\u2292"; - const SquareUnion = "\u2294"; - const squarf = "\u25AA"; - const squ = "\u25A1"; - const squf = "\u25AA"; - const srarr = "\u2192"; - const Sscr = "\u{1D4AE}"; - const sscr = "\u{1D4C8}"; - const ssetmn = "\u2216"; - const ssmile = "\u2323"; - const sstarf = "\u22C6"; - const Star = "\u22C6"; - const star = "\u2606"; - const starf = "\u2605"; - const straightepsilon = "\u03F5"; - const straightphi = "\u03D5"; - const strns = "\xAF"; - const sub = "\u2282"; - const Sub = "\u22D0"; - const subdot = "\u2ABD"; - const subE = "\u2AC5"; - const sube = "\u2286"; - const subedot = "\u2AC3"; - const submult = "\u2AC1"; - const subnE = "\u2ACB"; - const subne = "\u228A"; - const subplus = "\u2ABF"; - const subrarr = "\u2979"; - const subset = "\u2282"; - const Subset = "\u22D0"; - const subseteq = "\u2286"; - const subseteqq = "\u2AC5"; - const SubsetEqual = "\u2286"; - const subsetneq = "\u228A"; - const subsetneqq = "\u2ACB"; - const subsim = "\u2AC7"; - const subsub = "\u2AD5"; - const subsup = "\u2AD3"; - const succapprox = "\u2AB8"; - const succ = "\u227B"; - const succcurlyeq = "\u227D"; - const Succeeds = "\u227B"; - const SucceedsEqual = "\u2AB0"; - const SucceedsSlantEqual = "\u227D"; - const SucceedsTilde = "\u227F"; - const succeq = "\u2AB0"; - const succnapprox = "\u2ABA"; - const succneqq = "\u2AB6"; - const succnsim = "\u22E9"; - const succsim = "\u227F"; - const SuchThat = "\u220B"; - const sum = "\u2211"; - const Sum = "\u2211"; - const sung = "\u266A"; - const sup1 = "\xB9"; - const sup2 = "\xB2"; - const sup3 = "\xB3"; - const sup = "\u2283"; - const Sup = "\u22D1"; - const supdot = "\u2ABE"; - const supdsub = "\u2AD8"; - const supE = "\u2AC6"; - const supe = "\u2287"; - const supedot = "\u2AC4"; - const Superset = "\u2283"; - const SupersetEqual = "\u2287"; - const suphsol = "\u27C9"; - const suphsub = "\u2AD7"; - const suplarr = "\u297B"; - const supmult = "\u2AC2"; - const supnE = "\u2ACC"; - const supne = "\u228B"; - const supplus = "\u2AC0"; - const supset = "\u2283"; - const Supset = "\u22D1"; - const supseteq = "\u2287"; - const supseteqq = "\u2AC6"; - const supsetneq = "\u228B"; - const supsetneqq = "\u2ACC"; - const supsim = "\u2AC8"; - const supsub = "\u2AD4"; - const supsup = "\u2AD6"; - const swarhk = "\u2926"; - const swarr = "\u2199"; - const swArr = "\u21D9"; - const swarrow = "\u2199"; - const swnwar = "\u292A"; - const szlig = "\xDF"; - const Tab$1 = " "; - const target = "\u2316"; - const Tau = "\u03A4"; - const tau = "\u03C4"; - const tbrk = "\u23B4"; - const Tcaron = "\u0164"; - const tcaron = "\u0165"; - const Tcedil = "\u0162"; - const tcedil = "\u0163"; - const Tcy = "\u0422"; - const tcy = "\u0442"; - const tdot = "\u20DB"; - const telrec = "\u2315"; - const Tfr = "\u{1D517}"; - const tfr = "\u{1D531}"; - const there4 = "\u2234"; - const therefore = "\u2234"; - const Therefore = "\u2234"; - const Theta = "\u0398"; - const theta = "\u03B8"; - const thetasym = "\u03D1"; - const thetav = "\u03D1"; - const thickapprox = "\u2248"; - const thicksim = "\u223C"; - const ThickSpace = "\u205F\u200A"; - const ThinSpace = "\u2009"; - const thinsp = "\u2009"; - const thkap = "\u2248"; - const thksim = "\u223C"; - const THORN = "\xDE"; - const thorn = "\xFE"; - const tilde = "\u02DC"; - const Tilde = "\u223C"; - const TildeEqual = "\u2243"; - const TildeFullEqual = "\u2245"; - const TildeTilde = "\u2248"; - const timesbar = "\u2A31"; - const timesb = "\u22A0"; - const times = "\xD7"; - const timesd = "\u2A30"; - const tint = "\u222D"; - const toea = "\u2928"; - const topbot = "\u2336"; - const topcir = "\u2AF1"; - const top = "\u22A4"; - const Topf = "\u{1D54B}"; - const topf = "\u{1D565}"; - const topfork = "\u2ADA"; - const tosa = "\u2929"; - const tprime = "\u2034"; - const trade = "\u2122"; - const TRADE = "\u2122"; - const triangle = "\u25B5"; - const triangledown = "\u25BF"; - const triangleleft = "\u25C3"; - const trianglelefteq = "\u22B4"; - const triangleq = "\u225C"; - const triangleright = "\u25B9"; - const trianglerighteq = "\u22B5"; - const tridot = "\u25EC"; - const trie = "\u225C"; - const triminus = "\u2A3A"; - const TripleDot = "\u20DB"; - const triplus = "\u2A39"; - const trisb = "\u29CD"; - const tritime = "\u2A3B"; - const trpezium = "\u23E2"; - const Tscr = "\u{1D4AF}"; - const tscr = "\u{1D4C9}"; - const TScy = "\u0426"; - const tscy = "\u0446"; - const TSHcy = "\u040B"; - const tshcy = "\u045B"; - const Tstrok = "\u0166"; - const tstrok = "\u0167"; - const twixt = "\u226C"; - const twoheadleftarrow = "\u219E"; - const twoheadrightarrow = "\u21A0"; - const Uacute = "\xDA"; - const uacute = "\xFA"; - const uarr = "\u2191"; - const Uarr = "\u219F"; - const uArr = "\u21D1"; - const Uarrocir = "\u2949"; - const Ubrcy = "\u040E"; - const ubrcy = "\u045E"; - const Ubreve = "\u016C"; - const ubreve = "\u016D"; - const Ucirc = "\xDB"; - const ucirc = "\xFB"; - const Ucy = "\u0423"; - const ucy = "\u0443"; - const udarr = "\u21C5"; - const Udblac = "\u0170"; - const udblac = "\u0171"; - const udhar = "\u296E"; - const ufisht = "\u297E"; - const Ufr = "\u{1D518}"; - const ufr = "\u{1D532}"; - const Ugrave = "\xD9"; - const ugrave = "\xF9"; - const uHar = "\u2963"; - const uharl = "\u21BF"; - const uharr = "\u21BE"; - const uhblk = "\u2580"; - const ulcorn = "\u231C"; - const ulcorner = "\u231C"; - const ulcrop = "\u230F"; - const ultri = "\u25F8"; - const Umacr = "\u016A"; - const umacr = "\u016B"; - const uml = "\xA8"; - const UnderBar = "_"; - const UnderBrace = "\u23DF"; - const UnderBracket = "\u23B5"; - const UnderParenthesis = "\u23DD"; - const Union = "\u22C3"; - const UnionPlus = "\u228E"; - const Uogon = "\u0172"; - const uogon = "\u0173"; - const Uopf = "\u{1D54C}"; - const uopf = "\u{1D566}"; - const UpArrowBar = "\u2912"; - const uparrow = "\u2191"; - const UpArrow = "\u2191"; - const Uparrow = "\u21D1"; - const UpArrowDownArrow = "\u21C5"; - const updownarrow = "\u2195"; - const UpDownArrow = "\u2195"; - const Updownarrow = "\u21D5"; - const UpEquilibrium = "\u296E"; - const upharpoonleft = "\u21BF"; - const upharpoonright = "\u21BE"; - const uplus = "\u228E"; - const UpperLeftArrow = "\u2196"; - const UpperRightArrow = "\u2197"; - const upsi = "\u03C5"; - const Upsi = "\u03D2"; - const upsih = "\u03D2"; - const Upsilon = "\u03A5"; - const upsilon = "\u03C5"; - const UpTeeArrow = "\u21A5"; - const UpTee = "\u22A5"; - const upuparrows = "\u21C8"; - const urcorn = "\u231D"; - const urcorner = "\u231D"; - const urcrop = "\u230E"; - const Uring = "\u016E"; - const uring = "\u016F"; - const urtri = "\u25F9"; - const Uscr = "\u{1D4B0}"; - const uscr = "\u{1D4CA}"; - const utdot = "\u22F0"; - const Utilde = "\u0168"; - const utilde = "\u0169"; - const utri = "\u25B5"; - const utrif = "\u25B4"; - const uuarr = "\u21C8"; - const Uuml = "\xDC"; - const uuml = "\xFC"; - const uwangle = "\u29A7"; - const vangrt = "\u299C"; - const varepsilon = "\u03F5"; - const varkappa = "\u03F0"; - const varnothing = "\u2205"; - const varphi = "\u03D5"; - const varpi = "\u03D6"; - const varpropto = "\u221D"; - const varr = "\u2195"; - const vArr = "\u21D5"; - const varrho = "\u03F1"; - const varsigma = "\u03C2"; - const varsubsetneq = "\u228A\uFE00"; - const varsubsetneqq = "\u2ACB\uFE00"; - const varsupsetneq = "\u228B\uFE00"; - const varsupsetneqq = "\u2ACC\uFE00"; - const vartheta = "\u03D1"; - const vartriangleleft = "\u22B2"; - const vartriangleright = "\u22B3"; - const vBar = "\u2AE8"; - const Vbar = "\u2AEB"; - const vBarv = "\u2AE9"; - const Vcy = "\u0412"; - const vcy = "\u0432"; - const vdash = "\u22A2"; - const vDash = "\u22A8"; - const Vdash = "\u22A9"; - const VDash = "\u22AB"; - const Vdashl = "\u2AE6"; - const veebar = "\u22BB"; - const vee = "\u2228"; - const Vee = "\u22C1"; - const veeeq = "\u225A"; - const vellip = "\u22EE"; - const verbar = "|"; - const Verbar = "\u2016"; - const vert = "|"; - const Vert = "\u2016"; - const VerticalBar = "\u2223"; - const VerticalLine = "|"; - const VerticalSeparator = "\u2758"; - const VerticalTilde = "\u2240"; - const VeryThinSpace = "\u200A"; - const Vfr = "\u{1D519}"; - const vfr = "\u{1D533}"; - const vltri = "\u22B2"; - const vnsub = "\u2282\u20D2"; - const vnsup = "\u2283\u20D2"; - const Vopf = "\u{1D54D}"; - const vopf = "\u{1D567}"; - const vprop = "\u221D"; - const vrtri = "\u22B3"; - const Vscr = "\u{1D4B1}"; - const vscr = "\u{1D4CB}"; - const vsubnE = "\u2ACB\uFE00"; - const vsubne = "\u228A\uFE00"; - const vsupnE = "\u2ACC\uFE00"; - const vsupne = "\u228B\uFE00"; - const Vvdash = "\u22AA"; - const vzigzag = "\u299A"; - const Wcirc = "\u0174"; - const wcirc = "\u0175"; - const wedbar = "\u2A5F"; - const wedge = "\u2227"; - const Wedge = "\u22C0"; - const wedgeq = "\u2259"; - const weierp = "\u2118"; - const Wfr = "\u{1D51A}"; - const wfr = "\u{1D534}"; - const Wopf = "\u{1D54E}"; - const wopf = "\u{1D568}"; - const wp = "\u2118"; - const wr = "\u2240"; - const wreath = "\u2240"; - const Wscr = "\u{1D4B2}"; - const wscr = "\u{1D4CC}"; - const xcap = "\u22C2"; - const xcirc = "\u25EF"; - const xcup = "\u22C3"; - const xdtri = "\u25BD"; - const Xfr = "\u{1D51B}"; - const xfr = "\u{1D535}"; - const xharr = "\u27F7"; - const xhArr = "\u27FA"; - const Xi = "\u039E"; - const xi = "\u03BE"; - const xlarr = "\u27F5"; - const xlArr = "\u27F8"; - const xmap = "\u27FC"; - const xnis = "\u22FB"; - const xodot = "\u2A00"; - const Xopf = "\u{1D54F}"; - const xopf = "\u{1D569}"; - const xoplus = "\u2A01"; - const xotime = "\u2A02"; - const xrarr = "\u27F6"; - const xrArr = "\u27F9"; - const Xscr = "\u{1D4B3}"; - const xscr = "\u{1D4CD}"; - const xsqcup = "\u2A06"; - const xuplus = "\u2A04"; - const xutri = "\u25B3"; - const xvee = "\u22C1"; - const xwedge = "\u22C0"; - const Yacute = "\xDD"; - const yacute = "\xFD"; - const YAcy = "\u042F"; - const yacy = "\u044F"; - const Ycirc = "\u0176"; - const ycirc = "\u0177"; - const Ycy = "\u042B"; - const ycy = "\u044B"; - const yen = "\xA5"; - const Yfr = "\u{1D51C}"; - const yfr = "\u{1D536}"; - const YIcy = "\u0407"; - const yicy = "\u0457"; - const Yopf = "\u{1D550}"; - const yopf = "\u{1D56A}"; - const Yscr = "\u{1D4B4}"; - const yscr = "\u{1D4CE}"; - const YUcy = "\u042E"; - const yucy = "\u044E"; - const yuml = "\xFF"; - const Yuml = "\u0178"; - const Zacute = "\u0179"; - const zacute = "\u017A"; - const Zcaron = "\u017D"; - const zcaron = "\u017E"; - const Zcy = "\u0417"; - const zcy = "\u0437"; - const Zdot = "\u017B"; - const zdot = "\u017C"; - const zeetrf = "\u2128"; - const ZeroWidthSpace = "\u200B"; - const Zeta = "\u0396"; - const zeta = "\u03B6"; - const zfr = "\u{1D537}"; - const Zfr = "\u2128"; - const ZHcy = "\u0416"; - const zhcy = "\u0436"; - const zigrarr = "\u21DD"; - const zopf = "\u{1D56B}"; - const Zopf = "\u2124"; - const Zscr = "\u{1D4B5}"; - const zscr = "\u{1D4CF}"; - const zwj = "\u200D"; - const zwnj = "\u200C"; - var require$$0 = { - Aacute, - aacute, - Abreve, - abreve, - ac, - acd, - acE, - Acirc, - acirc, - acute, - Acy, - acy, - AElig, - aelig, - af, - Afr, - afr, - Agrave, - agrave, - alefsym, - aleph, - Alpha, - alpha, - Amacr, - amacr, - amalg, - amp, - AMP, - andand, - And, - and, - andd, - andslope, - andv, - ang, - ange, - angle, - angmsdaa, - angmsdab, - angmsdac, - angmsdad, - angmsdae, - angmsdaf, - angmsdag, - angmsdah, - angmsd, - angrt, - angrtvb, - angrtvbd, - angsph, - angst, - angzarr, - Aogon, - aogon, - Aopf, - aopf, - apacir, - ap, - apE, - ape, - apid, - apos, - ApplyFunction, - approx, - approxeq, - Aring, - aring, - Ascr, - ascr, - Assign, - ast, - asymp, - asympeq, - Atilde, - atilde, - Auml, - auml, - awconint, - awint, - backcong, - backepsilon, - backprime, - backsim, - backsimeq, - Backslash, - Barv, - barvee, - barwed, - Barwed, - barwedge, - bbrk, - bbrktbrk, - bcong, - Bcy, - bcy, - bdquo, - becaus, - because, - Because, - bemptyv, - bepsi, - bernou, - Bernoullis, - Beta, - beta, - beth, - between, - Bfr, - bfr, - bigcap, - bigcirc, - bigcup, - bigodot, - bigoplus, - bigotimes, - bigsqcup, - bigstar, - bigtriangledown, - bigtriangleup, - biguplus, - bigvee, - bigwedge, - bkarow, - blacklozenge, - blacksquare, - blacktriangle, - blacktriangledown, - blacktriangleleft, - blacktriangleright, - blank, - blk12, - blk14, - blk34, - block: block$1, - bne, - bnequiv, - bNot, - bnot, - Bopf, - bopf, - bot, - bottom, - bowtie, - boxbox, - boxdl, - boxdL, - boxDl, - boxDL, - boxdr, - boxdR, - boxDr, - boxDR, - boxh, - boxH, - boxhd, - boxHd, - boxhD, - boxHD, - boxhu, - boxHu, - boxhU, - boxHU, - boxminus, - boxplus, - boxtimes, - boxul, - boxuL, - boxUl, - boxUL, - boxur, - boxuR, - boxUr, - boxUR, - boxv, - boxV, - boxvh, - boxvH, - boxVh, - boxVH, - boxvl, - boxvL, - boxVl, - boxVL, - boxvr, - boxvR, - boxVr, - boxVR, - bprime, - breve, - Breve, - brvbar, - bscr, - Bscr, - bsemi, - bsim, - bsime, - bsolb, - bsol, - bsolhsub, - bull, - bullet, - bump, - bumpE, - bumpe, - Bumpeq, - bumpeq, - Cacute, - cacute, - capand, - capbrcup, - capcap, - cap, - Cap, - capcup, - capdot, - CapitalDifferentialD, - caps, - caret, - caron, - Cayleys, - ccaps, - Ccaron, - ccaron, - Ccedil, - ccedil, - Ccirc, - ccirc, - Cconint, - ccups, - ccupssm, - Cdot, - cdot, - cedil, - Cedilla, - cemptyv, - cent, - centerdot, - CenterDot, - cfr, - Cfr, - CHcy, - chcy, - check, - checkmark, - Chi, - chi, - circ, - circeq, - circlearrowleft, - circlearrowright, - circledast, - circledcirc, - circleddash, - CircleDot, - circledR, - circledS, - CircleMinus, - CirclePlus, - CircleTimes, - cir, - cirE, - cire, - cirfnint, - cirmid, - cirscir, - ClockwiseContourIntegral, - CloseCurlyDoubleQuote, - CloseCurlyQuote, - clubs, - clubsuit, - colon, - Colon, - Colone, - colone, - coloneq, - comma, - commat, - comp, - compfn, - complement, - complexes, - cong, - congdot, - Congruent, - conint, - Conint, - ContourIntegral, - copf, - Copf, - coprod, - Coproduct, - copy: copy$1, - COPY, - copysr, - CounterClockwiseContourIntegral, - crarr, - cross, - Cross, - Cscr, - cscr, - csub, - csube, - csup, - csupe, - ctdot, - cudarrl, - cudarrr, - cuepr, - cuesc, - cularr, - cularrp, - cupbrcap, - cupcap, - CupCap, - cup, - Cup, - cupcup, - cupdot, - cupor, - cups, - curarr, - curarrm, - curlyeqprec, - curlyeqsucc, - curlyvee, - curlywedge, - curren, - curvearrowleft, - curvearrowright, - cuvee, - cuwed, - cwconint, - cwint, - cylcty, - dagger, - Dagger, - daleth, - darr, - Darr, - dArr, - dash, - Dashv, - dashv, - dbkarow, - dblac, - Dcaron, - dcaron, - Dcy, - dcy, - ddagger, - ddarr, - DD, - dd, - DDotrahd, - ddotseq, - deg, - Del, - Delta, - delta, - demptyv, - dfisht, - Dfr, - dfr, - dHar, - dharl, - dharr, - DiacriticalAcute, - DiacriticalDot, - DiacriticalDoubleAcute, - DiacriticalGrave, - DiacriticalTilde, - diam, - diamond, - Diamond, - diamondsuit, - diams, - die, - DifferentialD, - digamma, - disin, - div, - divide, - divideontimes, - divonx, - DJcy, - djcy, - dlcorn, - dlcrop, - dollar, - Dopf, - dopf, - Dot, - dot, - DotDot, - doteq, - doteqdot, - DotEqual, - dotminus, - dotplus, - dotsquare, - doublebarwedge, - DoubleContourIntegral, - DoubleDot, - DoubleDownArrow, - DoubleLeftArrow, - DoubleLeftRightArrow, - DoubleLeftTee, - DoubleLongLeftArrow, - DoubleLongLeftRightArrow, - DoubleLongRightArrow, - DoubleRightArrow, - DoubleRightTee, - DoubleUpArrow, - DoubleUpDownArrow, - DoubleVerticalBar, - DownArrowBar, - downarrow, - DownArrow, - Downarrow, - DownArrowUpArrow, - DownBreve, - downdownarrows, - downharpoonleft, - downharpoonright, - DownLeftRightVector, - DownLeftTeeVector, - DownLeftVectorBar, - DownLeftVector, - DownRightTeeVector, - DownRightVectorBar, - DownRightVector, - DownTeeArrow, - DownTee, - drbkarow, - drcorn, - drcrop, - Dscr, - dscr, - DScy, - dscy, - dsol, - Dstrok, - dstrok, - dtdot, - dtri, - dtrif, - duarr, - duhar, - dwangle, - DZcy, - dzcy, - dzigrarr, - Eacute, - eacute, - easter, - Ecaron, - ecaron, - Ecirc, - ecirc, - ecir, - ecolon, - Ecy, - ecy, - eDDot, - Edot, - edot, - eDot, - ee, - efDot, - Efr, - efr, - eg, - Egrave, - egrave, - egs, - egsdot, - el, - Element: Element$1, - elinters, - ell, - els, - elsdot, - Emacr, - emacr, - empty, - emptyset, - EmptySmallSquare, - emptyv, - EmptyVerySmallSquare, - emsp13, - emsp14, - emsp, - ENG, - eng, - ensp, - Eogon, - eogon, - Eopf, - eopf, - epar, - eparsl, - eplus, - epsi, - Epsilon, - epsilon, - epsiv, - eqcirc, - eqcolon, - eqsim, - eqslantgtr, - eqslantless, - Equal, - equals, - EqualTilde, - equest, - Equilibrium, - equiv, - equivDD, - eqvparsl, - erarr, - erDot, - escr, - Escr, - esdot, - Esim, - esim, - Eta, - eta, - ETH, - eth, - Euml, - euml, - euro, - excl, - exist, - Exists, - expectation, - exponentiale, - ExponentialE, - fallingdotseq, - Fcy, - fcy, - female, - ffilig, - fflig, - ffllig, - Ffr, - ffr, - filig, - FilledSmallSquare, - FilledVerySmallSquare, - fjlig, - flat, - fllig, - fltns, - fnof, - Fopf, - fopf, - forall, - ForAll, - fork, - forkv, - Fouriertrf, - fpartint, - frac12, - frac13, - frac14, - frac15, - frac16, - frac18, - frac23, - frac25, - frac34, - frac35, - frac38, - frac45, - frac56, - frac58, - frac78, - frasl, - frown, - fscr, - Fscr, - gacute, - Gamma, - gamma, - Gammad, - gammad, - gap, - Gbreve, - gbreve, - Gcedil, - Gcirc, - gcirc, - Gcy, - gcy, - Gdot, - gdot, - ge, - gE, - gEl, - gel, - geq, - geqq, - geqslant, - gescc, - ges, - gesdot, - gesdoto, - gesdotol, - gesl, - gesles, - Gfr, - gfr, - gg, - Gg, - ggg, - gimel, - GJcy, - gjcy, - gla, - gl, - glE, - glj, - gnap, - gnapprox, - gne, - gnE, - gneq, - gneqq, - gnsim, - Gopf, - gopf, - grave, - GreaterEqual, - GreaterEqualLess, - GreaterFullEqual, - GreaterGreater, - GreaterLess, - GreaterSlantEqual, - GreaterTilde, - Gscr, - gscr, - gsim, - gsime, - gsiml, - gtcc, - gtcir, - gt, - GT, - Gt, - gtdot, - gtlPar, - gtquest, - gtrapprox, - gtrarr, - gtrdot, - gtreqless, - gtreqqless, - gtrless, - gtrsim, - gvertneqq, - gvnE, - Hacek, - hairsp, - half, - hamilt, - HARDcy, - hardcy, - harrcir, - harr, - hArr, - harrw, - Hat, - hbar, - Hcirc, - hcirc, - hearts, - heartsuit, - hellip, - hercon, - hfr, - Hfr, - HilbertSpace, - hksearow, - hkswarow, - hoarr, - homtht, - hookleftarrow, - hookrightarrow, - hopf, - Hopf, - horbar, - HorizontalLine, - hscr, - Hscr, - hslash, - Hstrok, - hstrok, - HumpDownHump, - HumpEqual, - hybull, - hyphen, - Iacute, - iacute, - ic, - Icirc, - icirc, - Icy, - icy, - Idot, - IEcy, - iecy, - iexcl, - iff, - ifr, - Ifr, - Igrave, - igrave, - ii, - iiiint, - iiint, - iinfin, - iiota, - IJlig, - ijlig, - Imacr, - imacr, - image: image$1, - ImaginaryI, - imagline, - imagpart, - imath, - Im, - imof, - imped, - Implies, - incare, - "in": "\u2208", - infin, - infintie, - inodot, - intcal, - int, - Int, - integers, - Integral, - intercal, - Intersection, - intlarhk, - intprod, - InvisibleComma, - InvisibleTimes, - IOcy, - iocy, - Iogon, - iogon, - Iopf, - iopf, - Iota, - iota, - iprod, - iquest, - iscr, - Iscr, - isin, - isindot, - isinE, - isins, - isinsv, - isinv, - it, - Itilde, - itilde, - Iukcy, - iukcy, - Iuml, - iuml, - Jcirc, - jcirc, - Jcy, - jcy, - Jfr, - jfr, - jmath, - Jopf, - jopf, - Jscr, - jscr, - Jsercy, - jsercy, - Jukcy, - jukcy, - Kappa, - kappa, - kappav, - Kcedil, - kcedil, - Kcy, - kcy, - Kfr, - kfr, - kgreen, - KHcy, - khcy, - KJcy, - kjcy, - Kopf, - kopf, - Kscr, - kscr, - lAarr, - Lacute, - lacute, - laemptyv, - lagran, - Lambda, - lambda, - lang, - Lang, - langd, - langle, - lap, - Laplacetrf, - laquo, - larrb, - larrbfs, - larr, - Larr, - lArr, - larrfs, - larrhk, - larrlp, - larrpl, - larrsim, - larrtl, - latail, - lAtail, - lat, - late, - lates, - lbarr, - lBarr, - lbbrk, - lbrace, - lbrack, - lbrke, - lbrksld, - lbrkslu, - Lcaron, - lcaron, - Lcedil, - lcedil, - lceil, - lcub, - Lcy, - lcy, - ldca, - ldquo, - ldquor, - ldrdhar, - ldrushar, - ldsh, - le, - lE, - LeftAngleBracket, - LeftArrowBar, - leftarrow, - LeftArrow, - Leftarrow, - LeftArrowRightArrow, - leftarrowtail, - LeftCeiling, - LeftDoubleBracket, - LeftDownTeeVector, - LeftDownVectorBar, - LeftDownVector, - LeftFloor, - leftharpoondown, - leftharpoonup, - leftleftarrows, - leftrightarrow, - LeftRightArrow, - Leftrightarrow, - leftrightarrows, - leftrightharpoons, - leftrightsquigarrow, - LeftRightVector, - LeftTeeArrow, - LeftTee, - LeftTeeVector, - leftthreetimes, - LeftTriangleBar, - LeftTriangle, - LeftTriangleEqual, - LeftUpDownVector, - LeftUpTeeVector, - LeftUpVectorBar, - LeftUpVector, - LeftVectorBar, - LeftVector, - lEg, - leg, - leq, - leqq, - leqslant, - lescc, - les, - lesdot, - lesdoto, - lesdotor, - lesg, - lesges, - lessapprox, - lessdot, - lesseqgtr, - lesseqqgtr, - LessEqualGreater, - LessFullEqual, - LessGreater, - lessgtr, - LessLess, - lesssim, - LessSlantEqual, - LessTilde, - lfisht, - lfloor, - Lfr, - lfr, - lg, - lgE, - lHar, - lhard, - lharu, - lharul, - lhblk, - LJcy, - ljcy, - llarr, - ll, - Ll, - llcorner, - Lleftarrow, - llhard, - lltri, - Lmidot, - lmidot, - lmoustache, - lmoust, - lnap, - lnapprox, - lne, - lnE, - lneq, - lneqq, - lnsim, - loang, - loarr, - lobrk, - longleftarrow, - LongLeftArrow, - Longleftarrow, - longleftrightarrow, - LongLeftRightArrow, - Longleftrightarrow, - longmapsto, - longrightarrow, - LongRightArrow, - Longrightarrow, - looparrowleft, - looparrowright, - lopar, - Lopf, - lopf, - loplus, - lotimes, - lowast, - lowbar, - LowerLeftArrow, - LowerRightArrow, - loz, - lozenge, - lozf, - lpar, - lparlt, - lrarr, - lrcorner, - lrhar, - lrhard, - lrm, - lrtri, - lsaquo, - lscr, - Lscr, - lsh, - Lsh, - lsim, - lsime, - lsimg, - lsqb, - lsquo, - lsquor, - Lstrok, - lstrok, - ltcc, - ltcir, - lt, - LT, - Lt, - ltdot, - lthree, - ltimes, - ltlarr, - ltquest, - ltri, - ltrie, - ltrif, - ltrPar, - lurdshar, - luruhar, - lvertneqq, - lvnE, - macr, - male, - malt, - maltese, - "Map": "\u2905", - map: map$1, - mapsto, - mapstodown, - mapstoleft, - mapstoup, - marker, - mcomma, - Mcy, - mcy, - mdash, - mDDot, - measuredangle, - MediumSpace, - Mellintrf, - Mfr, - mfr, - mho, - micro, - midast, - midcir, - mid, - middot, - minusb, - minus, - minusd, - minusdu, - MinusPlus, - mlcp, - mldr, - mnplus, - models, - Mopf, - mopf, - mp, - mscr, - Mscr, - mstpos, - Mu, - mu, - multimap, - mumap, - nabla, - Nacute, - nacute, - nang, - nap, - napE, - napid, - napos, - napprox, - natural, - naturals, - natur, - nbsp, - nbump, - nbumpe, - ncap, - Ncaron, - ncaron, - Ncedil, - ncedil, - ncong, - ncongdot, - ncup, - Ncy, - ncy, - ndash, - nearhk, - nearr, - neArr, - nearrow, - ne, - nedot, - NegativeMediumSpace, - NegativeThickSpace, - NegativeThinSpace, - NegativeVeryThinSpace, - nequiv, - nesear, - nesim, - NestedGreaterGreater, - NestedLessLess, - NewLine, - nexist, - nexists, - Nfr, - nfr, - ngE, - nge, - ngeq, - ngeqq, - ngeqslant, - nges, - nGg, - ngsim, - nGt, - ngt, - ngtr, - nGtv, - nharr, - nhArr, - nhpar, - ni, - nis, - nisd, - niv, - NJcy, - njcy, - nlarr, - nlArr, - nldr, - nlE, - nle, - nleftarrow, - nLeftarrow, - nleftrightarrow, - nLeftrightarrow, - nleq, - nleqq, - nleqslant, - nles, - nless, - nLl, - nlsim, - nLt, - nlt, - nltri, - nltrie, - nLtv, - nmid, - NoBreak, - NonBreakingSpace, - nopf, - Nopf, - Not, - not, - NotCongruent, - NotCupCap, - NotDoubleVerticalBar, - NotElement, - NotEqual, - NotEqualTilde, - NotExists, - NotGreater, - NotGreaterEqual, - NotGreaterFullEqual, - NotGreaterGreater, - NotGreaterLess, - NotGreaterSlantEqual, - NotGreaterTilde, - NotHumpDownHump, - NotHumpEqual, - notin, - notindot, - notinE, - notinva, - notinvb, - notinvc, - NotLeftTriangleBar, - NotLeftTriangle, - NotLeftTriangleEqual, - NotLess, - NotLessEqual, - NotLessGreater, - NotLessLess, - NotLessSlantEqual, - NotLessTilde, - NotNestedGreaterGreater, - NotNestedLessLess, - notni, - notniva, - notnivb, - notnivc, - NotPrecedes, - NotPrecedesEqual, - NotPrecedesSlantEqual, - NotReverseElement, - NotRightTriangleBar, - NotRightTriangle, - NotRightTriangleEqual, - NotSquareSubset, - NotSquareSubsetEqual, - NotSquareSuperset, - NotSquareSupersetEqual, - NotSubset, - NotSubsetEqual, - NotSucceeds, - NotSucceedsEqual, - NotSucceedsSlantEqual, - NotSucceedsTilde, - NotSuperset, - NotSupersetEqual, - NotTilde, - NotTildeEqual, - NotTildeFullEqual, - NotTildeTilde, - NotVerticalBar, - nparallel, - npar, - nparsl, - npart, - npolint, - npr, - nprcue, - nprec, - npreceq, - npre, - nrarrc, - nrarr, - nrArr, - nrarrw, - nrightarrow, - nRightarrow, - nrtri, - nrtrie, - nsc, - nsccue, - nsce, - Nscr, - nscr, - nshortmid, - nshortparallel, - nsim, - nsime, - nsimeq, - nsmid, - nspar, - nsqsube, - nsqsupe, - nsub, - nsubE, - nsube, - nsubset, - nsubseteq, - nsubseteqq, - nsucc, - nsucceq, - nsup, - nsupE, - nsupe, - nsupset, - nsupseteq, - nsupseteqq, - ntgl, - Ntilde, - ntilde, - ntlg, - ntriangleleft, - ntrianglelefteq, - ntriangleright, - ntrianglerighteq, - Nu, - nu, - num, - numero, - numsp, - nvap, - nvdash, - nvDash, - nVdash, - nVDash, - nvge, - nvgt, - nvHarr, - nvinfin, - nvlArr, - nvle, - nvlt, - nvltrie, - nvrArr, - nvrtrie, - nvsim, - nwarhk, - nwarr, - nwArr, - nwarrow, - nwnear, - Oacute, - oacute, - oast, - Ocirc, - ocirc, - ocir, - Ocy, - ocy, - odash, - Odblac, - odblac, - odiv, - odot, - odsold, - OElig, - oelig, - ofcir, - Ofr, - ofr, - ogon, - Ograve, - ograve, - ogt, - ohbar, - ohm, - oint, - olarr, - olcir, - olcross, - oline, - olt, - Omacr, - omacr, - Omega, - omega, - Omicron, - omicron, - omid, - ominus, - Oopf, - oopf, - opar, - OpenCurlyDoubleQuote, - OpenCurlyQuote, - operp, - oplus, - orarr, - Or, - or, - ord, - order, - orderof, - ordf, - ordm, - origof, - oror, - orslope, - orv, - oS, - Oscr, - oscr, - Oslash, - oslash, - osol, - Otilde, - otilde, - otimesas, - Otimes, - otimes, - Ouml, - ouml, - ovbar, - OverBar, - OverBrace, - OverBracket, - OverParenthesis, - para, - parallel, - par, - parsim, - parsl, - part, - PartialD, - Pcy, - pcy, - percnt, - period, - permil, - perp, - pertenk, - Pfr, - pfr, - Phi, - phi, - phiv, - phmmat, - phone, - Pi, - pi, - pitchfork, - piv, - planck, - planckh, - plankv, - plusacir, - plusb, - pluscir, - plus, - plusdo, - plusdu, - pluse, - PlusMinus, - plusmn, - plussim, - plustwo, - pm, - Poincareplane, - pointint, - popf, - Popf, - pound, - prap, - Pr, - pr, - prcue, - precapprox, - prec, - preccurlyeq, - Precedes, - PrecedesEqual, - PrecedesSlantEqual, - PrecedesTilde, - preceq, - precnapprox, - precneqq, - precnsim, - pre, - prE, - precsim, - prime, - Prime, - primes, - prnap, - prnE, - prnsim, - prod, - Product, - profalar, - profline, - profsurf, - prop, - Proportional, - Proportion, - propto, - prsim, - prurel, - Pscr, - pscr, - Psi, - psi, - puncsp, - Qfr, - qfr, - qint, - qopf, - Qopf, - qprime, - Qscr, - qscr, - quaternions, - quatint, - quest, - questeq, - quot, - QUOT, - rAarr, - race, - Racute, - racute, - radic, - raemptyv, - rang, - Rang, - rangd, - range, - rangle, - raquo, - rarrap, - rarrb, - rarrbfs, - rarrc, - rarr, - Rarr, - rArr, - rarrfs, - rarrhk, - rarrlp, - rarrpl, - rarrsim, - Rarrtl, - rarrtl, - rarrw, - ratail, - rAtail, - ratio, - rationals, - rbarr, - rBarr, - RBarr, - rbbrk, - rbrace, - rbrack, - rbrke, - rbrksld, - rbrkslu, - Rcaron, - rcaron, - Rcedil, - rcedil, - rceil, - rcub, - Rcy, - rcy, - rdca, - rdldhar, - rdquo, - rdquor, - rdsh, - real, - realine, - realpart, - reals, - Re, - rect, - reg, - REG, - ReverseElement, - ReverseEquilibrium, - ReverseUpEquilibrium, - rfisht, - rfloor, - rfr, - Rfr, - rHar, - rhard, - rharu, - rharul, - Rho, - rho, - rhov, - RightAngleBracket, - RightArrowBar, - rightarrow, - RightArrow, - Rightarrow, - RightArrowLeftArrow, - rightarrowtail, - RightCeiling, - RightDoubleBracket, - RightDownTeeVector, - RightDownVectorBar, - RightDownVector, - RightFloor, - rightharpoondown, - rightharpoonup, - rightleftarrows, - rightleftharpoons, - rightrightarrows, - rightsquigarrow, - RightTeeArrow, - RightTee, - RightTeeVector, - rightthreetimes, - RightTriangleBar, - RightTriangle, - RightTriangleEqual, - RightUpDownVector, - RightUpTeeVector, - RightUpVectorBar, - RightUpVector, - RightVectorBar, - RightVector, - ring, - risingdotseq, - rlarr, - rlhar, - rlm, - rmoustache, - rmoust, - rnmid, - roang, - roarr, - robrk, - ropar, - ropf, - Ropf, - roplus, - rotimes, - RoundImplies, - rpar, - rpargt, - rppolint, - rrarr, - Rrightarrow, - rsaquo, - rscr, - Rscr, - rsh, - Rsh, - rsqb, - rsquo, - rsquor, - rthree, - rtimes, - rtri, - rtrie, - rtrif, - rtriltri, - RuleDelayed, - ruluhar, - rx, - Sacute, - sacute, - sbquo, - scap, - Scaron, - scaron, - Sc, - sc, - sccue, - sce, - scE, - Scedil, - scedil, - Scirc, - scirc, - scnap, - scnE, - scnsim, - scpolint, - scsim, - Scy, - scy, - sdotb, - sdot, - sdote, - searhk, - searr, - seArr, - searrow, - sect, - semi, - seswar, - setminus, - setmn, - sext, - Sfr, - sfr, - sfrown, - sharp, - SHCHcy, - shchcy, - SHcy, - shcy, - ShortDownArrow, - ShortLeftArrow, - shortmid, - shortparallel, - ShortRightArrow, - ShortUpArrow, - shy, - Sigma, - sigma, - sigmaf, - sigmav, - sim, - simdot, - sime, - simeq, - simg, - simgE, - siml, - simlE, - simne, - simplus, - simrarr, - slarr, - SmallCircle, - smallsetminus, - smashp, - smeparsl, - smid, - smile, - smt, - smte, - smtes, - SOFTcy, - softcy, - solbar, - solb, - sol, - Sopf, - sopf, - spades, - spadesuit, - spar, - sqcap, - sqcaps, - sqcup, - sqcups, - Sqrt, - sqsub, - sqsube, - sqsubset, - sqsubseteq, - sqsup, - sqsupe, - sqsupset, - sqsupseteq, - square, - Square, - SquareIntersection, - SquareSubset, - SquareSubsetEqual, - SquareSuperset, - SquareSupersetEqual, - SquareUnion, - squarf, - squ, - squf, - srarr, - Sscr, - sscr, - ssetmn, - ssmile, - sstarf, - Star, - star, - starf, - straightepsilon, - straightphi, - strns, - sub, - Sub, - subdot, - subE, - sube, - subedot, - submult, - subnE, - subne, - subplus, - subrarr, - subset, - Subset, - subseteq, - subseteqq, - SubsetEqual, - subsetneq, - subsetneqq, - subsim, - subsub, - subsup, - succapprox, - succ, - succcurlyeq, - Succeeds, - SucceedsEqual, - SucceedsSlantEqual, - SucceedsTilde, - succeq, - succnapprox, - succneqq, - succnsim, - succsim, - SuchThat, - sum, - Sum, - sung, - sup1, - sup2, - sup3, - sup, - Sup, - supdot, - supdsub, - supE, - supe, - supedot, - Superset, - SupersetEqual, - suphsol, - suphsub, - suplarr, - supmult, - supnE, - supne, - supplus, - supset, - Supset, - supseteq, - supseteqq, - supsetneq, - supsetneqq, - supsim, - supsub, - supsup, - swarhk, - swarr, - swArr, - swarrow, - swnwar, - szlig, - Tab: Tab$1, - target, - Tau, - tau, - tbrk, - Tcaron, - tcaron, - Tcedil, - tcedil, - Tcy, - tcy, - tdot, - telrec, - Tfr, - tfr, - there4, - therefore, - Therefore, - Theta, - theta, - thetasym, - thetav, - thickapprox, - thicksim, - ThickSpace, - ThinSpace, - thinsp, - thkap, - thksim, - THORN, - thorn, - tilde, - Tilde, - TildeEqual, - TildeFullEqual, - TildeTilde, - timesbar, - timesb, - times, - timesd, - tint, - toea, - topbot, - topcir, - top, - Topf, - topf, - topfork, - tosa, - tprime, - trade, - TRADE, - triangle, - triangledown, - triangleleft, - trianglelefteq, - triangleq, - triangleright, - trianglerighteq, - tridot, - trie, - triminus, - TripleDot, - triplus, - trisb, - tritime, - trpezium, - Tscr, - tscr, - TScy, - tscy, - TSHcy, - tshcy, - Tstrok, - tstrok, - twixt, - twoheadleftarrow, - twoheadrightarrow, - Uacute, - uacute, - uarr, - Uarr, - uArr, - Uarrocir, - Ubrcy, - ubrcy, - Ubreve, - ubreve, - Ucirc, - ucirc, - Ucy, - ucy, - udarr, - Udblac, - udblac, - udhar, - ufisht, - Ufr, - ufr, - Ugrave, - ugrave, - uHar, - uharl, - uharr, - uhblk, - ulcorn, - ulcorner, - ulcrop, - ultri, - Umacr, - umacr, - uml, - UnderBar, - UnderBrace, - UnderBracket, - UnderParenthesis, - Union, - UnionPlus, - Uogon, - uogon, - Uopf, - uopf, - UpArrowBar, - uparrow, - UpArrow, - Uparrow, - UpArrowDownArrow, - updownarrow, - UpDownArrow, - Updownarrow, - UpEquilibrium, - upharpoonleft, - upharpoonright, - uplus, - UpperLeftArrow, - UpperRightArrow, - upsi, - Upsi, - upsih, - Upsilon, - upsilon, - UpTeeArrow, - UpTee, - upuparrows, - urcorn, - urcorner, - urcrop, - Uring, - uring, - urtri, - Uscr, - uscr, - utdot, - Utilde, - utilde, - utri, - utrif, - uuarr, - Uuml, - uuml, - uwangle, - vangrt, - varepsilon, - varkappa, - varnothing, - varphi, - varpi, - varpropto, - varr, - vArr, - varrho, - varsigma, - varsubsetneq, - varsubsetneqq, - varsupsetneq, - varsupsetneqq, - vartheta, - vartriangleleft, - vartriangleright, - vBar, - Vbar, - vBarv, - Vcy, - vcy, - vdash, - vDash, - Vdash, - VDash, - Vdashl, - veebar, - vee, - Vee, - veeeq, - vellip, - verbar, - Verbar, - vert, - Vert, - VerticalBar, - VerticalLine, - VerticalSeparator, - VerticalTilde, - VeryThinSpace, - Vfr, - vfr, - vltri, - vnsub, - vnsup, - Vopf, - vopf, - vprop, - vrtri, - Vscr, - vscr, - vsubnE, - vsubne, - vsupnE, - vsupne, - Vvdash, - vzigzag, - Wcirc, - wcirc, - wedbar, - wedge, - Wedge, - wedgeq, - weierp, - Wfr, - wfr, - Wopf, - wopf, - wp, - wr, - wreath, - Wscr, - wscr, - xcap, - xcirc, - xcup, - xdtri, - Xfr, - xfr, - xharr, - xhArr, - Xi, - xi, - xlarr, - xlArr, - xmap, - xnis, - xodot, - Xopf, - xopf, - xoplus, - xotime, - xrarr, - xrArr, - Xscr, - xscr, - xsqcup, - xuplus, - xutri, - xvee, - xwedge, - Yacute, - yacute, - YAcy, - yacy, - Ycirc, - ycirc, - Ycy, - ycy, - yen, - Yfr, - yfr, - YIcy, - yicy, - Yopf, - yopf, - Yscr, - yscr, - YUcy, - yucy, - yuml, - Yuml, - Zacute, - zacute, - Zcaron, - zcaron, - Zcy, - zcy, - Zdot, - zdot, - zeetrf, - ZeroWidthSpace, - Zeta, - zeta, - zfr, - Zfr, - ZHcy, - zhcy, - zigrarr, - zopf, - Zopf, - Zscr, - zscr, - zwj, - zwnj - }; - var entities$1 = require$$0; - var regex$4 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; - var mdurl$1 = {}; - var encodeCache = {}; - function getEncodeCache(exclude) { - var i, - ch, - cache = encodeCache[exclude]; - if (cache) { - return cache; - } - cache = encodeCache[exclude] = []; - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - if (/^[0-9a-z]$/i.test(ch)) { - cache.push(ch); - } else { - cache.push("%" + ("0" + i.toString(16).toUpperCase()).slice(-2)); - } - } - for (i = 0; i < exclude.length; i++) { - cache[exclude.charCodeAt(i)] = exclude[i]; - } - return cache; - } - __name(getEncodeCache, "getEncodeCache"); - function encode$1(string, exclude, keepEscaped) { - var i, - l2, - code3, - nextCode, - cache, - result = ""; - if (typeof exclude !== "string") { - keepEscaped = exclude; - exclude = encode$1.defaultChars; - } - if (typeof keepEscaped === "undefined") { - keepEscaped = true; - } - cache = getEncodeCache(exclude); - for (i = 0, l2 = string.length; i < l2; i++) { - code3 = string.charCodeAt(i); - if (keepEscaped && code3 === 37 && i + 2 < l2) { - if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { - result += string.slice(i, i + 3); - i += 2; - continue; - } - } - if (code3 < 128) { - result += cache[code3]; - continue; - } - if (code3 >= 55296 && code3 <= 57343) { - if (code3 >= 55296 && code3 <= 56319 && i + 1 < l2) { - nextCode = string.charCodeAt(i + 1); - if (nextCode >= 56320 && nextCode <= 57343) { - result += encodeURIComponent(string[i] + string[i + 1]); - i++; - continue; - } - } - result += "%EF%BF%BD"; - continue; - } - result += encodeURIComponent(string[i]); - } - return result; - } - __name(encode$1, "encode$1"); - encode$1.defaultChars = ";/?:@&=+$,-_.!~*'()#"; - encode$1.componentChars = "-_.!~*'()"; - var encode_1 = encode$1; - var decodeCache = {}; - function getDecodeCache(exclude) { - var i, - ch, - cache = decodeCache[exclude]; - if (cache) { - return cache; - } - cache = decodeCache[exclude] = []; - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - cache.push(ch); - } - for (i = 0; i < exclude.length; i++) { - ch = exclude.charCodeAt(i); - cache[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2); - } - return cache; - } - __name(getDecodeCache, "getDecodeCache"); - function decode$1(string, exclude) { - var cache; - if (typeof exclude !== "string") { - exclude = decode$1.defaultChars; - } - cache = getDecodeCache(exclude); - return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { - var i, - l2, - b1, - b2, - b3, - b4, - chr, - result = ""; - for (i = 0, l2 = seq.length; i < l2; i += 3) { - b1 = parseInt(seq.slice(i + 1, i + 3), 16); - if (b1 < 128) { - result += cache[b1]; - continue; - } - if ((b1 & 224) === 192 && i + 3 < l2) { - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - if ((b2 & 192) === 128) { - chr = b1 << 6 & 1984 | b2 & 63; - if (chr < 128) { - result += "\uFFFD\uFFFD"; - } else { - result += String.fromCharCode(chr); - } - i += 3; - continue; - } - } - if ((b1 & 240) === 224 && i + 6 < l2) { - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - if ((b2 & 192) === 128 && (b3 & 192) === 128) { - chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63; - if (chr < 2048 || chr >= 55296 && chr <= 57343) { - result += "\uFFFD\uFFFD\uFFFD"; - } else { - result += String.fromCharCode(chr); - } - i += 6; - continue; - } - } - if ((b1 & 248) === 240 && i + 9 < l2) { - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - b4 = parseInt(seq.slice(i + 10, i + 12), 16); - if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) { - chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63; - if (chr < 65536 || chr > 1114111) { - result += "\uFFFD\uFFFD\uFFFD\uFFFD"; - } else { - chr -= 65536; - result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023)); - } - i += 9; - continue; - } - } - result += "\uFFFD"; - } - return result; - }); - } - __name(decode$1, "decode$1"); - decode$1.defaultChars = ";/?:@&=+$,#"; - decode$1.componentChars = ""; - var decode_1 = decode$1; - var format$1 = /* @__PURE__ */__name(function format(url) { - var result = ""; - result += url.protocol || ""; - result += url.slashes ? "//" : ""; - result += url.auth ? url.auth + "@" : ""; - if (url.hostname && url.hostname.indexOf(":") !== -1) { - result += "[" + url.hostname + "]"; - } else { - result += url.hostname || ""; - } - result += url.port ? ":" + url.port : ""; - result += url.pathname || ""; - result += url.search || ""; - result += url.hash || ""; - return result; - }, "format"); - function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.pathname = null; - } - __name(Url, "Url"); - var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - delims = ["<", ">", '"', "`", " ", "\r", "\n", " "], - unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims), - autoEscape = ["'"].concat(unwise), - nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape), - hostEndingChars = ["/", "?", "#"], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - hostlessProtocol = { - "javascript": true, - "javascript:": true - }, - slashedProtocol = { - "http": true, - "https": true, - "ftp": true, - "gopher": true, - "file": true, - "http:": true, - "https:": true, - "ftp:": true, - "gopher:": true, - "file:": true - }; - function urlParse(url, slashesDenoteHost) { - if (url && url instanceof Url) { - return url; - } - var u2 = new Url(); - u2.parse(url, slashesDenoteHost); - return u2; - } - __name(urlParse, "urlParse"); - Url.prototype.parse = function (url, slashesDenoteHost) { - var i, - l2, - lowerProto, - hec, - slashes, - rest = url; - rest = rest.trim(); - if (!slashesDenoteHost && url.split("#").length === 1) { - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - } - return this; - } - } - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - lowerProto = proto.toLowerCase(); - this.protocol = proto; - rest = rest.substr(proto.length); - } - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - slashes = rest.substr(0, 2) === "//"; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } - if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { - var hostEnd = -1; - for (i = 0; i < hostEndingChars.length; i++) { - hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - var auth, atSign; - if (hostEnd === -1) { - atSign = rest.lastIndexOf("@"); - } else { - atSign = rest.lastIndexOf("@", hostEnd); - } - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = auth; - } - hostEnd = -1; - for (i = 0; i < nonHostChars.length; i++) { - hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - if (hostEnd === -1) { - hostEnd = rest.length; - } - if (rest[hostEnd - 1] === ":") { - hostEnd--; - } - var host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - this.parseHost(host); - this.hostname = this.hostname || ""; - var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]"; - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (i = 0, l2 = hostparts.length; i < l2; i++) { - var part2 = hostparts[i]; - if (!part2) { - continue; - } - if (!part2.match(hostnamePartPattern)) { - var newpart = ""; - for (var j = 0, k2 = part2.length; j < k2; j++) { - if (part2.charCodeAt(j) > 127) { - newpart += "x"; - } else { - newpart += part2[j]; - } - } - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part2.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = notHost.join(".") + rest; - } - this.hostname = validParts.join("."); - break; - } - } - } - } - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ""; - } - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - } - } - var hash = rest.indexOf("#"); - if (hash !== -1) { - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf("?"); - if (qm !== -1) { - this.search = rest.substr(qm); - rest = rest.slice(0, qm); - } - if (rest) { - this.pathname = rest; - } - if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { - this.pathname = ""; - } - return this; - }; - Url.prototype.parseHost = function (host) { - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ":") { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); - } - if (host) { - this.hostname = host; - } - }; - var parse = urlParse; - mdurl$1.encode = encode_1; - mdurl$1.decode = decode_1; - mdurl$1.format = format$1; - mdurl$1.parse = parse; - var uc_micro = {}; - var regex$3 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var regex$2 = /[\0-\x1F\x7F-\x9F]/; - var regex$1 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; - var regex = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; - uc_micro.Any = regex$3; - uc_micro.Cc = regex$2; - uc_micro.Cf = regex$1; - uc_micro.P = regex$4; - uc_micro.Z = regex; - (function (exports) { - function _class2(obj) { - return Object.prototype.toString.call(obj); - } - __name(_class2, "_class"); - function isString2(obj) { - return _class2(obj) === "[object String]"; - } - __name(isString2, "isString"); - var _hasOwnProperty = Object.prototype.hasOwnProperty; - function has2(object, key) { - return _hasOwnProperty.call(object, key); - } - __name(has2, "has"); - function assign2(obj) { - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; - } - if (typeof source !== "object") { - throw new TypeError(source + "must be object"); - } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - return obj; - } - __name(assign2, "assign"); - function arrayReplaceAt2(src, pos, newElements) { - return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); - } - __name(arrayReplaceAt2, "arrayReplaceAt"); - function isValidEntityCode2(c2) { - if (c2 >= 55296 && c2 <= 57343) { - return false; - } - if (c2 >= 64976 && c2 <= 65007) { - return false; - } - if ((c2 & 65535) === 65535 || (c2 & 65535) === 65534) { - return false; - } - if (c2 >= 0 && c2 <= 8) { - return false; - } - if (c2 === 11) { - return false; - } - if (c2 >= 14 && c2 <= 31) { - return false; - } - if (c2 >= 127 && c2 <= 159) { - return false; - } - if (c2 > 1114111) { - return false; - } - return true; - } - __name(isValidEntityCode2, "isValidEntityCode"); - function fromCodePoint2(c2) { - if (c2 > 65535) { - c2 -= 65536; - var surrogate1 = 55296 + (c2 >> 10), - surrogate2 = 56320 + (c2 & 1023); - return String.fromCharCode(surrogate1, surrogate2); - } - return String.fromCharCode(c2); - } - __name(fromCodePoint2, "fromCodePoint"); - var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; - var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; - var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi"); - var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; - var entities2 = entities$1; - function replaceEntityPattern(match2, name2) { - var code3 = 0; - if (has2(entities2, name2)) { - return entities2[name2]; - } - if (name2.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name2)) { - code3 = name2[1].toLowerCase() === "x" ? parseInt(name2.slice(2), 16) : parseInt(name2.slice(1), 10); - if (isValidEntityCode2(code3)) { - return fromCodePoint2(code3); - } - } - return match2; - } - __name(replaceEntityPattern, "replaceEntityPattern"); - function unescapeMd(str) { - if (str.indexOf("\\") < 0) { - return str; - } - return str.replace(UNESCAPE_MD_RE, "$1"); - } - __name(unescapeMd, "unescapeMd"); - function unescapeAll2(str) { - if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) { - return str; - } - return str.replace(UNESCAPE_ALL_RE, function (match2, escaped, entity3) { - if (escaped) { - return escaped; - } - return replaceEntityPattern(match2, entity3); - }); - } - __name(unescapeAll2, "unescapeAll"); - var HTML_ESCAPE_TEST_RE = /[&<>"]/; - var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; - var HTML_REPLACEMENTS = { - "&": "&", - "<": "<", - ">": ">", - '"': """ - }; - function replaceUnsafeChar(ch) { - return HTML_REPLACEMENTS[ch]; - } - __name(replaceUnsafeChar, "replaceUnsafeChar"); - function escapeHtml2(str) { - if (HTML_ESCAPE_TEST_RE.test(str)) { - return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); - } - return str; - } - __name(escapeHtml2, "escapeHtml"); - var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; - function escapeRE2(str) { - return str.replace(REGEXP_ESCAPE_RE, "\\$&"); - } - __name(escapeRE2, "escapeRE"); - function isSpace2(code3) { - switch (code3) { - case 9: - case 32: - return true; - } - return false; - } - __name(isSpace2, "isSpace"); - function isWhiteSpace2(code3) { - if (code3 >= 8192 && code3 <= 8202) { - return true; - } - switch (code3) { - case 9: - case 10: - case 11: - case 12: - case 13: - case 32: - case 160: - case 5760: - case 8239: - case 8287: - case 12288: - return true; - } - return false; - } - __name(isWhiteSpace2, "isWhiteSpace"); - var UNICODE_PUNCT_RE = regex$4; - function isPunctChar2(ch) { - return UNICODE_PUNCT_RE.test(ch); - } - __name(isPunctChar2, "isPunctChar"); - function isMdAsciiPunct2(ch) { - switch (ch) { - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - case 44: - case 45: - case 46: - case 47: - case 58: - case 59: - case 60: - case 61: - case 62: - case 63: - case 64: - case 91: - case 92: - case 93: - case 94: - case 95: - case 96: - case 123: - case 124: - case 125: - case 126: - return true; - default: - return false; - } - } - __name(isMdAsciiPunct2, "isMdAsciiPunct"); - function normalizeReference2(str) { - str = str.trim().replace(/\s+/g, " "); - if ("\u1E9E".toLowerCase() === "\u1E7E") { - str = str.replace(/ẞ/g, "\xDF"); - } - return str.toLowerCase().toUpperCase(); - } - __name(normalizeReference2, "normalizeReference"); - exports.lib = {}; - exports.lib.mdurl = mdurl$1; - exports.lib.ucmicro = uc_micro; - exports.assign = assign2; - exports.isString = isString2; - exports.has = has2; - exports.unescapeMd = unescapeMd; - exports.unescapeAll = unescapeAll2; - exports.isValidEntityCode = isValidEntityCode2; - exports.fromCodePoint = fromCodePoint2; - exports.escapeHtml = escapeHtml2; - exports.arrayReplaceAt = arrayReplaceAt2; - exports.isSpace = isSpace2; - exports.isWhiteSpace = isWhiteSpace2; - exports.isMdAsciiPunct = isMdAsciiPunct2; - exports.isPunctChar = isPunctChar2; - exports.escapeRE = escapeRE2; - exports.normalizeReference = normalizeReference2; - })(utils$1); - var helpers$1 = {}; - var parse_link_label = /* @__PURE__ */__name(function parseLinkLabel(state2, start, disableNested) { - var level, - found, - marker2, - prevPos, - labelEnd = -1, - max = state2.posMax, - oldPos = state2.pos; - state2.pos = start + 1; - level = 1; - while (state2.pos < max) { - marker2 = state2.src.charCodeAt(state2.pos); - if (marker2 === 93) { - level--; - if (level === 0) { - found = true; - break; - } - } - prevPos = state2.pos; - state2.md.inline.skipToken(state2); - if (marker2 === 91) { - if (prevPos === state2.pos - 1) { - level++; - } else if (disableNested) { - state2.pos = oldPos; - return -1; - } - } - } - if (found) { - labelEnd = state2.pos; - } - state2.pos = oldPos; - return labelEnd; - }, "parseLinkLabel"); - var unescapeAll$2 = utils$1.unescapeAll; - var parse_link_destination = /* @__PURE__ */__name(function parseLinkDestination(str, pos, max) { - var code3, - level, - lines = 0, - start = pos, - result = { - ok: false, - pos: 0, - lines: 0, - str: "" - }; - if (str.charCodeAt(pos) === 60) { - pos++; - while (pos < max) { - code3 = str.charCodeAt(pos); - if (code3 === 10) { - return result; - } - if (code3 === 60) { - return result; - } - if (code3 === 62) { - result.pos = pos + 1; - result.str = unescapeAll$2(str.slice(start + 1, pos)); - result.ok = true; - return result; - } - if (code3 === 92 && pos + 1 < max) { - pos += 2; - continue; - } - pos++; - } - return result; - } - level = 0; - while (pos < max) { - code3 = str.charCodeAt(pos); - if (code3 === 32) { - break; - } - if (code3 < 32 || code3 === 127) { - break; - } - if (code3 === 92 && pos + 1 < max) { - if (str.charCodeAt(pos + 1) === 32) { - break; - } - pos += 2; - continue; - } - if (code3 === 40) { - level++; - if (level > 32) { - return result; - } - } - if (code3 === 41) { - if (level === 0) { - break; - } - level--; - } - pos++; - } - if (start === pos) { - return result; - } - if (level !== 0) { - return result; - } - result.str = unescapeAll$2(str.slice(start, pos)); - result.lines = lines; - result.pos = pos; - result.ok = true; - return result; - }, "parseLinkDestination"); - var unescapeAll$1 = utils$1.unescapeAll; - var parse_link_title = /* @__PURE__ */__name(function parseLinkTitle(str, pos, max) { - var code3, - marker2, - lines = 0, - start = pos, - result = { - ok: false, - pos: 0, - lines: 0, - str: "" - }; - if (pos >= max) { - return result; - } - marker2 = str.charCodeAt(pos); - if (marker2 !== 34 && marker2 !== 39 && marker2 !== 40) { - return result; - } - pos++; - if (marker2 === 40) { - marker2 = 41; - } - while (pos < max) { - code3 = str.charCodeAt(pos); - if (code3 === marker2) { - result.pos = pos + 1; - result.lines = lines; - result.str = unescapeAll$1(str.slice(start + 1, pos)); - result.ok = true; - return result; - } else if (code3 === 40 && marker2 === 41) { - return result; - } else if (code3 === 10) { - lines++; - } else if (code3 === 92 && pos + 1 < max) { - pos++; - if (str.charCodeAt(pos) === 10) { - lines++; - } - } - pos++; - } - return result; - }, "parseLinkTitle"); - helpers$1.parseLinkLabel = parse_link_label; - helpers$1.parseLinkDestination = parse_link_destination; - helpers$1.parseLinkTitle = parse_link_title; - var assign$1 = utils$1.assign; - var unescapeAll = utils$1.unescapeAll; - var escapeHtml = utils$1.escapeHtml; - var default_rules = {}; - default_rules.code_inline = function (tokens, idx, options, env, slf) { - var token2 = tokens[idx]; - return "" + escapeHtml(tokens[idx].content) + ""; - }; - default_rules.code_block = function (tokens, idx, options, env, slf) { - var token2 = tokens[idx]; - return "" + escapeHtml(tokens[idx].content) + "\n"; - }; - default_rules.fence = function (tokens, idx, options, env, slf) { - var token2 = tokens[idx], - info2 = token2.info ? unescapeAll(token2.info).trim() : "", - langName = "", - langAttrs = "", - highlighted, - i, - arr, - tmpAttrs, - tmpToken; - if (info2) { - arr = info2.split(/(\s+)/g); - langName = arr[0]; - langAttrs = arr.slice(2).join(""); - } - if (options.highlight) { - highlighted = options.highlight(token2.content, langName, langAttrs) || escapeHtml(token2.content); - } else { - highlighted = escapeHtml(token2.content); - } - if (highlighted.indexOf("" + highlighted + "\n"; - } - return "
" + highlighted + "
\n"; - }; - default_rules.image = function (tokens, idx, options, env, slf) { - var token2 = tokens[idx]; - token2.attrs[token2.attrIndex("alt")][1] = slf.renderInlineAsText(token2.children, options, env); - return slf.renderToken(tokens, idx, options); - }; - default_rules.hardbreak = function (tokens, idx, options) { - return options.xhtmlOut ? "
\n" : "
\n"; - }; - default_rules.softbreak = function (tokens, idx, options) { - return options.breaks ? options.xhtmlOut ? "
\n" : "
\n" : "\n"; - }; - default_rules.text = function (tokens, idx) { - return escapeHtml(tokens[idx].content); - }; - default_rules.html_block = function (tokens, idx) { - return tokens[idx].content; - }; - default_rules.html_inline = function (tokens, idx) { - return tokens[idx].content; - }; - function Renderer$1() { - this.rules = assign$1({}, default_rules); - } - __name(Renderer$1, "Renderer$1"); - Renderer$1.prototype.renderAttrs = /* @__PURE__ */__name(function renderAttrs(token2) { - var i, l2, result; - if (!token2.attrs) { - return ""; - } - result = ""; - for (i = 0, l2 = token2.attrs.length; i < l2; i++) { - result += " " + escapeHtml(token2.attrs[i][0]) + '="' + escapeHtml(token2.attrs[i][1]) + '"'; - } - return result; - }, "renderAttrs"); - Renderer$1.prototype.renderToken = /* @__PURE__ */__name(function renderToken(tokens, idx, options) { - var nextToken, - result = "", - needLf = false, - token2 = tokens[idx]; - if (token2.hidden) { - return ""; - } - if (token2.block && token2.nesting !== -1 && idx && tokens[idx - 1].hidden) { - result += "\n"; - } - result += (token2.nesting === -1 ? "\n" : ">"; - return result; - }, "renderToken"); - Renderer$1.prototype.renderInline = function (tokens, options, env) { - var type2, - result = "", - rules = this.rules; - for (var i = 0, len = tokens.length; i < len; i++) { - type2 = tokens[i].type; - if (typeof rules[type2] !== "undefined") { - result += rules[type2](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options); - } - } - return result; - }; - Renderer$1.prototype.renderInlineAsText = function (tokens, options, env) { - var result = ""; - for (var i = 0, len = tokens.length; i < len; i++) { - if (tokens[i].type === "text") { - result += tokens[i].content; - } else if (tokens[i].type === "image") { - result += this.renderInlineAsText(tokens[i].children, options, env); - } else if (tokens[i].type === "softbreak") { - result += "\n"; - } - } - return result; - }; - Renderer$1.prototype.render = function (tokens, options, env) { - var i, - len, - type2, - result = "", - rules = this.rules; - for (i = 0, len = tokens.length; i < len; i++) { - type2 = tokens[i].type; - if (type2 === "inline") { - result += this.renderInline(tokens[i].children, options, env); - } else if (typeof rules[type2] !== "undefined") { - result += rules[tokens[i].type](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options, env); - } - } - return result; - }; - var renderer = Renderer$1; - function Ruler$3() { - this.__rules__ = []; - this.__cache__ = null; - } - __name(Ruler$3, "Ruler$3"); - Ruler$3.prototype.__find__ = function (name2) { - for (var i = 0; i < this.__rules__.length; i++) { - if (this.__rules__[i].name === name2) { - return i; - } - } - return -1; - }; - Ruler$3.prototype.__compile__ = function () { - var self2 = this; - var chains = [""]; - self2.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - rule.alt.forEach(function (altName) { - if (chains.indexOf(altName) < 0) { - chains.push(altName); - } - }); - }); - self2.__cache__ = {}; - chains.forEach(function (chain) { - self2.__cache__[chain] = []; - self2.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - if (chain && rule.alt.indexOf(chain) < 0) { - return; - } - self2.__cache__[chain].push(rule.fn); - }); - }); - }; - Ruler$3.prototype.at = function (name2, fn, options) { - var index = this.__find__(name2); - var opt2 = options || {}; - if (index === -1) { - throw new Error("Parser rule not found: " + name2); - } - this.__rules__[index].fn = fn; - this.__rules__[index].alt = opt2.alt || []; - this.__cache__ = null; - }; - Ruler$3.prototype.before = function (beforeName, ruleName, fn, options) { - var index = this.__find__(beforeName); - var opt2 = options || {}; - if (index === -1) { - throw new Error("Parser rule not found: " + beforeName); - } - this.__rules__.splice(index, 0, { - name: ruleName, - enabled: true, - fn, - alt: opt2.alt || [] - }); - this.__cache__ = null; - }; - Ruler$3.prototype.after = function (afterName, ruleName, fn, options) { - var index = this.__find__(afterName); - var opt2 = options || {}; - if (index === -1) { - throw new Error("Parser rule not found: " + afterName); - } - this.__rules__.splice(index + 1, 0, { - name: ruleName, - enabled: true, - fn, - alt: opt2.alt || [] - }); - this.__cache__ = null; - }; - Ruler$3.prototype.push = function (ruleName, fn, options) { - var opt2 = options || {}; - this.__rules__.push({ - name: ruleName, - enabled: true, - fn, - alt: opt2.alt || [] - }); - this.__cache__ = null; - }; - Ruler$3.prototype.enable = function (list3, ignoreInvalid) { - if (!Array.isArray(list3)) { - list3 = [list3]; - } - var result = []; - list3.forEach(function (name2) { - var idx = this.__find__(name2); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error("Rules manager: invalid rule name " + name2); - } - this.__rules__[idx].enabled = true; - result.push(name2); - }, this); - this.__cache__ = null; - return result; - }; - Ruler$3.prototype.enableOnly = function (list3, ignoreInvalid) { - if (!Array.isArray(list3)) { - list3 = [list3]; - } - this.__rules__.forEach(function (rule) { - rule.enabled = false; - }); - this.enable(list3, ignoreInvalid); - }; - Ruler$3.prototype.disable = function (list3, ignoreInvalid) { - if (!Array.isArray(list3)) { - list3 = [list3]; - } - var result = []; - list3.forEach(function (name2) { - var idx = this.__find__(name2); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error("Rules manager: invalid rule name " + name2); - } - this.__rules__[idx].enabled = false; - result.push(name2); - }, this); - this.__cache__ = null; - return result; - }; - Ruler$3.prototype.getRules = function (chainName) { - if (this.__cache__ === null) { - this.__compile__(); - } - return this.__cache__[chainName] || []; - }; - var ruler = Ruler$3; - var NEWLINES_RE = /\r\n?|\n/g; - var NULL_RE = /\0/g; - var normalize = /* @__PURE__ */__name(function normalize2(state2) { - var str; - str = state2.src.replace(NEWLINES_RE, "\n"); - str = str.replace(NULL_RE, "\uFFFD"); - state2.src = str; - }, "normalize"); - var block = /* @__PURE__ */__name(function block2(state2) { - var token2; - if (state2.inlineMode) { - token2 = new state2.Token("inline", "", 0); - token2.content = state2.src; - token2.map = [0, 1]; - token2.children = []; - state2.tokens.push(token2); - } else { - state2.md.block.parse(state2.src, state2.md, state2.env, state2.tokens); - } - }, "block"); - var inline = /* @__PURE__ */__name(function inline2(state2) { - var tokens = state2.tokens, - tok, - i, - l2; - for (i = 0, l2 = tokens.length; i < l2; i++) { - tok = tokens[i]; - if (tok.type === "inline") { - state2.md.inline.parse(tok.content, state2.md, state2.env, tok.children); - } - } - }, "inline"); - var arrayReplaceAt = utils$1.arrayReplaceAt; - function isLinkOpen(str) { - return /^\s]/i.test(str); - } - __name(isLinkOpen, "isLinkOpen"); - function isLinkClose(str) { - return /^<\/a\s*>/i.test(str); - } - __name(isLinkClose, "isLinkClose"); - var linkify = /* @__PURE__ */__name(function linkify2(state2) { - var i, - j, - l2, - tokens, - token2, - currentToken, - nodes, - ln, - text3, - pos, - lastPos, - level, - htmlLinkLevel, - url, - fullUrl, - urlText, - blockTokens = state2.tokens, - links; - if (!state2.md.options.linkify) { - return; - } - for (j = 0, l2 = blockTokens.length; j < l2; j++) { - if (blockTokens[j].type !== "inline" || !state2.md.linkify.pretest(blockTokens[j].content)) { - continue; - } - tokens = blockTokens[j].children; - htmlLinkLevel = 0; - for (i = tokens.length - 1; i >= 0; i--) { - currentToken = tokens[i]; - if (currentToken.type === "link_close") { - i--; - while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") { - i--; - } - continue; - } - if (currentToken.type === "html_inline") { - if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) { - htmlLinkLevel--; - } - if (isLinkClose(currentToken.content)) { - htmlLinkLevel++; - } - } - if (htmlLinkLevel > 0) { - continue; - } - if (currentToken.type === "text" && state2.md.linkify.test(currentToken.content)) { - text3 = currentToken.content; - links = state2.md.linkify.match(text3); - nodes = []; - level = currentToken.level; - lastPos = 0; - for (ln = 0; ln < links.length; ln++) { - url = links[ln].url; - fullUrl = state2.md.normalizeLink(url); - if (!state2.md.validateLink(fullUrl)) { - continue; - } - urlText = links[ln].text; - if (!links[ln].schema) { - urlText = state2.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, ""); - } else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) { - urlText = state2.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, ""); - } else { - urlText = state2.md.normalizeLinkText(urlText); - } - pos = links[ln].index; - if (pos > lastPos) { - token2 = new state2.Token("text", "", 0); - token2.content = text3.slice(lastPos, pos); - token2.level = level; - nodes.push(token2); - } - token2 = new state2.Token("link_open", "a", 1); - token2.attrs = [["href", fullUrl]]; - token2.level = level++; - token2.markup = "linkify"; - token2.info = "auto"; - nodes.push(token2); - token2 = new state2.Token("text", "", 0); - token2.content = urlText; - token2.level = level; - nodes.push(token2); - token2 = new state2.Token("link_close", "a", -1); - token2.level = --level; - token2.markup = "linkify"; - token2.info = "auto"; - nodes.push(token2); - lastPos = links[ln].lastIndex; - } - if (lastPos < text3.length) { - token2 = new state2.Token("text", "", 0); - token2.content = text3.slice(lastPos); - token2.level = level; - nodes.push(token2); - } - blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); - } - } - } - }, "linkify"); - var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; - var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i; - var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig; - var SCOPED_ABBR = { - c: "\xA9", - r: "\xAE", - p: "\xA7", - tm: "\u2122" - }; - function replaceFn(match2, name2) { - return SCOPED_ABBR[name2.toLowerCase()]; - } - __name(replaceFn, "replaceFn"); - function replace_scoped(inlineTokens) { - var i, - token2, - inside_autolink = 0; - for (i = inlineTokens.length - 1; i >= 0; i--) { - token2 = inlineTokens[i]; - if (token2.type === "text" && !inside_autolink) { - token2.content = token2.content.replace(SCOPED_ABBR_RE, replaceFn); - } - if (token2.type === "link_open" && token2.info === "auto") { - inside_autolink--; - } - if (token2.type === "link_close" && token2.info === "auto") { - inside_autolink++; - } - } - } - __name(replace_scoped, "replace_scoped"); - function replace_rare(inlineTokens) { - var i, - token2, - inside_autolink = 0; - for (i = inlineTokens.length - 1; i >= 0; i--) { - token2 = inlineTokens[i]; - if (token2.type === "text" && !inside_autolink) { - if (RARE_RE.test(token2.content)) { - token2.content = token2.content.replace(/\+-/g, "\xB1").replace(/\.{2,}/g, "\u2026").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1\u2014").replace(/(^|\s)--(?=\s|$)/mg, "$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1\u2013"); - } - } - if (token2.type === "link_open" && token2.info === "auto") { - inside_autolink--; - } - if (token2.type === "link_close" && token2.info === "auto") { - inside_autolink++; - } - } - } - __name(replace_rare, "replace_rare"); - var replacements = /* @__PURE__ */__name(function replace(state2) { - var blkIdx; - if (!state2.md.options.typographer) { - return; - } - for (blkIdx = state2.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state2.tokens[blkIdx].type !== "inline") { - continue; - } - if (SCOPED_ABBR_TEST_RE.test(state2.tokens[blkIdx].content)) { - replace_scoped(state2.tokens[blkIdx].children); - } - if (RARE_RE.test(state2.tokens[blkIdx].content)) { - replace_rare(state2.tokens[blkIdx].children); - } - } - }, "replace"); - var isWhiteSpace$1 = utils$1.isWhiteSpace; - var isPunctChar$1 = utils$1.isPunctChar; - var isMdAsciiPunct$1 = utils$1.isMdAsciiPunct; - var QUOTE_TEST_RE = /['"]/; - var QUOTE_RE = /['"]/g; - var APOSTROPHE = "\u2019"; - function replaceAt(str, index, ch) { - return str.substr(0, index) + ch + str.substr(index + 1); - } - __name(replaceAt, "replaceAt"); - function process_inlines(tokens, state2) { - var i, token2, text3, t2, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j, isSingle, stack, openQuote, closeQuote; - stack = []; - for (i = 0; i < tokens.length; i++) { - token2 = tokens[i]; - thisLevel = tokens[i].level; - for (j = stack.length - 1; j >= 0; j--) { - if (stack[j].level <= thisLevel) { - break; - } - } - stack.length = j + 1; - if (token2.type !== "text") { - continue; - } - text3 = token2.content; - pos = 0; - max = text3.length; - OUTER: while (pos < max) { - QUOTE_RE.lastIndex = pos; - t2 = QUOTE_RE.exec(text3); - if (!t2) { - break; - } - canOpen = canClose = true; - pos = t2.index + 1; - isSingle = t2[0] === "'"; - lastChar = 32; - if (t2.index - 1 >= 0) { - lastChar = text3.charCodeAt(t2.index - 1); - } else { - for (j = i - 1; j >= 0; j--) { - if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break; - if (!tokens[j].content) continue; - lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); - break; - } - } - nextChar = 32; - if (pos < max) { - nextChar = text3.charCodeAt(pos); - } else { - for (j = i + 1; j < tokens.length; j++) { - if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break; - if (!tokens[j].content) continue; - nextChar = tokens[j].content.charCodeAt(0); - break; - } - } - isLastPunctChar = isMdAsciiPunct$1(lastChar) || isPunctChar$1(String.fromCharCode(lastChar)); - isNextPunctChar = isMdAsciiPunct$1(nextChar) || isPunctChar$1(String.fromCharCode(nextChar)); - isLastWhiteSpace = isWhiteSpace$1(lastChar); - isNextWhiteSpace = isWhiteSpace$1(nextChar); - if (isNextWhiteSpace) { - canOpen = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - canOpen = false; - } - } - if (isLastWhiteSpace) { - canClose = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - canClose = false; - } - } - if (nextChar === 34 && t2[0] === '"') { - if (lastChar >= 48 && lastChar <= 57) { - canClose = canOpen = false; - } - } - if (canOpen && canClose) { - canOpen = isLastPunctChar; - canClose = isNextPunctChar; - } - if (!canOpen && !canClose) { - if (isSingle) { - token2.content = replaceAt(token2.content, t2.index, APOSTROPHE); - } - continue; - } - if (canClose) { - for (j = stack.length - 1; j >= 0; j--) { - item = stack[j]; - if (stack[j].level < thisLevel) { - break; - } - if (item.single === isSingle && stack[j].level === thisLevel) { - item = stack[j]; - if (isSingle) { - openQuote = state2.md.options.quotes[2]; - closeQuote = state2.md.options.quotes[3]; - } else { - openQuote = state2.md.options.quotes[0]; - closeQuote = state2.md.options.quotes[1]; - } - token2.content = replaceAt(token2.content, t2.index, closeQuote); - tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); - pos += closeQuote.length - 1; - if (item.token === i) { - pos += openQuote.length - 1; - } - text3 = token2.content; - max = text3.length; - stack.length = j; - continue OUTER; - } - } - } - if (canOpen) { - stack.push({ - token: i, - pos: t2.index, - single: isSingle, - level: thisLevel - }); - } else if (canClose && isSingle) { - token2.content = replaceAt(token2.content, t2.index, APOSTROPHE); - } - } - } - } - __name(process_inlines, "process_inlines"); - var smartquotes = /* @__PURE__ */__name(function smartquotes2(state2) { - var blkIdx; - if (!state2.md.options.typographer) { - return; - } - for (blkIdx = state2.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state2.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state2.tokens[blkIdx].content)) { - continue; - } - process_inlines(state2.tokens[blkIdx].children, state2); - } - }, "smartquotes"); - function Token$3(type2, tag, nesting) { - this.type = type2; - this.tag = tag; - this.attrs = null; - this.map = null; - this.nesting = nesting; - this.level = 0; - this.children = null; - this.content = ""; - this.markup = ""; - this.info = ""; - this.meta = null; - this.block = false; - this.hidden = false; - } - __name(Token$3, "Token$3"); - Token$3.prototype.attrIndex = /* @__PURE__ */__name(function attrIndex(name2) { - var attrs, i, len; - if (!this.attrs) { - return -1; - } - attrs = this.attrs; - for (i = 0, len = attrs.length; i < len; i++) { - if (attrs[i][0] === name2) { - return i; - } - } - return -1; - }, "attrIndex"); - Token$3.prototype.attrPush = /* @__PURE__ */__name(function attrPush(attrData) { - if (this.attrs) { - this.attrs.push(attrData); - } else { - this.attrs = [attrData]; - } - }, "attrPush"); - Token$3.prototype.attrSet = /* @__PURE__ */__name(function attrSet(name2, value3) { - var idx = this.attrIndex(name2), - attrData = [name2, value3]; - if (idx < 0) { - this.attrPush(attrData); - } else { - this.attrs[idx] = attrData; - } - }, "attrSet"); - Token$3.prototype.attrGet = /* @__PURE__ */__name(function attrGet(name2) { - var idx = this.attrIndex(name2), - value3 = null; - if (idx >= 0) { - value3 = this.attrs[idx][1]; - } - return value3; - }, "attrGet"); - Token$3.prototype.attrJoin = /* @__PURE__ */__name(function attrJoin(name2, value3) { - var idx = this.attrIndex(name2); - if (idx < 0) { - this.attrPush([name2, value3]); - } else { - this.attrs[idx][1] = this.attrs[idx][1] + " " + value3; - } - }, "attrJoin"); - var token = Token$3; - var Token$2 = token; - function StateCore(src, md, env) { - this.src = src; - this.env = env; - this.tokens = []; - this.inlineMode = false; - this.md = md; - } - __name(StateCore, "StateCore"); - StateCore.prototype.Token = Token$2; - var state_core = StateCore; - var Ruler$2 = ruler; - var _rules$2 = [["normalize", normalize], ["block", block], ["inline", inline], ["linkify", linkify], ["replacements", replacements], ["smartquotes", smartquotes]]; - function Core() { - this.ruler = new Ruler$2(); - for (var i = 0; i < _rules$2.length; i++) { - this.ruler.push(_rules$2[i][0], _rules$2[i][1]); - } - } - __name(Core, "Core"); - Core.prototype.process = function (state2) { - var i, l2, rules; - rules = this.ruler.getRules(""); - for (i = 0, l2 = rules.length; i < l2; i++) { - rules[i](state2); - } - }; - Core.prototype.State = state_core; - var parser_core = Core; - var isSpace$a = utils$1.isSpace; - function getLine(state2, line) { - var pos = state2.bMarks[line] + state2.tShift[line], - max = state2.eMarks[line]; - return state2.src.substr(pos, max - pos); - } - __name(getLine, "getLine"); - function escapedSplit(str) { - var result = [], - pos = 0, - max = str.length, - ch, - isEscaped = false, - lastPos = 0, - current = ""; - ch = str.charCodeAt(pos); - while (pos < max) { - if (ch === 124) { - if (!isEscaped) { - result.push(current + str.substring(lastPos, pos)); - current = ""; - lastPos = pos + 1; - } else { - current += str.substring(lastPos, pos - 1); - lastPos = pos; - } - } - isEscaped = ch === 92; - pos++; - ch = str.charCodeAt(pos); - } - result.push(current + str.substring(lastPos)); - return result; - } - __name(escapedSplit, "escapedSplit"); - var table = /* @__PURE__ */__name(function table2(state2, startLine, endLine, silent) { - var ch, lineText, pos, i, l2, nextLine, columns, columnCount, token2, aligns, t2, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh; - if (startLine + 2 > endLine) { - return false; - } - nextLine = startLine + 1; - if (state2.sCount[nextLine] < state2.blkIndent) { - return false; - } - if (state2.sCount[nextLine] - state2.blkIndent >= 4) { - return false; - } - pos = state2.bMarks[nextLine] + state2.tShift[nextLine]; - if (pos >= state2.eMarks[nextLine]) { - return false; - } - firstCh = state2.src.charCodeAt(pos++); - if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) { - return false; - } - if (pos >= state2.eMarks[nextLine]) { - return false; - } - secondCh = state2.src.charCodeAt(pos++); - if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace$a(secondCh)) { - return false; - } - if (firstCh === 45 && isSpace$a(secondCh)) { - return false; - } - while (pos < state2.eMarks[nextLine]) { - ch = state2.src.charCodeAt(pos); - if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace$a(ch)) { - return false; - } - pos++; - } - lineText = getLine(state2, startLine + 1); - columns = lineText.split("|"); - aligns = []; - for (i = 0; i < columns.length; i++) { - t2 = columns[i].trim(); - if (!t2) { - if (i === 0 || i === columns.length - 1) { - continue; - } else { - return false; - } - } - if (!/^:?-+:?$/.test(t2)) { - return false; - } - if (t2.charCodeAt(t2.length - 1) === 58) { - aligns.push(t2.charCodeAt(0) === 58 ? "center" : "right"); - } else if (t2.charCodeAt(0) === 58) { - aligns.push("left"); - } else { - aligns.push(""); - } - } - lineText = getLine(state2, startLine).trim(); - if (lineText.indexOf("|") === -1) { - return false; - } - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === "") columns.shift(); - if (columns.length && columns[columns.length - 1] === "") columns.pop(); - columnCount = columns.length; - if (columnCount === 0 || columnCount !== aligns.length) { - return false; - } - if (silent) { - return true; - } - oldParentType = state2.parentType; - state2.parentType = "table"; - terminatorRules = state2.md.block.ruler.getRules("blockquote"); - token2 = state2.push("table_open", "table", 1); - token2.map = tableLines = [startLine, 0]; - token2 = state2.push("thead_open", "thead", 1); - token2.map = [startLine, startLine + 1]; - token2 = state2.push("tr_open", "tr", 1); - token2.map = [startLine, startLine + 1]; - for (i = 0; i < columns.length; i++) { - token2 = state2.push("th_open", "th", 1); - if (aligns[i]) { - token2.attrs = [["style", "text-align:" + aligns[i]]]; - } - token2 = state2.push("inline", "", 0); - token2.content = columns[i].trim(); - token2.children = []; - token2 = state2.push("th_close", "th", -1); - } - token2 = state2.push("tr_close", "tr", -1); - token2 = state2.push("thead_close", "thead", -1); - for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { - if (state2.sCount[nextLine] < state2.blkIndent) { - break; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - lineText = getLine(state2, nextLine).trim(); - if (!lineText) { - break; - } - if (state2.sCount[nextLine] - state2.blkIndent >= 4) { - break; - } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === "") columns.shift(); - if (columns.length && columns[columns.length - 1] === "") columns.pop(); - if (nextLine === startLine + 2) { - token2 = state2.push("tbody_open", "tbody", 1); - token2.map = tbodyLines = [startLine + 2, 0]; - } - token2 = state2.push("tr_open", "tr", 1); - token2.map = [nextLine, nextLine + 1]; - for (i = 0; i < columnCount; i++) { - token2 = state2.push("td_open", "td", 1); - if (aligns[i]) { - token2.attrs = [["style", "text-align:" + aligns[i]]]; - } - token2 = state2.push("inline", "", 0); - token2.content = columns[i] ? columns[i].trim() : ""; - token2.children = []; - token2 = state2.push("td_close", "td", -1); - } - token2 = state2.push("tr_close", "tr", -1); - } - if (tbodyLines) { - token2 = state2.push("tbody_close", "tbody", -1); - tbodyLines[1] = nextLine; - } - token2 = state2.push("table_close", "table", -1); - tableLines[1] = nextLine; - state2.parentType = oldParentType; - state2.line = nextLine; - return true; - }, "table"); - var code = /* @__PURE__ */__name(function code2(state2, startLine, endLine) { - var nextLine, last, token2; - if (state2.sCount[startLine] - state2.blkIndent < 4) { - return false; - } - last = nextLine = startLine + 1; - while (nextLine < endLine) { - if (state2.isEmpty(nextLine)) { - nextLine++; - continue; - } - if (state2.sCount[nextLine] - state2.blkIndent >= 4) { - nextLine++; - last = nextLine; - continue; - } - break; - } - state2.line = last; - token2 = state2.push("code_block", "code", 0); - token2.content = state2.getLines(startLine, last, 4 + state2.blkIndent, false) + "\n"; - token2.map = [startLine, state2.line]; - return true; - }, "code"); - var fence = /* @__PURE__ */__name(function fence2(state2, startLine, endLine, silent) { - var marker2, - len, - params, - nextLine, - mem, - token2, - markup, - haveEndMarker = false, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine]; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - if (pos + 3 > max) { - return false; - } - marker2 = state2.src.charCodeAt(pos); - if (marker2 !== 126 && marker2 !== 96) { - return false; - } - mem = pos; - pos = state2.skipChars(pos, marker2); - len = pos - mem; - if (len < 3) { - return false; - } - markup = state2.src.slice(mem, pos); - params = state2.src.slice(pos, max); - if (marker2 === 96) { - if (params.indexOf(String.fromCharCode(marker2)) >= 0) { - return false; - } - } - if (silent) { - return true; - } - nextLine = startLine; - for (;;) { - nextLine++; - if (nextLine >= endLine) { - break; - } - pos = mem = state2.bMarks[nextLine] + state2.tShift[nextLine]; - max = state2.eMarks[nextLine]; - if (pos < max && state2.sCount[nextLine] < state2.blkIndent) { - break; - } - if (state2.src.charCodeAt(pos) !== marker2) { - continue; - } - if (state2.sCount[nextLine] - state2.blkIndent >= 4) { - continue; - } - pos = state2.skipChars(pos, marker2); - if (pos - mem < len) { - continue; - } - pos = state2.skipSpaces(pos); - if (pos < max) { - continue; - } - haveEndMarker = true; - break; - } - len = state2.sCount[startLine]; - state2.line = nextLine + (haveEndMarker ? 1 : 0); - token2 = state2.push("fence", "code", 0); - token2.info = params; - token2.content = state2.getLines(startLine + 1, nextLine, len, true); - token2.markup = markup; - token2.map = [startLine, state2.line]; - return true; - }, "fence"); - var isSpace$9 = utils$1.isSpace; - var blockquote = /* @__PURE__ */__name(function blockquote2(state2, startLine, endLine, silent) { - var adjustTab, - ch, - i, - initial, - l2, - lastLineEmpty, - lines, - nextLine, - offset, - oldBMarks, - oldBSCount, - oldIndent, - oldParentType, - oldSCount, - oldTShift, - spaceAfterMarker, - terminate, - terminatorRules, - token2, - isOutdented, - oldLineMax = state2.lineMax, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine]; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - if (state2.src.charCodeAt(pos++) !== 62) { - return false; - } - if (silent) { - return true; - } - initial = offset = state2.sCount[startLine] + 1; - if (state2.src.charCodeAt(pos) === 32) { - pos++; - initial++; - offset++; - adjustTab = false; - spaceAfterMarker = true; - } else if (state2.src.charCodeAt(pos) === 9) { - spaceAfterMarker = true; - if ((state2.bsCount[startLine] + offset) % 4 === 3) { - pos++; - initial++; - offset++; - adjustTab = false; - } else { - adjustTab = true; - } - } else { - spaceAfterMarker = false; - } - oldBMarks = [state2.bMarks[startLine]]; - state2.bMarks[startLine] = pos; - while (pos < max) { - ch = state2.src.charCodeAt(pos); - if (isSpace$9(ch)) { - if (ch === 9) { - offset += 4 - (offset + state2.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4; - } else { - offset++; - } - } else { - break; - } - pos++; - } - oldBSCount = [state2.bsCount[startLine]]; - state2.bsCount[startLine] = state2.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0); - lastLineEmpty = pos >= max; - oldSCount = [state2.sCount[startLine]]; - state2.sCount[startLine] = offset - initial; - oldTShift = [state2.tShift[startLine]]; - state2.tShift[startLine] = pos - state2.bMarks[startLine]; - terminatorRules = state2.md.block.ruler.getRules("blockquote"); - oldParentType = state2.parentType; - state2.parentType = "blockquote"; - for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { - isOutdented = state2.sCount[nextLine] < state2.blkIndent; - pos = state2.bMarks[nextLine] + state2.tShift[nextLine]; - max = state2.eMarks[nextLine]; - if (pos >= max) { - break; - } - if (state2.src.charCodeAt(pos++) === 62 && !isOutdented) { - initial = offset = state2.sCount[nextLine] + 1; - if (state2.src.charCodeAt(pos) === 32) { - pos++; - initial++; - offset++; - adjustTab = false; - spaceAfterMarker = true; - } else if (state2.src.charCodeAt(pos) === 9) { - spaceAfterMarker = true; - if ((state2.bsCount[nextLine] + offset) % 4 === 3) { - pos++; - initial++; - offset++; - adjustTab = false; - } else { - adjustTab = true; - } - } else { - spaceAfterMarker = false; - } - oldBMarks.push(state2.bMarks[nextLine]); - state2.bMarks[nextLine] = pos; - while (pos < max) { - ch = state2.src.charCodeAt(pos); - if (isSpace$9(ch)) { - if (ch === 9) { - offset += 4 - (offset + state2.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; - } else { - offset++; - } - } else { - break; - } - pos++; - } - lastLineEmpty = pos >= max; - oldBSCount.push(state2.bsCount[nextLine]); - state2.bsCount[nextLine] = state2.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); - oldSCount.push(state2.sCount[nextLine]); - state2.sCount[nextLine] = offset - initial; - oldTShift.push(state2.tShift[nextLine]); - state2.tShift[nextLine] = pos - state2.bMarks[nextLine]; - continue; - } - if (lastLineEmpty) { - break; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - state2.lineMax = nextLine; - if (state2.blkIndent !== 0) { - oldBMarks.push(state2.bMarks[nextLine]); - oldBSCount.push(state2.bsCount[nextLine]); - oldTShift.push(state2.tShift[nextLine]); - oldSCount.push(state2.sCount[nextLine]); - state2.sCount[nextLine] -= state2.blkIndent; - } - break; - } - oldBMarks.push(state2.bMarks[nextLine]); - oldBSCount.push(state2.bsCount[nextLine]); - oldTShift.push(state2.tShift[nextLine]); - oldSCount.push(state2.sCount[nextLine]); - state2.sCount[nextLine] = -1; - } - oldIndent = state2.blkIndent; - state2.blkIndent = 0; - token2 = state2.push("blockquote_open", "blockquote", 1); - token2.markup = ">"; - token2.map = lines = [startLine, 0]; - state2.md.block.tokenize(state2, startLine, nextLine); - token2 = state2.push("blockquote_close", "blockquote", -1); - token2.markup = ">"; - state2.lineMax = oldLineMax; - state2.parentType = oldParentType; - lines[1] = state2.line; - for (i = 0; i < oldTShift.length; i++) { - state2.bMarks[i + startLine] = oldBMarks[i]; - state2.tShift[i + startLine] = oldTShift[i]; - state2.sCount[i + startLine] = oldSCount[i]; - state2.bsCount[i + startLine] = oldBSCount[i]; - } - state2.blkIndent = oldIndent; - return true; - }, "blockquote"); - var isSpace$8 = utils$1.isSpace; - var hr = /* @__PURE__ */__name(function hr2(state2, startLine, endLine, silent) { - var marker2, - cnt, - ch, - token2, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine]; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - marker2 = state2.src.charCodeAt(pos++); - if (marker2 !== 42 && marker2 !== 45 && marker2 !== 95) { - return false; - } - cnt = 1; - while (pos < max) { - ch = state2.src.charCodeAt(pos++); - if (ch !== marker2 && !isSpace$8(ch)) { - return false; - } - if (ch === marker2) { - cnt++; - } - } - if (cnt < 3) { - return false; - } - if (silent) { - return true; - } - state2.line = startLine + 1; - token2 = state2.push("hr", "hr", 0); - token2.map = [startLine, state2.line]; - token2.markup = Array(cnt + 1).join(String.fromCharCode(marker2)); - return true; - }, "hr"); - var isSpace$7 = utils$1.isSpace; - function skipBulletListMarker(state2, startLine) { - var marker2, pos, max, ch; - pos = state2.bMarks[startLine] + state2.tShift[startLine]; - max = state2.eMarks[startLine]; - marker2 = state2.src.charCodeAt(pos++); - if (marker2 !== 42 && marker2 !== 45 && marker2 !== 43) { - return -1; - } - if (pos < max) { - ch = state2.src.charCodeAt(pos); - if (!isSpace$7(ch)) { - return -1; - } - } - return pos; - } - __name(skipBulletListMarker, "skipBulletListMarker"); - function skipOrderedListMarker(state2, startLine) { - var ch, - start = state2.bMarks[startLine] + state2.tShift[startLine], - pos = start, - max = state2.eMarks[startLine]; - if (pos + 1 >= max) { - return -1; - } - ch = state2.src.charCodeAt(pos++); - if (ch < 48 || ch > 57) { - return -1; - } - for (;;) { - if (pos >= max) { - return -1; - } - ch = state2.src.charCodeAt(pos++); - if (ch >= 48 && ch <= 57) { - if (pos - start >= 10) { - return -1; - } - continue; - } - if (ch === 41 || ch === 46) { - break; - } - return -1; - } - if (pos < max) { - ch = state2.src.charCodeAt(pos); - if (!isSpace$7(ch)) { - return -1; - } - } - return pos; - } - __name(skipOrderedListMarker, "skipOrderedListMarker"); - function markTightParagraphs(state2, idx) { - var i, - l2, - level = state2.level + 2; - for (i = idx + 2, l2 = state2.tokens.length - 2; i < l2; i++) { - if (state2.tokens[i].level === level && state2.tokens[i].type === "paragraph_open") { - state2.tokens[i + 2].hidden = true; - state2.tokens[i].hidden = true; - i += 2; - } - } - } - __name(markTightParagraphs, "markTightParagraphs"); - var list = /* @__PURE__ */__name(function list2(state2, startLine, endLine, silent) { - var ch, - contentStart, - i, - indent2, - indentAfterMarker, - initial, - isOrdered, - itemLines, - l2, - listLines, - listTokIdx, - markerCharCode, - markerValue, - max, - nextLine, - offset, - oldListIndent, - oldParentType, - oldSCount, - oldTShift, - oldTight, - pos, - posAfterMarker, - prevEmptyEnd, - start, - terminate, - terminatorRules, - token2, - isTerminatingParagraph = false, - tight = true; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - if (state2.listIndent >= 0 && state2.sCount[startLine] - state2.listIndent >= 4 && state2.sCount[startLine] < state2.blkIndent) { - return false; - } - if (silent && state2.parentType === "paragraph") { - if (state2.tShift[startLine] >= state2.blkIndent) { - isTerminatingParagraph = true; - } - } - if ((posAfterMarker = skipOrderedListMarker(state2, startLine)) >= 0) { - isOrdered = true; - start = state2.bMarks[startLine] + state2.tShift[startLine]; - markerValue = Number(state2.src.slice(start, posAfterMarker - 1)); - if (isTerminatingParagraph && markerValue !== 1) return false; - } else if ((posAfterMarker = skipBulletListMarker(state2, startLine)) >= 0) { - isOrdered = false; - } else { - return false; - } - if (isTerminatingParagraph) { - if (state2.skipSpaces(posAfterMarker) >= state2.eMarks[startLine]) return false; - } - markerCharCode = state2.src.charCodeAt(posAfterMarker - 1); - if (silent) { - return true; - } - listTokIdx = state2.tokens.length; - if (isOrdered) { - token2 = state2.push("ordered_list_open", "ol", 1); - if (markerValue !== 1) { - token2.attrs = [["start", markerValue]]; - } - } else { - token2 = state2.push("bullet_list_open", "ul", 1); - } - token2.map = listLines = [startLine, 0]; - token2.markup = String.fromCharCode(markerCharCode); - nextLine = startLine; - prevEmptyEnd = false; - terminatorRules = state2.md.block.ruler.getRules("list"); - oldParentType = state2.parentType; - state2.parentType = "list"; - while (nextLine < endLine) { - pos = posAfterMarker; - max = state2.eMarks[nextLine]; - initial = offset = state2.sCount[nextLine] + posAfterMarker - (state2.bMarks[startLine] + state2.tShift[startLine]); - while (pos < max) { - ch = state2.src.charCodeAt(pos); - if (ch === 9) { - offset += 4 - (offset + state2.bsCount[nextLine]) % 4; - } else if (ch === 32) { - offset++; - } else { - break; - } - pos++; - } - contentStart = pos; - if (contentStart >= max) { - indentAfterMarker = 1; - } else { - indentAfterMarker = offset - initial; - } - if (indentAfterMarker > 4) { - indentAfterMarker = 1; - } - indent2 = initial + indentAfterMarker; - token2 = state2.push("list_item_open", "li", 1); - token2.markup = String.fromCharCode(markerCharCode); - token2.map = itemLines = [startLine, 0]; - if (isOrdered) { - token2.info = state2.src.slice(start, posAfterMarker - 1); - } - oldTight = state2.tight; - oldTShift = state2.tShift[startLine]; - oldSCount = state2.sCount[startLine]; - oldListIndent = state2.listIndent; - state2.listIndent = state2.blkIndent; - state2.blkIndent = indent2; - state2.tight = true; - state2.tShift[startLine] = contentStart - state2.bMarks[startLine]; - state2.sCount[startLine] = offset; - if (contentStart >= max && state2.isEmpty(startLine + 1)) { - state2.line = Math.min(state2.line + 2, endLine); - } else { - state2.md.block.tokenize(state2, startLine, endLine, true); - } - if (!state2.tight || prevEmptyEnd) { - tight = false; - } - prevEmptyEnd = state2.line - startLine > 1 && state2.isEmpty(state2.line - 1); - state2.blkIndent = state2.listIndent; - state2.listIndent = oldListIndent; - state2.tShift[startLine] = oldTShift; - state2.sCount[startLine] = oldSCount; - state2.tight = oldTight; - token2 = state2.push("list_item_close", "li", -1); - token2.markup = String.fromCharCode(markerCharCode); - nextLine = startLine = state2.line; - itemLines[1] = nextLine; - contentStart = state2.bMarks[startLine]; - if (nextLine >= endLine) { - break; - } - if (state2.sCount[nextLine] < state2.blkIndent) { - break; - } - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - break; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - if (isOrdered) { - posAfterMarker = skipOrderedListMarker(state2, nextLine); - if (posAfterMarker < 0) { - break; - } - start = state2.bMarks[nextLine] + state2.tShift[nextLine]; - } else { - posAfterMarker = skipBulletListMarker(state2, nextLine); - if (posAfterMarker < 0) { - break; - } - } - if (markerCharCode !== state2.src.charCodeAt(posAfterMarker - 1)) { - break; - } - } - if (isOrdered) { - token2 = state2.push("ordered_list_close", "ol", -1); - } else { - token2 = state2.push("bullet_list_close", "ul", -1); - } - token2.markup = String.fromCharCode(markerCharCode); - listLines[1] = nextLine; - state2.line = nextLine; - state2.parentType = oldParentType; - if (tight) { - markTightParagraphs(state2, listTokIdx); - } - return true; - }, "list"); - var normalizeReference$2 = utils$1.normalizeReference; - var isSpace$6 = utils$1.isSpace; - var reference = /* @__PURE__ */__name(function reference2(state2, startLine, _endLine, silent) { - var ch, - destEndPos, - destEndLineNo, - endLine, - href, - i, - l2, - label, - labelEnd, - oldParentType, - res, - start, - str, - terminate, - terminatorRules, - title, - lines = 0, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine], - nextLine = startLine + 1; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - if (state2.src.charCodeAt(pos) !== 91) { - return false; - } - while (++pos < max) { - if (state2.src.charCodeAt(pos) === 93 && state2.src.charCodeAt(pos - 1) !== 92) { - if (pos + 1 === max) { - return false; - } - if (state2.src.charCodeAt(pos + 1) !== 58) { - return false; - } - break; - } - } - endLine = state2.lineMax; - terminatorRules = state2.md.block.ruler.getRules("reference"); - oldParentType = state2.parentType; - state2.parentType = "reference"; - for (; nextLine < endLine && !state2.isEmpty(nextLine); nextLine++) { - if (state2.sCount[nextLine] - state2.blkIndent > 3) { - continue; - } - if (state2.sCount[nextLine] < 0) { - continue; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - str = state2.getLines(startLine, nextLine, state2.blkIndent, false).trim(); - max = str.length; - for (pos = 1; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 91) { - return false; - } else if (ch === 93) { - labelEnd = pos; - break; - } else if (ch === 10) { - lines++; - } else if (ch === 92) { - pos++; - if (pos < max && str.charCodeAt(pos) === 10) { - lines++; - } - } - } - if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) { - return false; - } - for (pos = labelEnd + 2; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 10) { - lines++; - } else if (isSpace$6(ch)) ;else { - break; - } - } - res = state2.md.helpers.parseLinkDestination(str, pos, max); - if (!res.ok) { - return false; - } - href = state2.md.normalizeLink(res.str); - if (!state2.md.validateLink(href)) { - return false; - } - pos = res.pos; - lines += res.lines; - destEndPos = pos; - destEndLineNo = lines; - start = pos; - for (; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 10) { - lines++; - } else if (isSpace$6(ch)) ;else { - break; - } - } - res = state2.md.helpers.parseLinkTitle(str, pos, max); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - lines += res.lines; - } else { - title = ""; - pos = destEndPos; - lines = destEndLineNo; - } - while (pos < max) { - ch = str.charCodeAt(pos); - if (!isSpace$6(ch)) { - break; - } - pos++; - } - if (pos < max && str.charCodeAt(pos) !== 10) { - if (title) { - title = ""; - pos = destEndPos; - lines = destEndLineNo; - while (pos < max) { - ch = str.charCodeAt(pos); - if (!isSpace$6(ch)) { - break; - } - pos++; - } - } - } - if (pos < max && str.charCodeAt(pos) !== 10) { - return false; - } - label = normalizeReference$2(str.slice(1, labelEnd)); - if (!label) { - return false; - } - if (silent) { - return true; - } - if (typeof state2.env.references === "undefined") { - state2.env.references = {}; - } - if (typeof state2.env.references[label] === "undefined") { - state2.env.references[label] = { - title, - href - }; - } - state2.parentType = oldParentType; - state2.line = startLine + lines + 1; - return true; - }, "reference"); - var html_blocks = ["address", "article", "aside", "base", "basefont", "blockquote", "body", "caption", "center", "col", "colgroup", "dd", "details", "dialog", "dir", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hr", "html", "iframe", "legend", "li", "link", "main", "menu", "menuitem", "nav", "noframes", "ol", "optgroup", "option", "p", "param", "section", "source", "summary", "table", "tbody", "td", "tfoot", "th", "thead", "title", "tr", "track", "ul"]; - var html_re = {}; - var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*"; - var unquoted = "[^\"'=<>`\\x00-\\x20]+"; - var single_quoted = "'[^']*'"; - var double_quoted = '"[^"]*"'; - var attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")"; - var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)"; - var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>"; - var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>"; - var comment = "|"; - var processing = "<[?][\\s\\S]*?[?]>"; - var declaration = "]*>"; - var cdata = ""; - var HTML_TAG_RE$1 = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")"); - var HTML_OPEN_CLOSE_TAG_RE$1 = new RegExp("^(?:" + open_tag + "|" + close_tag + ")"); - html_re.HTML_TAG_RE = HTML_TAG_RE$1; - html_re.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE$1; - var block_names = html_blocks; - var HTML_OPEN_CLOSE_TAG_RE = html_re.HTML_OPEN_CLOSE_TAG_RE; - var HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp("^|$))", "i"), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]]; - var html_block = /* @__PURE__ */__name(function html_block2(state2, startLine, endLine, silent) { - var i, - nextLine, - token2, - lineText, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine]; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - if (!state2.md.options.html) { - return false; - } - if (state2.src.charCodeAt(pos) !== 60) { - return false; - } - lineText = state2.src.slice(pos, max); - for (i = 0; i < HTML_SEQUENCES.length; i++) { - if (HTML_SEQUENCES[i][0].test(lineText)) { - break; - } - } - if (i === HTML_SEQUENCES.length) { - return false; - } - if (silent) { - return HTML_SEQUENCES[i][2]; - } - nextLine = startLine + 1; - if (!HTML_SEQUENCES[i][1].test(lineText)) { - for (; nextLine < endLine; nextLine++) { - if (state2.sCount[nextLine] < state2.blkIndent) { - break; - } - pos = state2.bMarks[nextLine] + state2.tShift[nextLine]; - max = state2.eMarks[nextLine]; - lineText = state2.src.slice(pos, max); - if (HTML_SEQUENCES[i][1].test(lineText)) { - if (lineText.length !== 0) { - nextLine++; - } - break; - } - } - } - state2.line = nextLine; - token2 = state2.push("html_block", "", 0); - token2.map = [startLine, nextLine]; - token2.content = state2.getLines(startLine, nextLine, state2.blkIndent, true); - return true; - }, "html_block"); - var isSpace$5 = utils$1.isSpace; - var heading = /* @__PURE__ */__name(function heading2(state2, startLine, endLine, silent) { - var ch, - level, - tmp, - token2, - pos = state2.bMarks[startLine] + state2.tShift[startLine], - max = state2.eMarks[startLine]; - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - ch = state2.src.charCodeAt(pos); - if (ch !== 35 || pos >= max) { - return false; - } - level = 1; - ch = state2.src.charCodeAt(++pos); - while (ch === 35 && pos < max && level <= 6) { - level++; - ch = state2.src.charCodeAt(++pos); - } - if (level > 6 || pos < max && !isSpace$5(ch)) { - return false; - } - if (silent) { - return true; - } - max = state2.skipSpacesBack(max, pos); - tmp = state2.skipCharsBack(max, 35, pos); - if (tmp > pos && isSpace$5(state2.src.charCodeAt(tmp - 1))) { - max = tmp; - } - state2.line = startLine + 1; - token2 = state2.push("heading_open", "h" + String(level), 1); - token2.markup = "########".slice(0, level); - token2.map = [startLine, state2.line]; - token2 = state2.push("inline", "", 0); - token2.content = state2.src.slice(pos, max).trim(); - token2.map = [startLine, state2.line]; - token2.children = []; - token2 = state2.push("heading_close", "h" + String(level), -1); - token2.markup = "########".slice(0, level); - return true; - }, "heading"); - var lheading = /* @__PURE__ */__name(function lheading2(state2, startLine, endLine) { - var content, - terminate, - i, - l2, - token2, - pos, - max, - level, - marker2, - nextLine = startLine + 1, - oldParentType, - terminatorRules = state2.md.block.ruler.getRules("paragraph"); - if (state2.sCount[startLine] - state2.blkIndent >= 4) { - return false; - } - oldParentType = state2.parentType; - state2.parentType = "paragraph"; - for (; nextLine < endLine && !state2.isEmpty(nextLine); nextLine++) { - if (state2.sCount[nextLine] - state2.blkIndent > 3) { - continue; - } - if (state2.sCount[nextLine] >= state2.blkIndent) { - pos = state2.bMarks[nextLine] + state2.tShift[nextLine]; - max = state2.eMarks[nextLine]; - if (pos < max) { - marker2 = state2.src.charCodeAt(pos); - if (marker2 === 45 || marker2 === 61) { - pos = state2.skipChars(pos, marker2); - pos = state2.skipSpaces(pos); - if (pos >= max) { - level = marker2 === 61 ? 1 : 2; - break; - } - } - } - } - if (state2.sCount[nextLine] < 0) { - continue; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - if (!level) { - return false; - } - content = state2.getLines(startLine, nextLine, state2.blkIndent, false).trim(); - state2.line = nextLine + 1; - token2 = state2.push("heading_open", "h" + String(level), 1); - token2.markup = String.fromCharCode(marker2); - token2.map = [startLine, state2.line]; - token2 = state2.push("inline", "", 0); - token2.content = content; - token2.map = [startLine, state2.line - 1]; - token2.children = []; - token2 = state2.push("heading_close", "h" + String(level), -1); - token2.markup = String.fromCharCode(marker2); - state2.parentType = oldParentType; - return true; - }, "lheading"); - var paragraph = /* @__PURE__ */__name(function paragraph2(state2, startLine) { - var content, - terminate, - i, - l2, - token2, - oldParentType, - nextLine = startLine + 1, - terminatorRules = state2.md.block.ruler.getRules("paragraph"), - endLine = state2.lineMax; - oldParentType = state2.parentType; - state2.parentType = "paragraph"; - for (; nextLine < endLine && !state2.isEmpty(nextLine); nextLine++) { - if (state2.sCount[nextLine] - state2.blkIndent > 3) { - continue; - } - if (state2.sCount[nextLine] < 0) { - continue; - } - terminate = false; - for (i = 0, l2 = terminatorRules.length; i < l2; i++) { - if (terminatorRules[i](state2, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - content = state2.getLines(startLine, nextLine, state2.blkIndent, false).trim(); - state2.line = nextLine; - token2 = state2.push("paragraph_open", "p", 1); - token2.map = [startLine, state2.line]; - token2 = state2.push("inline", "", 0); - token2.content = content; - token2.map = [startLine, state2.line]; - token2.children = []; - token2 = state2.push("paragraph_close", "p", -1); - state2.parentType = oldParentType; - return true; - }, "paragraph"); - var Token$1 = token; - var isSpace$4 = utils$1.isSpace; - function StateBlock(src, md, env, tokens) { - var ch, s2, start, pos, len, indent2, offset, indent_found; - this.src = src; - this.md = md; - this.env = env; - this.tokens = tokens; - this.bMarks = []; - this.eMarks = []; - this.tShift = []; - this.sCount = []; - this.bsCount = []; - this.blkIndent = 0; - this.line = 0; - this.lineMax = 0; - this.tight = false; - this.ddIndent = -1; - this.listIndent = -1; - this.parentType = "root"; - this.level = 0; - this.result = ""; - s2 = this.src; - indent_found = false; - for (start = pos = indent2 = offset = 0, len = s2.length; pos < len; pos++) { - ch = s2.charCodeAt(pos); - if (!indent_found) { - if (isSpace$4(ch)) { - indent2++; - if (ch === 9) { - offset += 4 - offset % 4; - } else { - offset++; - } - continue; - } else { - indent_found = true; - } - } - if (ch === 10 || pos === len - 1) { - if (ch !== 10) { - pos++; - } - this.bMarks.push(start); - this.eMarks.push(pos); - this.tShift.push(indent2); - this.sCount.push(offset); - this.bsCount.push(0); - indent_found = false; - indent2 = 0; - offset = 0; - start = pos + 1; - } - } - this.bMarks.push(s2.length); - this.eMarks.push(s2.length); - this.tShift.push(0); - this.sCount.push(0); - this.bsCount.push(0); - this.lineMax = this.bMarks.length - 1; - } - __name(StateBlock, "StateBlock"); - StateBlock.prototype.push = function (type2, tag, nesting) { - var token2 = new Token$1(type2, tag, nesting); - token2.block = true; - if (nesting < 0) this.level--; - token2.level = this.level; - if (nesting > 0) this.level++; - this.tokens.push(token2); - return token2; - }; - StateBlock.prototype.isEmpty = /* @__PURE__ */__name(function isEmpty(line) { - return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; - }, "isEmpty"); - StateBlock.prototype.skipEmptyLines = /* @__PURE__ */__name(function skipEmptyLines(from) { - for (var max = this.lineMax; from < max; from++) { - if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { - break; - } - } - return from; - }, "skipEmptyLines"); - StateBlock.prototype.skipSpaces = /* @__PURE__ */__name(function skipSpaces(pos) { - var ch; - for (var max = this.src.length; pos < max; pos++) { - ch = this.src.charCodeAt(pos); - if (!isSpace$4(ch)) { - break; - } - } - return pos; - }, "skipSpaces"); - StateBlock.prototype.skipSpacesBack = /* @__PURE__ */__name(function skipSpacesBack(pos, min) { - if (pos <= min) { - return pos; - } - while (pos > min) { - if (!isSpace$4(this.src.charCodeAt(--pos))) { - return pos + 1; - } - } - return pos; - }, "skipSpacesBack"); - StateBlock.prototype.skipChars = /* @__PURE__ */__name(function skipChars(pos, code3) { - for (var max = this.src.length; pos < max; pos++) { - if (this.src.charCodeAt(pos) !== code3) { - break; - } - } - return pos; - }, "skipChars"); - StateBlock.prototype.skipCharsBack = /* @__PURE__ */__name(function skipCharsBack(pos, code3, min) { - if (pos <= min) { - return pos; - } - while (pos > min) { - if (code3 !== this.src.charCodeAt(--pos)) { - return pos + 1; - } - } - return pos; - }, "skipCharsBack"); - StateBlock.prototype.getLines = /* @__PURE__ */__name(function getLines(begin, end, indent2, keepLastLF) { - var i, - lineIndent, - ch, - first, - last, - queue, - lineStart, - line = begin; - if (begin >= end) { - return ""; - } - queue = new Array(end - begin); - for (i = 0; line < end; line++, i++) { - lineIndent = 0; - lineStart = first = this.bMarks[line]; - if (line + 1 < end || keepLastLF) { - last = this.eMarks[line] + 1; - } else { - last = this.eMarks[line]; - } - while (first < last && lineIndent < indent2) { - ch = this.src.charCodeAt(first); - if (isSpace$4(ch)) { - if (ch === 9) { - lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; - } else { - lineIndent++; - } - } else if (first - lineStart < this.tShift[line]) { - lineIndent++; - } else { - break; - } - first++; - } - if (lineIndent > indent2) { - queue[i] = new Array(lineIndent - indent2 + 1).join(" ") + this.src.slice(first, last); - } else { - queue[i] = this.src.slice(first, last); - } - } - return queue.join(""); - }, "getLines"); - StateBlock.prototype.Token = Token$1; - var state_block = StateBlock; - var Ruler$1 = ruler; - var _rules$1 = [["table", table, ["paragraph", "reference"]], ["code", code], ["fence", fence, ["paragraph", "reference", "blockquote", "list"]], ["blockquote", blockquote, ["paragraph", "reference", "blockquote", "list"]], ["hr", hr, ["paragraph", "reference", "blockquote", "list"]], ["list", list, ["paragraph", "reference", "blockquote"]], ["reference", reference], ["html_block", html_block, ["paragraph", "reference", "blockquote"]], ["heading", heading, ["paragraph", "reference", "blockquote"]], ["lheading", lheading], ["paragraph", paragraph]]; - function ParserBlock$1() { - this.ruler = new Ruler$1(); - for (var i = 0; i < _rules$1.length; i++) { - this.ruler.push(_rules$1[i][0], _rules$1[i][1], { - alt: (_rules$1[i][2] || []).slice() - }); - } - } - __name(ParserBlock$1, "ParserBlock$1"); - ParserBlock$1.prototype.tokenize = function (state2, startLine, endLine) { - var ok, - i, - rules = this.ruler.getRules(""), - len = rules.length, - line = startLine, - hasEmptyLines = false, - maxNesting = state2.md.options.maxNesting; - while (line < endLine) { - state2.line = line = state2.skipEmptyLines(line); - if (line >= endLine) { - break; - } - if (state2.sCount[line] < state2.blkIndent) { - break; - } - if (state2.level >= maxNesting) { - state2.line = endLine; - break; - } - for (i = 0; i < len; i++) { - ok = rules[i](state2, line, endLine, false); - if (ok) { - break; - } - } - state2.tight = !hasEmptyLines; - if (state2.isEmpty(state2.line - 1)) { - hasEmptyLines = true; - } - line = state2.line; - if (line < endLine && state2.isEmpty(line)) { - hasEmptyLines = true; - line++; - state2.line = line; - } - } - }; - ParserBlock$1.prototype.parse = function (src, md, env, outTokens) { - var state2; - if (!src) { - return; - } - state2 = new this.State(src, md, env, outTokens); - this.tokenize(state2, state2.line, state2.lineMax); - }; - ParserBlock$1.prototype.State = state_block; - var parser_block = ParserBlock$1; - function isTerminatorChar(ch) { - switch (ch) { - case 10: - case 33: - case 35: - case 36: - case 37: - case 38: - case 42: - case 43: - case 45: - case 58: - case 60: - case 61: - case 62: - case 64: - case 91: - case 92: - case 93: - case 94: - case 95: - case 96: - case 123: - case 125: - case 126: - return true; - default: - return false; - } - } - __name(isTerminatorChar, "isTerminatorChar"); - var text = /* @__PURE__ */__name(function text2(state2, silent) { - var pos = state2.pos; - while (pos < state2.posMax && !isTerminatorChar(state2.src.charCodeAt(pos))) { - pos++; - } - if (pos === state2.pos) { - return false; - } - if (!silent) { - state2.pending += state2.src.slice(state2.pos, pos); - } - state2.pos = pos; - return true; - }, "text"); - var isSpace$3 = utils$1.isSpace; - var newline = /* @__PURE__ */__name(function newline2(state2, silent) { - var pmax, - max, - pos = state2.pos; - if (state2.src.charCodeAt(pos) !== 10) { - return false; - } - pmax = state2.pending.length - 1; - max = state2.posMax; - if (!silent) { - if (pmax >= 0 && state2.pending.charCodeAt(pmax) === 32) { - if (pmax >= 1 && state2.pending.charCodeAt(pmax - 1) === 32) { - state2.pending = state2.pending.replace(/ +$/, ""); - state2.push("hardbreak", "br", 0); - } else { - state2.pending = state2.pending.slice(0, -1); - state2.push("softbreak", "br", 0); - } - } else { - state2.push("softbreak", "br", 0); - } - } - pos++; - while (pos < max && isSpace$3(state2.src.charCodeAt(pos))) { - pos++; - } - state2.pos = pos; - return true; - }, "newline"); - var isSpace$2 = utils$1.isSpace; - var ESCAPED = []; - for (var i = 0; i < 256; i++) { - ESCAPED.push(0); - } - "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (ch) { - ESCAPED[ch.charCodeAt(0)] = 1; - }); - var _escape = /* @__PURE__ */__name(function escape(state2, silent) { - var ch, - pos = state2.pos, - max = state2.posMax; - if (state2.src.charCodeAt(pos) !== 92) { - return false; - } - pos++; - if (pos < max) { - ch = state2.src.charCodeAt(pos); - if (ch < 256 && ESCAPED[ch] !== 0) { - if (!silent) { - state2.pending += state2.src[pos]; - } - state2.pos += 2; - return true; - } - if (ch === 10) { - if (!silent) { - state2.push("hardbreak", "br", 0); - } - pos++; - while (pos < max) { - ch = state2.src.charCodeAt(pos); - if (!isSpace$2(ch)) { - break; - } - pos++; - } - state2.pos = pos; - return true; - } - } - if (!silent) { - state2.pending += "\\"; - } - state2.pos++; - return true; - }, "escape"); - var backticks = /* @__PURE__ */__name(function backtick(state2, silent) { - var start, - max, - marker2, - token2, - matchStart, - matchEnd, - openerLength, - closerLength, - pos = state2.pos, - ch = state2.src.charCodeAt(pos); - if (ch !== 96) { - return false; - } - start = pos; - pos++; - max = state2.posMax; - while (pos < max && state2.src.charCodeAt(pos) === 96) { - pos++; - } - marker2 = state2.src.slice(start, pos); - openerLength = marker2.length; - if (state2.backticksScanned && (state2.backticks[openerLength] || 0) <= start) { - if (!silent) state2.pending += marker2; - state2.pos += openerLength; - return true; - } - matchStart = matchEnd = pos; - while ((matchStart = state2.src.indexOf("`", matchEnd)) !== -1) { - matchEnd = matchStart + 1; - while (matchEnd < max && state2.src.charCodeAt(matchEnd) === 96) { - matchEnd++; - } - closerLength = matchEnd - matchStart; - if (closerLength === openerLength) { - if (!silent) { - token2 = state2.push("code_inline", "code", 0); - token2.markup = marker2; - token2.content = state2.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1"); - } - state2.pos = matchEnd; - return true; - } - state2.backticks[closerLength] = matchStart; - } - state2.backticksScanned = true; - if (!silent) state2.pending += marker2; - state2.pos += openerLength; - return true; - }, "backtick"); - var strikethrough = {}; - strikethrough.tokenize = /* @__PURE__ */__name(function strikethrough2(state2, silent) { - var i, - scanned, - token2, - len, - ch, - start = state2.pos, - marker2 = state2.src.charCodeAt(start); - if (silent) { - return false; - } - if (marker2 !== 126) { - return false; - } - scanned = state2.scanDelims(state2.pos, true); - len = scanned.length; - ch = String.fromCharCode(marker2); - if (len < 2) { - return false; - } - if (len % 2) { - token2 = state2.push("text", "", 0); - token2.content = ch; - len--; - } - for (i = 0; i < len; i += 2) { - token2 = state2.push("text", "", 0); - token2.content = ch + ch; - state2.delimiters.push({ - marker: marker2, - length: 0, - jump: i / 2, - token: state2.tokens.length - 1, - end: -1, - open: scanned.can_open, - close: scanned.can_close - }); - } - state2.pos += scanned.length; - return true; - }, "strikethrough"); - function postProcess$1(state2, delimiters) { - var i, - j, - startDelim, - endDelim, - token2, - loneMarkers = [], - max = delimiters.length; - for (i = 0; i < max; i++) { - startDelim = delimiters[i]; - if (startDelim.marker !== 126) { - continue; - } - if (startDelim.end === -1) { - continue; - } - endDelim = delimiters[startDelim.end]; - token2 = state2.tokens[startDelim.token]; - token2.type = "s_open"; - token2.tag = "s"; - token2.nesting = 1; - token2.markup = "~~"; - token2.content = ""; - token2 = state2.tokens[endDelim.token]; - token2.type = "s_close"; - token2.tag = "s"; - token2.nesting = -1; - token2.markup = "~~"; - token2.content = ""; - if (state2.tokens[endDelim.token - 1].type === "text" && state2.tokens[endDelim.token - 1].content === "~") { - loneMarkers.push(endDelim.token - 1); - } - } - while (loneMarkers.length) { - i = loneMarkers.pop(); - j = i + 1; - while (j < state2.tokens.length && state2.tokens[j].type === "s_close") { - j++; - } - j--; - if (i !== j) { - token2 = state2.tokens[j]; - state2.tokens[j] = state2.tokens[i]; - state2.tokens[i] = token2; - } - } - } - __name(postProcess$1, "postProcess$1"); - strikethrough.postProcess = /* @__PURE__ */__name(function strikethrough3(state2) { - var curr, - tokens_meta = state2.tokens_meta, - max = state2.tokens_meta.length; - postProcess$1(state2, state2.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess$1(state2, tokens_meta[curr].delimiters); - } - } - }, "strikethrough"); - var emphasis = {}; - emphasis.tokenize = /* @__PURE__ */__name(function emphasis2(state2, silent) { - var i, - scanned, - token2, - start = state2.pos, - marker2 = state2.src.charCodeAt(start); - if (silent) { - return false; - } - if (marker2 !== 95 && marker2 !== 42) { - return false; - } - scanned = state2.scanDelims(state2.pos, marker2 === 42); - for (i = 0; i < scanned.length; i++) { - token2 = state2.push("text", "", 0); - token2.content = String.fromCharCode(marker2); - state2.delimiters.push({ - marker: marker2, - length: scanned.length, - jump: i, - token: state2.tokens.length - 1, - end: -1, - open: scanned.can_open, - close: scanned.can_close - }); - } - state2.pos += scanned.length; - return true; - }, "emphasis"); - function postProcess(state2, delimiters) { - var i, - startDelim, - endDelim, - token2, - ch, - isStrong, - max = delimiters.length; - for (i = max - 1; i >= 0; i--) { - startDelim = delimiters[i]; - if (startDelim.marker !== 95 && startDelim.marker !== 42) { - continue; - } - if (startDelim.end === -1) { - continue; - } - endDelim = delimiters[startDelim.end]; - isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1 && delimiters[i - 1].marker === startDelim.marker; - ch = String.fromCharCode(startDelim.marker); - token2 = state2.tokens[startDelim.token]; - token2.type = isStrong ? "strong_open" : "em_open"; - token2.tag = isStrong ? "strong" : "em"; - token2.nesting = 1; - token2.markup = isStrong ? ch + ch : ch; - token2.content = ""; - token2 = state2.tokens[endDelim.token]; - token2.type = isStrong ? "strong_close" : "em_close"; - token2.tag = isStrong ? "strong" : "em"; - token2.nesting = -1; - token2.markup = isStrong ? ch + ch : ch; - token2.content = ""; - if (isStrong) { - state2.tokens[delimiters[i - 1].token].content = ""; - state2.tokens[delimiters[startDelim.end + 1].token].content = ""; - i--; - } - } - } - __name(postProcess, "postProcess"); - emphasis.postProcess = /* @__PURE__ */__name(function emphasis3(state2) { - var curr, - tokens_meta = state2.tokens_meta, - max = state2.tokens_meta.length; - postProcess(state2, state2.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state2, tokens_meta[curr].delimiters); - } - } - }, "emphasis"); - var normalizeReference$1 = utils$1.normalizeReference; - var isSpace$1 = utils$1.isSpace; - var link = /* @__PURE__ */__name(function link2(state2, silent) { - var attrs, - code3, - label, - labelEnd, - labelStart, - pos, - res, - ref, - token2, - href = "", - title = "", - oldPos = state2.pos, - max = state2.posMax, - start = state2.pos, - parseReference = true; - if (state2.src.charCodeAt(state2.pos) !== 91) { - return false; - } - labelStart = state2.pos + 1; - labelEnd = state2.md.helpers.parseLinkLabel(state2, state2.pos, true); - if (labelEnd < 0) { - return false; - } - pos = labelEnd + 1; - if (pos < max && state2.src.charCodeAt(pos) === 40) { - parseReference = false; - pos++; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace$1(code3) && code3 !== 10) { - break; - } - } - if (pos >= max) { - return false; - } - start = pos; - res = state2.md.helpers.parseLinkDestination(state2.src, pos, state2.posMax); - if (res.ok) { - href = state2.md.normalizeLink(res.str); - if (state2.md.validateLink(href)) { - pos = res.pos; - } else { - href = ""; - } - start = pos; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace$1(code3) && code3 !== 10) { - break; - } - } - res = state2.md.helpers.parseLinkTitle(state2.src, pos, state2.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace$1(code3) && code3 !== 10) { - break; - } - } - } - } - if (pos >= max || state2.src.charCodeAt(pos) !== 41) { - parseReference = true; - } - pos++; - } - if (parseReference) { - if (typeof state2.env.references === "undefined") { - return false; - } - if (pos < max && state2.src.charCodeAt(pos) === 91) { - start = pos + 1; - pos = state2.md.helpers.parseLinkLabel(state2, pos); - if (pos >= 0) { - label = state2.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - if (!label) { - label = state2.src.slice(labelStart, labelEnd); - } - ref = state2.env.references[normalizeReference$1(label)]; - if (!ref) { - state2.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - if (!silent) { - state2.pos = labelStart; - state2.posMax = labelEnd; - token2 = state2.push("link_open", "a", 1); - token2.attrs = attrs = [["href", href]]; - if (title) { - attrs.push(["title", title]); - } - state2.md.inline.tokenize(state2); - token2 = state2.push("link_close", "a", -1); - } - state2.pos = pos; - state2.posMax = max; - return true; - }, "link"); - var normalizeReference = utils$1.normalizeReference; - var isSpace = utils$1.isSpace; - var image = /* @__PURE__ */__name(function image2(state2, silent) { - var attrs, - code3, - content, - label, - labelEnd, - labelStart, - pos, - ref, - res, - title, - token2, - tokens, - start, - href = "", - oldPos = state2.pos, - max = state2.posMax; - if (state2.src.charCodeAt(state2.pos) !== 33) { - return false; - } - if (state2.src.charCodeAt(state2.pos + 1) !== 91) { - return false; - } - labelStart = state2.pos + 2; - labelEnd = state2.md.helpers.parseLinkLabel(state2, state2.pos + 1, false); - if (labelEnd < 0) { - return false; - } - pos = labelEnd + 1; - if (pos < max && state2.src.charCodeAt(pos) === 40) { - pos++; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace(code3) && code3 !== 10) { - break; - } - } - if (pos >= max) { - return false; - } - start = pos; - res = state2.md.helpers.parseLinkDestination(state2.src, pos, state2.posMax); - if (res.ok) { - href = state2.md.normalizeLink(res.str); - if (state2.md.validateLink(href)) { - pos = res.pos; - } else { - href = ""; - } - } - start = pos; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace(code3) && code3 !== 10) { - break; - } - } - res = state2.md.helpers.parseLinkTitle(state2.src, pos, state2.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - for (; pos < max; pos++) { - code3 = state2.src.charCodeAt(pos); - if (!isSpace(code3) && code3 !== 10) { - break; - } - } - } else { - title = ""; - } - if (pos >= max || state2.src.charCodeAt(pos) !== 41) { - state2.pos = oldPos; - return false; - } - pos++; - } else { - if (typeof state2.env.references === "undefined") { - return false; - } - if (pos < max && state2.src.charCodeAt(pos) === 91) { - start = pos + 1; - pos = state2.md.helpers.parseLinkLabel(state2, pos); - if (pos >= 0) { - label = state2.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - if (!label) { - label = state2.src.slice(labelStart, labelEnd); - } - ref = state2.env.references[normalizeReference(label)]; - if (!ref) { - state2.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - if (!silent) { - content = state2.src.slice(labelStart, labelEnd); - state2.md.inline.parse(content, state2.md, state2.env, tokens = []); - token2 = state2.push("image", "img", 0); - token2.attrs = attrs = [["src", href], ["alt", ""]]; - token2.children = tokens; - token2.content = content; - if (title) { - attrs.push(["title", title]); - } - } - state2.pos = pos; - state2.posMax = max; - return true; - }, "image"); - var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; - var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/; - var autolink = /* @__PURE__ */__name(function autolink2(state2, silent) { - var url, - fullUrl, - token2, - ch, - start, - max, - pos = state2.pos; - if (state2.src.charCodeAt(pos) !== 60) { - return false; - } - start = state2.pos; - max = state2.posMax; - for (;;) { - if (++pos >= max) return false; - ch = state2.src.charCodeAt(pos); - if (ch === 60) return false; - if (ch === 62) break; - } - url = state2.src.slice(start + 1, pos); - if (AUTOLINK_RE.test(url)) { - fullUrl = state2.md.normalizeLink(url); - if (!state2.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - token2 = state2.push("link_open", "a", 1); - token2.attrs = [["href", fullUrl]]; - token2.markup = "autolink"; - token2.info = "auto"; - token2 = state2.push("text", "", 0); - token2.content = state2.md.normalizeLinkText(url); - token2 = state2.push("link_close", "a", -1); - token2.markup = "autolink"; - token2.info = "auto"; - } - state2.pos += url.length + 2; - return true; - } - if (EMAIL_RE.test(url)) { - fullUrl = state2.md.normalizeLink("mailto:" + url); - if (!state2.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - token2 = state2.push("link_open", "a", 1); - token2.attrs = [["href", fullUrl]]; - token2.markup = "autolink"; - token2.info = "auto"; - token2 = state2.push("text", "", 0); - token2.content = state2.md.normalizeLinkText(url); - token2 = state2.push("link_close", "a", -1); - token2.markup = "autolink"; - token2.info = "auto"; - } - state2.pos += url.length + 2; - return true; - } - return false; - }, "autolink"); - var HTML_TAG_RE = html_re.HTML_TAG_RE; - function isLetter(ch) { - var lc = ch | 32; - return lc >= 97 && lc <= 122; - } - __name(isLetter, "isLetter"); - var html_inline = /* @__PURE__ */__name(function html_inline2(state2, silent) { - var ch, - match2, - max, - token2, - pos = state2.pos; - if (!state2.md.options.html) { - return false; - } - max = state2.posMax; - if (state2.src.charCodeAt(pos) !== 60 || pos + 2 >= max) { - return false; - } - ch = state2.src.charCodeAt(pos + 1); - if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) { - return false; - } - match2 = state2.src.slice(pos).match(HTML_TAG_RE); - if (!match2) { - return false; - } - if (!silent) { - token2 = state2.push("html_inline", "", 0); - token2.content = state2.src.slice(pos, pos + match2[0].length); - } - state2.pos += match2[0].length; - return true; - }, "html_inline"); - var entities = entities$1; - var has = utils$1.has; - var isValidEntityCode = utils$1.isValidEntityCode; - var fromCodePoint = utils$1.fromCodePoint; - var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; - var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; - var entity = /* @__PURE__ */__name(function entity2(state2, silent) { - var ch, - code3, - match2, - pos = state2.pos, - max = state2.posMax; - if (state2.src.charCodeAt(pos) !== 38) { - return false; - } - if (pos + 1 < max) { - ch = state2.src.charCodeAt(pos + 1); - if (ch === 35) { - match2 = state2.src.slice(pos).match(DIGITAL_RE); - if (match2) { - if (!silent) { - code3 = match2[1][0].toLowerCase() === "x" ? parseInt(match2[1].slice(1), 16) : parseInt(match2[1], 10); - state2.pending += isValidEntityCode(code3) ? fromCodePoint(code3) : fromCodePoint(65533); - } - state2.pos += match2[0].length; - return true; - } - } else { - match2 = state2.src.slice(pos).match(NAMED_RE); - if (match2) { - if (has(entities, match2[1])) { - if (!silent) { - state2.pending += entities[match2[1]]; - } - state2.pos += match2[0].length; - return true; - } - } - } - } - if (!silent) { - state2.pending += "&"; - } - state2.pos++; - return true; - }, "entity"); - function processDelimiters(state2, delimiters) { - var closerIdx, - openerIdx, - closer, - opener, - minOpenerIdx, - newMinOpenerIdx, - isOddMatch, - lastJump, - openersBottom = {}, - max = delimiters.length; - for (closerIdx = 0; closerIdx < max; closerIdx++) { - closer = delimiters[closerIdx]; - closer.length = closer.length || 0; - if (!closer.close) continue; - if (!openersBottom.hasOwnProperty(closer.marker)) { - openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; - } - minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; - openerIdx = closerIdx - closer.jump - 1; - if (openerIdx < -1) openerIdx = -1; - newMinOpenerIdx = openerIdx; - for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) { - opener = delimiters[openerIdx]; - if (opener.marker !== closer.marker) continue; - if (opener.open && opener.end < 0) { - isOddMatch = false; - if (opener.close || closer.open) { - if ((opener.length + closer.length) % 3 === 0) { - if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { - isOddMatch = true; - } - } - } - if (!isOddMatch) { - lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? delimiters[openerIdx - 1].jump + 1 : 0; - closer.jump = closerIdx - openerIdx + lastJump; - closer.open = false; - opener.end = closerIdx; - opener.jump = lastJump; - opener.close = false; - newMinOpenerIdx = -1; - break; - } - } - } - if (newMinOpenerIdx !== -1) { - openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; - } - } - } - __name(processDelimiters, "processDelimiters"); - var balance_pairs = /* @__PURE__ */__name(function link_pairs(state2) { - var curr, - tokens_meta = state2.tokens_meta, - max = state2.tokens_meta.length; - processDelimiters(state2, state2.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - processDelimiters(state2, tokens_meta[curr].delimiters); - } - } - }, "link_pairs"); - var text_collapse = /* @__PURE__ */__name(function text_collapse2(state2) { - var curr, - last, - level = 0, - tokens = state2.tokens, - max = state2.tokens.length; - for (curr = last = 0; curr < max; curr++) { - if (tokens[curr].nesting < 0) level--; - tokens[curr].level = level; - if (tokens[curr].nesting > 0) level++; - if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") { - tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; - } else { - if (curr !== last) { - tokens[last] = tokens[curr]; - } - last++; - } - } - if (curr !== last) { - tokens.length = last; - } - }, "text_collapse"); - var Token = token; - var isWhiteSpace = utils$1.isWhiteSpace; - var isPunctChar = utils$1.isPunctChar; - var isMdAsciiPunct = utils$1.isMdAsciiPunct; - function StateInline(src, md, env, outTokens) { - this.src = src; - this.env = env; - this.md = md; - this.tokens = outTokens; - this.tokens_meta = Array(outTokens.length); - this.pos = 0; - this.posMax = this.src.length; - this.level = 0; - this.pending = ""; - this.pendingLevel = 0; - this.cache = {}; - this.delimiters = []; - this._prev_delimiters = []; - this.backticks = {}; - this.backticksScanned = false; - } - __name(StateInline, "StateInline"); - StateInline.prototype.pushPending = function () { - var token2 = new Token("text", "", 0); - token2.content = this.pending; - token2.level = this.pendingLevel; - this.tokens.push(token2); - this.pending = ""; - return token2; - }; - StateInline.prototype.push = function (type2, tag, nesting) { - if (this.pending) { - this.pushPending(); - } - var token2 = new Token(type2, tag, nesting); - var token_meta = null; - if (nesting < 0) { - this.level--; - this.delimiters = this._prev_delimiters.pop(); - } - token2.level = this.level; - if (nesting > 0) { - this.level++; - this._prev_delimiters.push(this.delimiters); - this.delimiters = []; - token_meta = { - delimiters: this.delimiters - }; - } - this.pendingLevel = this.level; - this.tokens.push(token2); - this.tokens_meta.push(token_meta); - return token2; - }; - StateInline.prototype.scanDelims = function (start, canSplitWord) { - var pos = start, - lastChar, - nextChar, - count, - can_open, - can_close, - isLastWhiteSpace, - isLastPunctChar, - isNextWhiteSpace, - isNextPunctChar, - left_flanking = true, - right_flanking = true, - max = this.posMax, - marker2 = this.src.charCodeAt(start); - lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32; - while (pos < max && this.src.charCodeAt(pos) === marker2) { - pos++; - } - count = pos - start; - nextChar = pos < max ? this.src.charCodeAt(pos) : 32; - isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - isLastWhiteSpace = isWhiteSpace(lastChar); - isNextWhiteSpace = isWhiteSpace(nextChar); - if (isNextWhiteSpace) { - left_flanking = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - left_flanking = false; - } - } - if (isLastWhiteSpace) { - right_flanking = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - right_flanking = false; - } - } - if (!canSplitWord) { - can_open = left_flanking && (!right_flanking || isLastPunctChar); - can_close = right_flanking && (!left_flanking || isNextPunctChar); - } else { - can_open = left_flanking; - can_close = right_flanking; - } - return { - can_open, - can_close, - length: count - }; - }; - StateInline.prototype.Token = Token; - var state_inline = StateInline; - var Ruler = ruler; - var _rules = [["text", text], ["newline", newline], ["escape", _escape], ["backticks", backticks], ["strikethrough", strikethrough.tokenize], ["emphasis", emphasis.tokenize], ["link", link], ["image", image], ["autolink", autolink], ["html_inline", html_inline], ["entity", entity]]; - var _rules2 = [["balance_pairs", balance_pairs], ["strikethrough", strikethrough.postProcess], ["emphasis", emphasis.postProcess], ["text_collapse", text_collapse]]; - function ParserInline$1() { - var i; - this.ruler = new Ruler(); - for (i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1]); - } - this.ruler2 = new Ruler(); - for (i = 0; i < _rules2.length; i++) { - this.ruler2.push(_rules2[i][0], _rules2[i][1]); - } - } - __name(ParserInline$1, "ParserInline$1"); - ParserInline$1.prototype.skipToken = function (state2) { - var ok, - i, - pos = state2.pos, - rules = this.ruler.getRules(""), - len = rules.length, - maxNesting = state2.md.options.maxNesting, - cache = state2.cache; - if (typeof cache[pos] !== "undefined") { - state2.pos = cache[pos]; - return; - } - if (state2.level < maxNesting) { - for (i = 0; i < len; i++) { - state2.level++; - ok = rules[i](state2, true); - state2.level--; - if (ok) { - break; - } - } - } else { - state2.pos = state2.posMax; - } - if (!ok) { - state2.pos++; - } - cache[pos] = state2.pos; - }; - ParserInline$1.prototype.tokenize = function (state2) { - var ok, - i, - rules = this.ruler.getRules(""), - len = rules.length, - end = state2.posMax, - maxNesting = state2.md.options.maxNesting; - while (state2.pos < end) { - if (state2.level < maxNesting) { - for (i = 0; i < len; i++) { - ok = rules[i](state2, false); - if (ok) { - break; - } - } - } - if (ok) { - if (state2.pos >= end) { - break; - } - continue; - } - state2.pending += state2.src[state2.pos++]; - } - if (state2.pending) { - state2.pushPending(); - } - }; - ParserInline$1.prototype.parse = function (str, md, env, outTokens) { - var i, rules, len; - var state2 = new this.State(str, md, env, outTokens); - this.tokenize(state2); - rules = this.ruler2.getRules(""); - len = rules.length; - for (i = 0; i < len; i++) { - rules[i](state2); - } - }; - ParserInline$1.prototype.State = state_inline; - var parser_inline = ParserInline$1; - var re = /* @__PURE__ */__name(function (opts) { - var re2 = {}; - re2.src_Any = regex$3.source; - re2.src_Cc = regex$2.source; - re2.src_Z = regex.source; - re2.src_P = regex$4.source; - re2.src_ZPCc = [re2.src_Z, re2.src_P, re2.src_Cc].join("|"); - re2.src_ZCc = [re2.src_Z, re2.src_Cc].join("|"); - var text_separators = "[><\uFF5C]"; - re2.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re2.src_ZPCc + ")" + re2.src_Any + ")"; - re2.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; - re2.src_auth = "(?:(?:(?!" + re2.src_ZCc + "|[@/\\[\\]()]).)+@)?"; - re2.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"; - re2.src_host_terminator = "(?=$|" + text_separators + "|" + re2.src_ZPCc + ")(?!-|_|:\\d|\\.-|\\.(?!$|" + re2.src_ZPCc + "))"; - re2.src_path = "(?:[/?#](?:(?!" + re2.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re2.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re2.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re2.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re2.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re2.src_ZCc + "|[']).)+\\'|\\'(?=" + re2.src_pseudo_letter + "|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re2.src_ZCc + "|[.]).|" + (opts && opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + re2.src_ZCc + ").|;(?!" + re2.src_ZCc + ").|\\!+(?!" + re2.src_ZCc + "|[!]).|\\?(?!" + re2.src_ZCc + "|[?]).)+|\\/)?"; - re2.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; - re2.src_xn = "xn--[a-z0-9\\-]{1,59}"; - re2.src_domain_root = "(?:" + re2.src_xn + "|" + re2.src_pseudo_letter + "{1,63})"; - re2.src_domain = "(?:" + re2.src_xn + "|(?:" + re2.src_pseudo_letter + ")|(?:" + re2.src_pseudo_letter + "(?:-|" + re2.src_pseudo_letter + "){0,61}" + re2.src_pseudo_letter + "))"; - re2.src_host = "(?:(?:(?:(?:" + re2.src_domain + ")\\.)*" + re2.src_domain + "))"; - re2.tpl_host_fuzzy = "(?:" + re2.src_ip4 + "|(?:(?:(?:" + re2.src_domain + ")\\.)+(?:%TLDS%)))"; - re2.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re2.src_domain + ")\\.)+(?:%TLDS%))"; - re2.src_host_strict = re2.src_host + re2.src_host_terminator; - re2.tpl_host_fuzzy_strict = re2.tpl_host_fuzzy + re2.src_host_terminator; - re2.src_host_port_strict = re2.src_host + re2.src_port + re2.src_host_terminator; - re2.tpl_host_port_fuzzy_strict = re2.tpl_host_fuzzy + re2.src_port + re2.src_host_terminator; - re2.tpl_host_port_no_ip_fuzzy_strict = re2.tpl_host_no_ip_fuzzy + re2.src_port + re2.src_host_terminator; - re2.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re2.src_ZPCc + "|>|$))"; - re2.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re2.src_ZCc + ")(" + re2.src_email_name + "@" + re2.tpl_host_fuzzy_strict + ")"; - re2.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re2.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re2.tpl_host_port_fuzzy_strict + re2.src_path + ")"; - re2.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re2.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re2.tpl_host_port_no_ip_fuzzy_strict + re2.src_path + ")"; - return re2; - }, "re"); - function assign(obj) { - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; - } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - return obj; - } - __name(assign, "assign"); - function _class(obj) { - return Object.prototype.toString.call(obj); - } - __name(_class, "_class"); - function isString(obj) { - return _class(obj) === "[object String]"; - } - __name(isString, "isString"); - function isObject2(obj) { - return _class(obj) === "[object Object]"; - } - __name(isObject2, "isObject"); - function isRegExp(obj) { - return _class(obj) === "[object RegExp]"; - } - __name(isRegExp, "isRegExp"); - function isFunction(obj) { - return _class(obj) === "[object Function]"; - } - __name(isFunction, "isFunction"); - function escapeRE(str) { - return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); - } - __name(escapeRE, "escapeRE"); - var defaultOptions = { - fuzzyLink: true, - fuzzyEmail: true, - fuzzyIP: false - }; - function isOptionsObj(obj) { - return Object.keys(obj || {}).reduce(function (acc, k2) { - return acc || defaultOptions.hasOwnProperty(k2); - }, false); - } - __name(isOptionsObj, "isOptionsObj"); - var defaultSchemas = { - "http:": { - validate: function (text3, pos, self2) { - var tail = text3.slice(pos); - if (!self2.re.http) { - self2.re.http = new RegExp("^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path, "i"); - } - if (self2.re.http.test(tail)) { - return tail.match(self2.re.http)[0].length; - } - return 0; - } - }, - "https:": "http:", - "ftp:": "http:", - "//": { - validate: function (text3, pos, self2) { - var tail = text3.slice(pos); - if (!self2.re.no_http) { - self2.re.no_http = new RegExp("^" + self2.re.src_auth + "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path, "i"); - } - if (self2.re.no_http.test(tail)) { - if (pos >= 3 && text3[pos - 3] === ":") { - return 0; - } - if (pos >= 3 && text3[pos - 3] === "/") { - return 0; - } - return tail.match(self2.re.no_http)[0].length; - } - return 0; - } - }, - "mailto:": { - validate: function (text3, pos, self2) { - var tail = text3.slice(pos); - if (!self2.re.mailto) { - self2.re.mailto = new RegExp("^" + self2.re.src_email_name + "@" + self2.re.src_host_strict, "i"); - } - if (self2.re.mailto.test(tail)) { - return tail.match(self2.re.mailto)[0].length; - } - return 0; - } - } - }; - var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"; - var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|"); - function resetScanCache(self2) { - self2.__index__ = -1; - self2.__text_cache__ = ""; - } - __name(resetScanCache, "resetScanCache"); - function createValidator(re2) { - return function (text3, pos) { - var tail = text3.slice(pos); - if (re2.test(tail)) { - return tail.match(re2)[0].length; - } - return 0; - }; - } - __name(createValidator, "createValidator"); - function createNormalizer() { - return function (match2, self2) { - self2.normalize(match2); - }; - } - __name(createNormalizer, "createNormalizer"); - function compile(self2) { - var re$1 = self2.re = re(self2.__opts__); - var tlds2 = self2.__tlds__.slice(); - self2.onCompile(); - if (!self2.__tlds_replaced__) { - tlds2.push(tlds_2ch_src_re); - } - tlds2.push(re$1.src_xn); - re$1.src_tlds = tlds2.join("|"); - function untpl(tpl) { - return tpl.replace("%TLDS%", re$1.src_tlds); - } - __name(untpl, "untpl"); - re$1.email_fuzzy = RegExp(untpl(re$1.tpl_email_fuzzy), "i"); - re$1.link_fuzzy = RegExp(untpl(re$1.tpl_link_fuzzy), "i"); - re$1.link_no_ip_fuzzy = RegExp(untpl(re$1.tpl_link_no_ip_fuzzy), "i"); - re$1.host_fuzzy_test = RegExp(untpl(re$1.tpl_host_fuzzy_test), "i"); - var aliases = []; - self2.__compiled__ = {}; - function schemaError(name2, val) { - throw new Error('(LinkifyIt) Invalid schema "' + name2 + '": ' + val); - } - __name(schemaError, "schemaError"); - Object.keys(self2.__schemas__).forEach(function (name2) { - var val = self2.__schemas__[name2]; - if (val === null) { - return; - } - var compiled = { - validate: null, - link: null - }; - self2.__compiled__[name2] = compiled; - if (isObject2(val)) { - if (isRegExp(val.validate)) { - compiled.validate = createValidator(val.validate); - } else if (isFunction(val.validate)) { - compiled.validate = val.validate; - } else { - schemaError(name2, val); - } - if (isFunction(val.normalize)) { - compiled.normalize = val.normalize; - } else if (!val.normalize) { - compiled.normalize = createNormalizer(); - } else { - schemaError(name2, val); - } - return; - } - if (isString(val)) { - aliases.push(name2); - return; - } - schemaError(name2, val); - }); - aliases.forEach(function (alias) { - if (!self2.__compiled__[self2.__schemas__[alias]]) { - return; - } - self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate; - self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize; - }); - self2.__compiled__[""] = { - validate: null, - normalize: createNormalizer() - }; - var slist = Object.keys(self2.__compiled__).filter(function (name2) { - return name2.length > 0 && self2.__compiled__[name2]; - }).map(escapeRE).join("|"); - self2.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re$1.src_ZPCc + "))(" + slist + ")", "i"); - self2.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re$1.src_ZPCc + "))(" + slist + ")", "ig"); - self2.re.pretest = RegExp("(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@", "i"); - resetScanCache(self2); - } - __name(compile, "compile"); - function Match(self2, shift) { - var start = self2.__index__, - end = self2.__last_index__, - text3 = self2.__text_cache__.slice(start, end); - this.schema = self2.__schema__.toLowerCase(); - this.index = start + shift; - this.lastIndex = end + shift; - this.raw = text3; - this.text = text3; - this.url = text3; - } - __name(Match, "Match"); - function createMatch(self2, shift) { - var match2 = new Match(self2, shift); - self2.__compiled__[match2.schema].normalize(match2, self2); - return match2; - } - __name(createMatch, "createMatch"); - function LinkifyIt$1(schemas, options) { - if (!(this instanceof LinkifyIt$1)) { - return new LinkifyIt$1(schemas, options); - } - if (!options) { - if (isOptionsObj(schemas)) { - options = schemas; - schemas = {}; - } - } - this.__opts__ = assign({}, defaultOptions, options); - this.__index__ = -1; - this.__last_index__ = -1; - this.__schema__ = ""; - this.__text_cache__ = ""; - this.__schemas__ = assign({}, defaultSchemas, schemas); - this.__compiled__ = {}; - this.__tlds__ = tlds_default; - this.__tlds_replaced__ = false; - this.re = {}; - compile(this); - } - __name(LinkifyIt$1, "LinkifyIt$1"); - LinkifyIt$1.prototype.add = /* @__PURE__ */__name(function add(schema, definition) { - this.__schemas__[schema] = definition; - compile(this); - return this; - }, "add"); - LinkifyIt$1.prototype.set = /* @__PURE__ */__name(function set(options) { - this.__opts__ = assign(this.__opts__, options); - return this; - }, "set"); - LinkifyIt$1.prototype.test = /* @__PURE__ */__name(function test(text3) { - this.__text_cache__ = text3; - this.__index__ = -1; - if (!text3.length) { - return false; - } - var m2, ml, me, len, shift, next, re2, tld_pos, at_pos; - if (this.re.schema_test.test(text3)) { - re2 = this.re.schema_search; - re2.lastIndex = 0; - while ((m2 = re2.exec(text3)) !== null) { - len = this.testSchemaAt(text3, m2[2], re2.lastIndex); - if (len) { - this.__schema__ = m2[2]; - this.__index__ = m2.index + m2[1].length; - this.__last_index__ = m2.index + m2[0].length + len; - break; - } - } - } - if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) { - tld_pos = text3.search(this.re.host_fuzzy_test); - if (tld_pos >= 0) { - if (this.__index__ < 0 || tld_pos < this.__index__) { - if ((ml = text3.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { - shift = ml.index + ml[1].length; - if (this.__index__ < 0 || shift < this.__index__) { - this.__schema__ = ""; - this.__index__ = shift; - this.__last_index__ = ml.index + ml[0].length; - } - } - } - } - } - if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) { - at_pos = text3.indexOf("@"); - if (at_pos >= 0) { - if ((me = text3.match(this.re.email_fuzzy)) !== null) { - shift = me.index + me[1].length; - next = me.index + me[0].length; - if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { - this.__schema__ = "mailto:"; - this.__index__ = shift; - this.__last_index__ = next; - } - } - } - } - return this.__index__ >= 0; - }, "test"); - LinkifyIt$1.prototype.pretest = /* @__PURE__ */__name(function pretest(text3) { - return this.re.pretest.test(text3); - }, "pretest"); - LinkifyIt$1.prototype.testSchemaAt = /* @__PURE__ */__name(function testSchemaAt(text3, schema, pos) { - if (!this.__compiled__[schema.toLowerCase()]) { - return 0; - } - return this.__compiled__[schema.toLowerCase()].validate(text3, pos, this); - }, "testSchemaAt"); - LinkifyIt$1.prototype.match = /* @__PURE__ */__name(function match(text3) { - var shift = 0, - result = []; - if (this.__index__ >= 0 && this.__text_cache__ === text3) { - result.push(createMatch(this, shift)); - shift = this.__last_index__; - } - var tail = shift ? text3.slice(shift) : text3; - while (this.test(tail)) { - result.push(createMatch(this, shift)); - tail = tail.slice(this.__last_index__); - shift += this.__last_index__; - } - if (result.length) { - return result; - } - return null; - }, "match"); - LinkifyIt$1.prototype.tlds = /* @__PURE__ */__name(function tlds(list3, keepOld) { - list3 = Array.isArray(list3) ? list3 : [list3]; - if (!keepOld) { - this.__tlds__ = list3.slice(); - this.__tlds_replaced__ = true; - compile(this); - return this; - } - this.__tlds__ = this.__tlds__.concat(list3).sort().filter(function (el2, idx, arr) { - return el2 !== arr[idx - 1]; - }).reverse(); - compile(this); - return this; - }, "tlds"); - LinkifyIt$1.prototype.normalize = /* @__PURE__ */__name(function normalize3(match2) { - if (!match2.schema) { - match2.url = "http://" + match2.url; - } - if (match2.schema === "mailto:" && !/^mailto:/i.test(match2.url)) { - match2.url = "mailto:" + match2.url; - } - }, "normalize"); - LinkifyIt$1.prototype.onCompile = /* @__PURE__ */__name(function onCompile() {}, "onCompile"); - var linkifyIt = LinkifyIt$1; - const maxInt = 2147483647; - const base = 36; - const tMin = 1; - const tMax = 26; - const skew = 38; - const damp = 700; - const initialBias = 72; - const initialN = 128; - const delimiter = "-"; - const regexPunycode = /^xn--/; - const regexNonASCII = /[^\0-\x7E]/; - const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; - const errors = { - "overflow": "Overflow: input needs wider integers to process", - "not-basic": "Illegal input >= 0x80 (not a basic code point)", - "invalid-input": "Invalid input" - }; - const baseMinusTMin = base - tMin; - const floor = Math.floor; - const stringFromCharCode = String.fromCharCode; - function error(type2) { - throw new RangeError(errors[type2]); - } - __name(error, "error"); - function map(array, fn) { - const result = []; - let length = array.length; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - __name(map, "map"); - function mapDomain(string, fn) { - const parts = string.split("@"); - let result = ""; - if (parts.length > 1) { - result = parts[0] + "@"; - string = parts[1]; - } - string = string.replace(regexSeparators, "."); - const labels = string.split("."); - const encoded = map(labels, fn).join("."); - return result + encoded; - } - __name(mapDomain, "mapDomain"); - function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value3 = string.charCodeAt(counter++); - if (value3 >= 55296 && value3 <= 56319 && counter < length) { - const extra = string.charCodeAt(counter++); - if ((extra & 64512) == 56320) { - output.push(((value3 & 1023) << 10) + (extra & 1023) + 65536); - } else { - output.push(value3); - counter--; - } - } else { - output.push(value3); - } - } - return output; - } - __name(ucs2decode, "ucs2decode"); - const ucs2encode = /* @__PURE__ */__name(array => String.fromCodePoint(...array), "ucs2encode"); - const basicToDigit = /* @__PURE__ */__name(function (codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - }, "basicToDigit"); - const digitToBasic = /* @__PURE__ */__name(function (digit, flag) { - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - }, "digitToBasic"); - const adapt = /* @__PURE__ */__name(function (delta2, numPoints, firstTime) { - let k2 = 0; - delta2 = firstTime ? floor(delta2 / damp) : delta2 >> 1; - delta2 += floor(delta2 / numPoints); - for (; delta2 > baseMinusTMin * tMax >> 1; k2 += base) { - delta2 = floor(delta2 / baseMinusTMin); - } - return floor(k2 + (baseMinusTMin + 1) * delta2 / (delta2 + skew)); - }, "adapt"); - const decode = /* @__PURE__ */__name(function (input) { - const output = []; - const inputLength = input.length; - let i = 0; - let n2 = initialN; - let bias = initialBias; - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - for (let j = 0; j < basic; ++j) { - if (input.charCodeAt(j) >= 128) { - error("not-basic"); - } - output.push(input.charCodeAt(j)); - } - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength;) { - let oldi = i; - for (let w2 = 1, k2 = base;; k2 += base) { - if (index >= inputLength) { - error("invalid-input"); - } - const digit = basicToDigit(input.charCodeAt(index++)); - if (digit >= base || digit > floor((maxInt - i) / w2)) { - error("overflow"); - } - i += digit * w2; - const t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias; - if (digit < t2) { - break; - } - const baseMinusT = base - t2; - if (w2 > floor(maxInt / baseMinusT)) { - error("overflow"); - } - w2 *= baseMinusT; - } - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - if (floor(i / out) > maxInt - n2) { - error("overflow"); - } - n2 += floor(i / out); - i %= out; - output.splice(i++, 0, n2); - } - return String.fromCodePoint(...output); - }, "decode"); - const encode = /* @__PURE__ */__name(function (input) { - const output = []; - input = ucs2decode(input); - let inputLength = input.length; - let n2 = initialN; - let delta2 = 0; - let bias = initialBias; - for (const currentValue of input) { - if (currentValue < 128) { - output.push(stringFromCharCode(currentValue)); - } - } - let basicLength = output.length; - let handledCPCount = basicLength; - if (basicLength) { - output.push(delimiter); - } - while (handledCPCount < inputLength) { - let m2 = maxInt; - for (const currentValue of input) { - if (currentValue >= n2 && currentValue < m2) { - m2 = currentValue; - } - } - const handledCPCountPlusOne = handledCPCount + 1; - if (m2 - n2 > floor((maxInt - delta2) / handledCPCountPlusOne)) { - error("overflow"); - } - delta2 += (m2 - n2) * handledCPCountPlusOne; - n2 = m2; - for (const currentValue of input) { - if (currentValue < n2 && ++delta2 > maxInt) { - error("overflow"); - } - if (currentValue == n2) { - let q2 = delta2; - for (let k2 = base;; k2 += base) { - const t2 = k2 <= bias ? tMin : k2 >= bias + tMax ? tMax : k2 - bias; - if (q2 < t2) { - break; - } - const qMinusT = q2 - t2; - const baseMinusT = base - t2; - output.push(stringFromCharCode(digitToBasic(t2 + qMinusT % baseMinusT, 0))); - q2 = floor(qMinusT / baseMinusT); - } - output.push(stringFromCharCode(digitToBasic(q2, 0))); - bias = adapt(delta2, handledCPCountPlusOne, handledCPCount == basicLength); - delta2 = 0; - ++handledCPCount; - } - } - ++delta2; - ++n2; - } - return output.join(""); - }, "encode"); - const toUnicode = /* @__PURE__ */__name(function (input) { - return mapDomain(input, function (string) { - return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; - }); - }, "toUnicode"); - const toASCII = /* @__PURE__ */__name(function (input) { - return mapDomain(input, function (string) { - return regexNonASCII.test(string) ? "xn--" + encode(string) : string; - }); - }, "toASCII"); - const punycode$1 = { - "version": "2.1.0", - "ucs2": { - "decode": ucs2decode, - "encode": ucs2encode - }, - "decode": decode, - "encode": encode, - "toASCII": toASCII, - "toUnicode": toUnicode - }; - var punycode_es6 = /* @__PURE__ */Object.freeze( /* @__PURE__ */Object.defineProperty({ - __proto__: null, - ucs2decode, - ucs2encode, - decode, - encode, - toASCII, - toUnicode, - "default": punycode$1 - }, Symbol.toStringTag, { - value: "Module" - })); - var require$$8 = /* @__PURE__ */getAugmentedNamespace(punycode_es6); - var _default = { - options: { - html: false, - xhtmlOut: false, - breaks: false, - langPrefix: "language-", - linkify: false, - typographer: false, - quotes: "\u201C\u201D\u2018\u2019", - highlight: null, - maxNesting: 100 - }, - components: { - core: {}, - block: {}, - inline: {} - } - }; - var zero = { - options: { - html: false, - xhtmlOut: false, - breaks: false, - langPrefix: "language-", - linkify: false, - typographer: false, - quotes: "\u201C\u201D\u2018\u2019", - highlight: null, - maxNesting: 20 - }, - components: { - core: { - rules: ["normalize", "block", "inline"] - }, - block: { - rules: ["paragraph"] - }, - inline: { - rules: ["text"], - rules2: ["balance_pairs", "text_collapse"] - } - } - }; - var commonmark = { - options: { - html: true, - xhtmlOut: true, - breaks: false, - langPrefix: "language-", - linkify: false, - typographer: false, - quotes: "\u201C\u201D\u2018\u2019", - highlight: null, - maxNesting: 20 - }, - components: { - core: { - rules: ["normalize", "block", "inline"] - }, - block: { - rules: ["blockquote", "code", "fence", "heading", "hr", "html_block", "lheading", "list", "reference", "paragraph"] - }, - inline: { - rules: ["autolink", "backticks", "emphasis", "entity", "escape", "html_inline", "image", "link", "newline", "text"], - rules2: ["balance_pairs", "emphasis", "text_collapse"] - } - } - }; - var utils = utils$1; - var helpers = helpers$1; - var Renderer = renderer; - var ParserCore = parser_core; - var ParserBlock = parser_block; - var ParserInline = parser_inline; - var LinkifyIt = linkifyIt; - var mdurl = mdurl$1; - var punycode = require$$8; - var config = { - default: _default, - zero, - commonmark - }; - var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/; - var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; - function validateLink(url) { - var str = url.trim().toLowerCase(); - return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) ? true : false : true; - } - __name(validateLink, "validateLink"); - var RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"]; - function normalizeLink(url) { - var parsed = mdurl.parse(url, true); - if (parsed.hostname) { - if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { - try { - parsed.hostname = punycode.toASCII(parsed.hostname); - } catch (er) {} - } - } - return mdurl.encode(mdurl.format(parsed)); - } - __name(normalizeLink, "normalizeLink"); - function normalizeLinkText(url) { - var parsed = mdurl.parse(url, true); - if (parsed.hostname) { - if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { - try { - parsed.hostname = punycode.toUnicode(parsed.hostname); - } catch (er) {} - } - } - return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%"); - } - __name(normalizeLinkText, "normalizeLinkText"); - function MarkdownIt(presetName, options) { - if (!(this instanceof MarkdownIt)) { - return new MarkdownIt(presetName, options); - } - if (!options) { - if (!utils.isString(presetName)) { - options = presetName || {}; - presetName = "default"; - } - } - this.inline = new ParserInline(); - this.block = new ParserBlock(); - this.core = new ParserCore(); - this.renderer = new Renderer(); - this.linkify = new LinkifyIt(); - this.validateLink = validateLink; - this.normalizeLink = normalizeLink; - this.normalizeLinkText = normalizeLinkText; - this.utils = utils; - this.helpers = utils.assign({}, helpers); - this.options = {}; - this.configure(presetName); - if (options) { - this.set(options); - } - } - __name(MarkdownIt, "MarkdownIt"); - MarkdownIt.prototype.set = function (options) { - utils.assign(this.options, options); - return this; - }; - MarkdownIt.prototype.configure = function (presets) { - var self2 = this, - presetName; - if (utils.isString(presets)) { - presetName = presets; - presets = config[presetName]; - if (!presets) { - throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); - } - } - if (!presets) { - throw new Error("Wrong `markdown-it` preset, can't be empty"); - } - if (presets.options) { - self2.set(presets.options); - } - if (presets.components) { - Object.keys(presets.components).forEach(function (name2) { - if (presets.components[name2].rules) { - self2[name2].ruler.enableOnly(presets.components[name2].rules); - } - if (presets.components[name2].rules2) { - self2[name2].ruler2.enableOnly(presets.components[name2].rules2); - } - }); - } - return this; - }; - MarkdownIt.prototype.enable = function (list3, ignoreInvalid) { - var result = []; - if (!Array.isArray(list3)) { - list3 = [list3]; - } - ["core", "block", "inline"].forEach(function (chain) { - result = result.concat(this[chain].ruler.enable(list3, true)); - }, this); - result = result.concat(this.inline.ruler2.enable(list3, true)); - var missed = list3.filter(function (name2) { - return result.indexOf(name2) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed); - } - return this; - }; - MarkdownIt.prototype.disable = function (list3, ignoreInvalid) { - var result = []; - if (!Array.isArray(list3)) { - list3 = [list3]; - } - ["core", "block", "inline"].forEach(function (chain) { - result = result.concat(this[chain].ruler.disable(list3, true)); - }, this); - result = result.concat(this.inline.ruler2.disable(list3, true)); - var missed = list3.filter(function (name2) { - return result.indexOf(name2) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed); - } - return this; - }; - MarkdownIt.prototype.use = function (plugin) { - var args = [this].concat(Array.prototype.slice.call(arguments, 1)); - plugin.apply(plugin, args); - return this; - }; - MarkdownIt.prototype.parse = function (src, env) { - if (typeof src !== "string") { - throw new Error("Input data should be a String"); - } - var state2 = new this.core.State(src, this, env); - this.core.process(state2); - return state2.tokens; - }; - MarkdownIt.prototype.render = function (src, env) { - env = env || {}; - return this.renderer.render(this.parse(src, env), this.options, env); - }; - MarkdownIt.prototype.parseInline = function (src, env) { - var state2 = new this.core.State(src, this, env); - state2.inlineMode = true; - this.core.process(state2); - return state2.tokens; - }; - MarkdownIt.prototype.renderInline = function (src, env) { - env = env || {}; - return this.renderer.render(this.parseInline(src, env), this.options, env); - }; - var lib = MarkdownIt; - var markdownIt = lib; - const markdown$1 = new markdownIt({ - breaks: true, - linkify: true - }); - var markdown = /* @__PURE__ */(() => ":is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) blockquote{margin-left:0;margin-right:0;padding-left:var(--px-8)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) code,:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre{border-radius:var(--border-radius-4);font-family:var(--font-family-mono);font-size:var(--font-size-inline-code)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) code{padding:var(--px-2)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre{overflow:auto;padding:var(--px-6) var(--px-8)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre code{background-color:initial;border-radius:0;padding:0}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ol,:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ul{padding-left:var(--px-16)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ol{list-style-type:decimal}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ul{list-style-type:disc}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) img{border-radius:var(--border-radius-4);max-height:120px;max-width:100%}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation)>:first-child{margin-top:0}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation)>:last-child{margin-bottom:0}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) a{color:hsl(var(--color-primary));text-decoration:none}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) a:hover{text-decoration:underline}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) blockquote{border-left:1.5px solid hsla(var(--color-neutral),var(--alpha-tertiary))}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) code,:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) pre{background-color:hsla(var(--color-neutral),var(--alpha-background-light));color:hsla(var(--color-neutral),1)}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description)>*{margin:var(--px-12) 0}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) a{color:hsl(var(--color-warning));text-decoration:underline}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) blockquote{border-left:1.5px solid hsl(var(--color-warning))}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) code,:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) pre{background-color:hsla(var(--color-warning),var(--alpha-background-heavy))}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation)>*{margin:var(--px-8) 0}.graphiql-markdown-preview>:not(:first-child){display:none}.CodeMirror-hint-information-deprecation,.CodeMirror-info .info-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--border-radius-4);color:hsl(var(--color-warning));margin-top:var(--px-12);padding:var(--px-6) var(--px-8)}.CodeMirror-hint-information-deprecation-label,.CodeMirror-info .info-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation-reason{margin-top:var(--px-6)}\n")(); - const MarkdownContent = /*#__PURE__*/(0, React.forwardRef)((_ga, ref) => { - var _ha = _ga, - { - children, - onlyShowFirstChild, - type: type2 - } = _ha, - props2 = __objRest(_ha, ["children", "onlyShowFirstChild", "type"]); - return /* @__PURE__ */jsx("div", __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx(`graphiql-markdown-${type2}`, onlyShowFirstChild && "graphiql-markdown-preview", props2.className), - dangerouslySetInnerHTML: { - __html: markdown$1.render(children) - } - })); - }); - _exports.aM = MarkdownContent; - MarkdownContent.displayName = "MarkdownContent"; - var spinner = /* @__PURE__ */(() => '.graphiql-spinner{height:56px;margin:auto;margin-top:var(--px-16);width:56px}.graphiql-spinner:after{animation:rotation .8s linear 0s infinite;border:4px solid transparent;border-radius:100%;border-top:4px solid hsla(var(--color-neutral),var(--alpha-tertiary));content:"";display:inline-block;height:46px;vertical-align:middle;width:46px}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n')(); - const Spinner = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx("div", __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-spinner", props2.className) - }))); - _exports.aN = Spinner; - Spinner.displayName = "Spinner"; - var tooltip = /* @__PURE__ */(() => ":root{--reach-tooltip: 1}[data-reach-tooltip]{z-index:1;pointer-events:none;position:absolute;padding:.25em .5em;box-shadow:2px 2px 10px #0000001a;white-space:nowrap;font-size:85%;background:#f0f0f0;color:#444;border:solid 1px #ccc}[data-reach-tooltip]{background:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-4);box-shadow:var(--popover-box-shadow);color:hsl(var(--color-neutral));font-size:inherit;padding:var(--px-4) var(--px-6)}\n")(); - function getDocumentDimensions(element) { - var _ownerDocument$docume, _ownerDocument$docume2; - var ownerDocument = getOwnerDocument(element); - var ownerWindow = ownerDocument.defaultView || window; - if (!ownerDocument) { - return { - width: 0, - height: 0 - }; - } - return { - width: (_ownerDocument$docume = ownerDocument.documentElement.clientWidth) != null ? _ownerDocument$docume : ownerWindow.innerWidth, - height: (_ownerDocument$docume2 = ownerDocument.documentElement.clientHeight) != null ? _ownerDocument$docume2 : ownerWindow.innerHeight - }; - } - __name(getDocumentDimensions, "getDocumentDimensions"); - function _extends$1() { - _extends$1 = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends$1.apply(this, arguments); - } - __name(_extends$1, "_extends$1"); - function _objectWithoutPropertiesLoose$1(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose$1, "_objectWithoutPropertiesLoose$1"); - var _excluded$1 = ["children", "label", "ariaLabel", "id", "DEBUG_STYLE"], - _excluded2$1 = ["label", "ariaLabel", "isVisible", "id"], - _excluded3$1 = ["ariaLabel", "aria-label", "as", "id", "isVisible", "label", "position", "style", "triggerRect"], - _excluded4$1 = ["type"]; - var _on$1, _on2$1, _on3$1, _on4$1, _on5, _states$1; - var MOUSE_REST_TIMEOUT = 100; - var LEAVE_TIMEOUT = 500; - var TooltipStates; - (function (TooltipStates2) { - TooltipStates2["Idle"] = "IDLE"; - TooltipStates2["Focused"] = "FOCUSED"; - TooltipStates2["Visible"] = "VISIBLE"; - TooltipStates2["LeavingVisible"] = "LEAVING_VISIBLE"; - TooltipStates2["Dismissed"] = "DISMISSED"; - })(TooltipStates || (TooltipStates = {})); - var TooltipEvents; - (function (TooltipEvents2) { - TooltipEvents2["Blur"] = "BLUR"; - TooltipEvents2["Focus"] = "FOCUS"; - TooltipEvents2["GlobalMouseMove"] = "GLOBAL_MOUSE_MOVE"; - TooltipEvents2["MouseDown"] = "MOUSE_DOWN"; - TooltipEvents2["MouseEnter"] = "MOUSE_ENTER"; - TooltipEvents2["MouseLeave"] = "MOUSE_LEAVE"; - TooltipEvents2["MouseMove"] = "MOUSE_MOVE"; - TooltipEvents2["Rest"] = "REST"; - TooltipEvents2["SelectWithKeyboard"] = "SELECT_WITH_KEYBOARD"; - TooltipEvents2["TimeComplete"] = "TIME_COMPLETE"; - })(TooltipEvents || (TooltipEvents = {})); - var chart = { - initial: TooltipStates.Idle, - states: (_states$1 = {}, _states$1[TooltipStates.Idle] = { - enter: clearContextId, - on: (_on$1 = {}, _on$1[TooltipEvents.MouseEnter] = TooltipStates.Focused, _on$1[TooltipEvents.Focus] = TooltipStates.Visible, _on$1) - }, _states$1[TooltipStates.Focused] = { - enter: startRestTimer, - leave: clearRestTimer, - on: (_on2$1 = {}, _on2$1[TooltipEvents.MouseMove] = TooltipStates.Focused, _on2$1[TooltipEvents.MouseLeave] = TooltipStates.Idle, _on2$1[TooltipEvents.MouseDown] = TooltipStates.Dismissed, _on2$1[TooltipEvents.Blur] = TooltipStates.Idle, _on2$1[TooltipEvents.Rest] = TooltipStates.Visible, _on2$1) - }, _states$1[TooltipStates.Visible] = { - on: (_on3$1 = {}, _on3$1[TooltipEvents.Focus] = TooltipStates.Focused, _on3$1[TooltipEvents.MouseEnter] = TooltipStates.Focused, _on3$1[TooltipEvents.MouseLeave] = TooltipStates.LeavingVisible, _on3$1[TooltipEvents.Blur] = TooltipStates.LeavingVisible, _on3$1[TooltipEvents.MouseDown] = TooltipStates.Dismissed, _on3$1[TooltipEvents.SelectWithKeyboard] = TooltipStates.Dismissed, _on3$1[TooltipEvents.GlobalMouseMove] = TooltipStates.LeavingVisible, _on3$1) - }, _states$1[TooltipStates.LeavingVisible] = { - enter: startLeavingVisibleTimer, - leave: /* @__PURE__ */__name(function leave() { - clearLeavingVisibleTimer(); - clearContextId(); - }, "leave"), - on: (_on4$1 = {}, _on4$1[TooltipEvents.MouseEnter] = TooltipStates.Visible, _on4$1[TooltipEvents.Focus] = TooltipStates.Visible, _on4$1[TooltipEvents.TimeComplete] = TooltipStates.Idle, _on4$1) - }, _states$1[TooltipStates.Dismissed] = { - leave: /* @__PURE__ */__name(function leave2() { - clearContextId(); - }, "leave"), - on: (_on5 = {}, _on5[TooltipEvents.MouseLeave] = TooltipStates.Idle, _on5[TooltipEvents.Blur] = TooltipStates.Idle, _on5) - }, _states$1) - }; - var state = { - value: chart.initial, - context: { - id: null - } - }; - var subscriptions = []; - function subscribe(fn) { - subscriptions.push(fn); - return function () { - subscriptions.splice(subscriptions.indexOf(fn), 1); - }; - } - __name(subscribe, "subscribe"); - function notify() { - subscriptions.forEach(function (fn) { - return fn(state); - }); - } - __name(notify, "notify"); - var restTimeout; - function startRestTimer() { - window.clearTimeout(restTimeout); - restTimeout = window.setTimeout(function () { - send({ - type: TooltipEvents.Rest - }); - }, MOUSE_REST_TIMEOUT); - } - __name(startRestTimer, "startRestTimer"); - function clearRestTimer() { - window.clearTimeout(restTimeout); - } - __name(clearRestTimer, "clearRestTimer"); - var leavingVisibleTimer; - function startLeavingVisibleTimer() { - window.clearTimeout(leavingVisibleTimer); - leavingVisibleTimer = window.setTimeout(function () { - return send({ - type: TooltipEvents.TimeComplete - }); - }, LEAVE_TIMEOUT); - } - __name(startLeavingVisibleTimer, "startLeavingVisibleTimer"); - function clearLeavingVisibleTimer() { - window.clearTimeout(leavingVisibleTimer); - } - __name(clearLeavingVisibleTimer, "clearLeavingVisibleTimer"); - function clearContextId() { - state.context.id = null; - } - __name(clearContextId, "clearContextId"); - function useTooltip(_temp) { - var _ref2 = _temp === void 0 ? {} : _temp, - idProp = _ref2.id, - onPointerEnter = _ref2.onPointerEnter, - onPointerMove = _ref2.onPointerMove, - onPointerLeave = _ref2.onPointerLeave, - onPointerDown = _ref2.onPointerDown, - onMouseEnter = _ref2.onMouseEnter, - onMouseMove = _ref2.onMouseMove, - onMouseLeave = _ref2.onMouseLeave, - onMouseDown = _ref2.onMouseDown, - onFocus3 = _ref2.onFocus, - onBlur3 = _ref2.onBlur, - onKeyDown = _ref2.onKeyDown, - disabled = _ref2.disabled, - forwardedRef = _ref2.ref, - DEBUG_STYLE = _ref2.DEBUG_STYLE; - var id2 = String(useId(idProp)); - var _React$useState = (0, React.useState)(DEBUG_STYLE ? true : isTooltipVisible(id2, true)), - isVisible = _React$useState[0], - setIsVisible = _React$useState[1]; - var ownRef = (0, React.useRef)(null); - var ref = useComposedRefs(forwardedRef, ownRef); - var triggerRect = useRect(ownRef, { - observe: isVisible - }); - (0, React.useEffect)(function () { - return subscribe(function () { - setIsVisible(isTooltipVisible(id2)); - }); - }, [id2]); - (0, React.useEffect)(function () { - var ownerDocument = getOwnerDocument(ownRef.current); - function listener(event) { - if ((event.key === "Escape" || event.key === "Esc") && state.value === TooltipStates.Visible) { - send({ - type: TooltipEvents.SelectWithKeyboard - }); - } - } - __name(listener, "listener"); - ownerDocument.addEventListener("keydown", listener); - return function () { - return ownerDocument.removeEventListener("keydown", listener); - }; - }, []); - useDisabledTriggerOnSafari({ - disabled, - isVisible, - ref: ownRef - }); - function wrapMouseEvent(theirHandler, ourHandler) { - if (typeof window !== "undefined" && "PointerEvent" in window) { - return theirHandler; - } - return composeEventHandlers(theirHandler, ourHandler); - } - __name(wrapMouseEvent, "wrapMouseEvent"); - function wrapPointerEventHandler(handler) { - return /* @__PURE__ */__name(function onPointerEvent(event) { - if (event.pointerType !== "mouse") { - return; - } - handler(event); - }, "onPointerEvent"); - } - __name(wrapPointerEventHandler, "wrapPointerEventHandler"); - function handleMouseEnter() { - send({ - type: TooltipEvents.MouseEnter, - id: id2 - }); - } - __name(handleMouseEnter, "handleMouseEnter"); - function handleMouseMove() { - send({ - type: TooltipEvents.MouseMove, - id: id2 - }); - } - __name(handleMouseMove, "handleMouseMove"); - function handleMouseLeave() { - send({ - type: TooltipEvents.MouseLeave - }); - } - __name(handleMouseLeave, "handleMouseLeave"); - function handleMouseDown() { - if (state.context.id === id2) { - send({ - type: TooltipEvents.MouseDown - }); - } - } - __name(handleMouseDown, "handleMouseDown"); - function handleFocus() { - if (window.__REACH_DISABLE_TOOLTIPS) { - return; - } - send({ - type: TooltipEvents.Focus, - id: id2 - }); - } - __name(handleFocus, "handleFocus"); - function handleBlur() { - if (state.context.id === id2) { - send({ - type: TooltipEvents.Blur - }); - } - } - __name(handleBlur, "handleBlur"); - function handleKeyDown(event) { - if (event.key === "Enter" || event.key === " ") { - send({ - type: TooltipEvents.SelectWithKeyboard - }); - } - } - __name(handleKeyDown, "handleKeyDown"); - var trigger = { - "aria-describedby": isVisible ? makeId("tooltip", id2) : void 0, - "data-state": isVisible ? "tooltip-visible" : "tooltip-hidden", - "data-reach-tooltip-trigger": "", - ref, - onPointerEnter: composeEventHandlers(onPointerEnter, wrapPointerEventHandler(handleMouseEnter)), - onPointerMove: composeEventHandlers(onPointerMove, wrapPointerEventHandler(handleMouseMove)), - onPointerLeave: composeEventHandlers(onPointerLeave, wrapPointerEventHandler(handleMouseLeave)), - onPointerDown: composeEventHandlers(onPointerDown, wrapPointerEventHandler(handleMouseDown)), - onMouseEnter: wrapMouseEvent(onMouseEnter, handleMouseEnter), - onMouseMove: wrapMouseEvent(onMouseMove, handleMouseMove), - onMouseLeave: wrapMouseEvent(onMouseLeave, handleMouseLeave), - onMouseDown: wrapMouseEvent(onMouseDown, handleMouseDown), - onFocus: composeEventHandlers(onFocus3, handleFocus), - onBlur: composeEventHandlers(onBlur3, handleBlur), - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown) - }; - var tooltip2 = { - id: id2, - triggerRect, - isVisible - }; - return [trigger, tooltip2, isVisible]; - } - __name(useTooltip, "useTooltip"); - var Tooltip = /* @__PURE__ */(0, React.forwardRef)(function (_ref2, forwardedRef) { - var children = _ref2.children, - label = _ref2.label, - DEPRECATED_ariaLabel = _ref2.ariaLabel, - id2 = _ref2.id, - DEBUG_STYLE = _ref2.DEBUG_STYLE, - props2 = _objectWithoutPropertiesLoose$1(_ref2, _excluded$1); - var child = React.Children.only(children); - var _useTooltip = useTooltip({ - id: id2, - onPointerEnter: child.props.onPointerEnter, - onPointerMove: child.props.onPointerMove, - onPointerLeave: child.props.onPointerLeave, - onPointerDown: child.props.onPointerDown, - onMouseEnter: child.props.onMouseEnter, - onMouseMove: child.props.onMouseMove, - onMouseLeave: child.props.onMouseLeave, - onMouseDown: child.props.onMouseDown, - onFocus: child.props.onFocus, - onBlur: child.props.onBlur, - onKeyDown: child.props.onKeyDown, - disabled: child.props.disabled, - ref: child.ref, - DEBUG_STYLE - }), - trigger = _useTooltip[0], - tooltip2 = _useTooltip[1]; - return /* @__PURE__ */(0, React.createElement)(React.Fragment, null, /* @__PURE__ */(0, React.cloneElement)(child, trigger), /* @__PURE__ */(0, React.createElement)(TooltipPopup, _extends$1({ - ref: forwardedRef, - label, - "aria-label": DEPRECATED_ariaLabel - }, tooltip2, props2))); - }); - _exports.aQ = Tooltip; - var TooltipPopup = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function TooltipPopup2(_ref3, forwardRef2) { - var label = _ref3.label, - DEPRECATED_ariaLabel = _ref3.ariaLabel, - isVisible = _ref3.isVisible, - id2 = _ref3.id, - props2 = _objectWithoutPropertiesLoose$1(_ref3, _excluded2$1); - return isVisible ? /* @__PURE__ */(0, React.createElement)(Portal, null, /* @__PURE__ */(0, React.createElement)(TooltipContent, _extends$1({ - ref: forwardRef2, - label, - "aria-label": DEPRECATED_ariaLabel, - isVisible - }, props2, { - id: makeId("tooltip", String(id2)) - }))) : null; - }, "TooltipPopup")); - var TooltipContent = /* @__PURE__ */(0, React.forwardRef)( /* @__PURE__ */__name(function TooltipContent2(_ref4, forwardedRef) { - var ariaLabel = _ref4.ariaLabel, - realAriaLabel = _ref4["aria-label"], - _ref4$as = _ref4.as, - Comp = _ref4$as === void 0 ? "div" : _ref4$as, - id2 = _ref4.id, - isVisible = _ref4.isVisible, - label = _ref4.label, - _ref4$position = _ref4.position, - position = _ref4$position === void 0 ? positionTooltip : _ref4$position, - style2 = _ref4.style, - triggerRect = _ref4.triggerRect, - props2 = _objectWithoutPropertiesLoose$1(_ref4, _excluded3$1); - var hasAriaLabel = (realAriaLabel || ariaLabel) != null; - var ownRef = (0, React.useRef)(null); - var ref = useComposedRefs(forwardedRef, ownRef); - var tooltipRect = useRect(ownRef, { - observe: isVisible - }); - return /* @__PURE__ */(0, React.createElement)(React.Fragment, null, /* @__PURE__ */(0, React.createElement)(Comp, _extends$1({ - role: hasAriaLabel ? void 0 : "tooltip" - }, props2, { - ref, - "data-reach-tooltip": "", - id: hasAriaLabel ? void 0 : id2, - style: _extends$1({}, style2, getStyles(position, triggerRect, tooltipRect)) - }), label), hasAriaLabel && /* @__PURE__ */(0, React.createElement)(VisuallyHidden, { - role: "tooltip", - id: id2 - }, realAriaLabel || ariaLabel)); - }, "TooltipContent")); - function getStyles(position, triggerRect, tooltipRect) { - var haventMeasuredTooltipYet = !tooltipRect; - if (haventMeasuredTooltipYet) { - return { - visibility: "hidden" - }; - } - return position(triggerRect, tooltipRect); - } - __name(getStyles, "getStyles"); - var OFFSET_DEFAULT = 8; - var positionTooltip = /* @__PURE__ */__name(function positionTooltip2(triggerRect, tooltipRect, offset) { - if (offset === void 0) { - offset = OFFSET_DEFAULT; - } - var _getDocumentDimension = getDocumentDimensions(), - windowWidth = _getDocumentDimension.width, - windowHeight = _getDocumentDimension.height; - if (!triggerRect || !tooltipRect) { - return {}; - } - var collisions = { - top: triggerRect.top - tooltipRect.height < 0, - right: windowWidth < triggerRect.left + tooltipRect.width, - bottom: windowHeight < triggerRect.bottom + tooltipRect.height + offset, - left: triggerRect.left - tooltipRect.width < 0 - }; - var directionRight = collisions.right && !collisions.left; - var directionUp = collisions.bottom && !collisions.top; - return { - left: directionRight ? triggerRect.right - tooltipRect.width + window.pageXOffset + "px" : triggerRect.left + window.pageXOffset + "px", - top: directionUp ? triggerRect.top - offset - tooltipRect.height + window.pageYOffset + "px" : triggerRect.top + offset + triggerRect.height + window.pageYOffset + "px" - }; - }, "positionTooltip"); - function useDisabledTriggerOnSafari(_ref5) { - var disabled = _ref5.disabled, - isVisible = _ref5.isVisible, - ref = _ref5.ref; - (0, React.useEffect)(function () { - if (!(typeof window !== "undefined" && "PointerEvent" in window) || !disabled || !isVisible) { - return; - } - var ownerDocument = getOwnerDocument(ref.current); - function handleMouseMove(event) { - if (!isVisible) { - return; - } - if (event.target instanceof Element && event.target.closest("[data-reach-tooltip-trigger][data-state='tooltip-visible']")) { - return; - } - send({ - type: TooltipEvents.GlobalMouseMove - }); - } - __name(handleMouseMove, "handleMouseMove"); - ownerDocument.addEventListener("mousemove", handleMouseMove); - return function () { - ownerDocument.removeEventListener("mousemove", handleMouseMove); - }; - }, [disabled, isVisible, ref]); - } - __name(useDisabledTriggerOnSafari, "useDisabledTriggerOnSafari"); - function send(event) { - var _transition = transition(state, event), - value3 = _transition.value, - context = _transition.context, - changed = _transition.changed; - if (changed) { - state = { - value: value3, - context - }; - notify(); - } - } - __name(send, "send"); - function transition(currentState, event) { - var stateDef = chart.states[currentState.value]; - var nextState = stateDef && stateDef.on && stateDef.on[event.type]; - if (!nextState) { - return _extends$1({}, currentState, { - changed: false - }); - } - if (stateDef && stateDef.leave) { - stateDef.leave(currentState.context, event); - } - event.type; - var payload = _objectWithoutPropertiesLoose$1(event, _excluded4$1); - var context = _extends$1({}, state.context, payload); - var nextStateValue = typeof nextState === "string" ? nextState : nextState.target; - var nextDef = chart.states[nextStateValue]; - if (nextDef && nextDef.enter) { - nextDef.enter(currentState.context, event); - } - return { - value: nextStateValue, - context, - changed: true - }; - } - __name(transition, "transition"); - function isTooltipVisible(id2, initial) { - return state.context.id === id2 && (initial ? state.value === TooltipStates.Visible : state.value === TooltipStates.Visible || state.value === TooltipStates.LeavingVisible); - } - __name(isTooltipVisible, "isTooltipVisible"); - var tabs = /* @__PURE__ */(() => ".graphiql-tabs{display:flex;overflow-x:auto;padding:var(--px-12)}.graphiql-tabs>:not(:first-child){margin-left:var(--px-12)}.graphiql-tab{align-items:stretch;border-radius:var(--border-radius-8);color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex}.graphiql-tab>button.graphiql-tab-close{visibility:hidden}.graphiql-tab.graphiql-tab-active>button.graphiql-tab-close,.graphiql-tab:hover>button.graphiql-tab-close,.graphiql-tab:focus-within>button.graphiql-tab-close{visibility:unset}.graphiql-tab.graphiql-tab-active{background-color:hsla(var(--color-neutral),var(--alpha-background-heavy));color:hsla(var(--color-neutral),1)}button.graphiql-tab-button{padding:var(--px-4) 0 var(--px-4) var(--px-8)}button.graphiql-tab-close{align-items:center;display:flex;padding:var(--px-4) var(--px-8)}button.graphiql-tab-close>svg{height:var(--px-8);width:var(--px-8)}\n")(); - const TabRoot = /*#__PURE__*/(0, React.forwardRef)((_ia, ref) => { - var _ja = _ia, - { - isActive - } = _ja, - props2 = __objRest(_ja, ["isActive"]); - return /* @__PURE__ */jsx("div", __spreadProps(__spreadValues({}, props2), { - ref, - role: "tab", - "aria-selected": isActive, - className: clsx("graphiql-tab", isActive && "graphiql-tab-active", props2.className), - children: props2.children - })); - }); - TabRoot.displayName = "Tab"; - const TabButton = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx(UnStyledButton, __spreadProps(__spreadValues({}, props2), { - ref, - type: "button", - className: clsx("graphiql-tab-button", props2.className), - children: props2.children - }))); - TabButton.displayName = "Tab.Button"; - const TabClose = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx(Tooltip, { - label: "Close Tab", - children: /* @__PURE__ */jsx(UnStyledButton, __spreadProps(__spreadValues({ - "aria-label": "Close Tab" - }, props2), { - ref, - type: "button", - className: clsx("graphiql-tab-close", props2.className), - children: /* @__PURE__ */jsx(CloseIcon, {}) - })) - })); - TabClose.displayName = "Tab.Close"; - const Tab = createComponentGroup(TabRoot, { - Button: TabButton, - Close: TabClose - }); - _exports.aO = Tab; - const Tabs = /*#__PURE__*/(0, React.forwardRef)((props2, ref) => /* @__PURE__ */jsx("div", __spreadProps(__spreadValues({}, props2), { - ref, - role: "tablist", - className: clsx("graphiql-tabs", props2.className), - children: props2.children - }))); - _exports.aP = Tabs; - Tabs.displayName = "Tabs"; - var __defProp$C = Object.defineProperty; - var __name$C = /* @__PURE__ */__name((target2, value3) => __defProp$C(target2, "name", { - value: value3, - configurable: true - }), "__name$C"); - const HistoryContext = createNullableContext("HistoryContext"); - _exports.X = HistoryContext; - function HistoryContextProvider(props2) { - var _a; - const storage = useStorageContext(); - const historyStore = (0, React.useRef)(new HistoryStore(storage || new StorageAPI(null), props2.maxHistoryLength || DEFAULT_HISTORY_LENGTH)); - const [items, setItems] = (0, React.useState)(((_a = historyStore.current) == null ? void 0 : _a.queries) || []); - const addToHistory = (0, React.useCallback)(_ref73 => { - let { - query, - variables, - headers, - operationName - } = _ref73; - var _a2; - (_a2 = historyStore.current) == null ? void 0 : _a2.updateHistory(query, variables, headers, operationName); - setItems(historyStore.current.queries); - }, []); - const editLabel = (0, React.useCallback)(_ref74 => { - let { - query, - variables, - headers, - operationName, - label, - favorite - } = _ref74; - historyStore.current.editLabel(query, variables, headers, operationName, label, favorite); - setItems(historyStore.current.queries); - }, []); - const toggleFavorite = (0, React.useCallback)(_ref75 => { - let { - query, - variables, - headers, - operationName, - label, - favorite - } = _ref75; - historyStore.current.toggleFavorite(query, variables, headers, operationName, label, favorite); - setItems(historyStore.current.queries); - }, []); - const value3 = (0, React.useMemo)(() => ({ - addToHistory, - editLabel, - items, - toggleFavorite - }), [addToHistory, editLabel, items, toggleFavorite]); - return /* @__PURE__ */jsx(HistoryContext.Provider, { - value: value3, - children: props2.children - }); - } - __name(HistoryContextProvider, "HistoryContextProvider"); - __name$C(HistoryContextProvider, "HistoryContextProvider"); - const useHistoryContext = createContextHook(HistoryContext); - _exports.Z = useHistoryContext; - const DEFAULT_HISTORY_LENGTH = 20; - var style = /* @__PURE__ */(() => ".graphiql-history-header{font-size:var(--font-size-h2);font-weight:var(--font-weight-medium)}.graphiql-history-items{margin:var(--px-16) 0 0;list-style:none;padding:0}.graphiql-history-item{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;font-size:var(--font-size-inline-code);font-family:var(--font-family-mono);height:34px}.graphiql-history-item:hover{color:hsla(var(--color-neutral),1);background-color:hsla(var(--color-neutral),var(--alpha-background-light))}.graphiql-history-item:not(:first-child){margin-top:var(--px-4)}.graphiql-history-item.editable{background-color:hsla(var(--color-primary),var(--alpha-background-medium))}.graphiql-history-item.editable>input{background:transparent;border:none;flex:1;margin:0;outline:none;padding:0 var(--px-10);width:100%}.graphiql-history-item.editable>input::placeholder{color:hsla(var(--color-neutral),var(--alpha-secondary))}.graphiql-history-item.editable>button{color:hsl(var(--color-primary));padding:0 var(--px-10)}.graphiql-history-item.editable>button:active{background-color:hsla(var(--color-primary),var(--alpha-background-heavy))}.graphiql-history-item.editable>button:focus{outline:hsl(var(--color-primary)) auto 1px}.graphiql-history-item.editable>button>svg{display:block}button.graphiql-history-item-label{flex:1;padding:var(--px-8) var(--px-10);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button.graphiql-history-item-action{align-items:center;color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;padding:var(--px-8) var(--px-6)}button.graphiql-history-item-action:hover{color:hsla(var(--color-neutral),1)}button.graphiql-history-item-action>svg{height:14px;width:14px}.graphiql-history-item-spacer{height:var(--px-16)}\n")(); - var __defProp$B = Object.defineProperty; - var __name$B = /* @__PURE__ */__name((target2, value3) => __defProp$B(target2, "name", { - value: value3, - configurable: true - }), "__name$B"); - function History() { - const { - items - } = useHistoryContext({ - nonNull: true - }); - const reversedItems = items.slice().reverse(); - return /* @__PURE__ */jsxs("section", { - "aria-label": "History", - className: "graphiql-history", - children: [/* @__PURE__ */jsx("div", { - className: "graphiql-history-header", - children: "History" - }), /* @__PURE__ */jsx("ul", { - className: "graphiql-history-items", - children: reversedItems.map((item, i) => { - return /* @__PURE__ */jsxs(React.Fragment, { - children: [/* @__PURE__ */jsx(HistoryItem, { - item - }), item.favorite && reversedItems[i + 1] && !reversedItems[i + 1].favorite ? /* @__PURE__ */jsx("div", { - className: "graphiql-history-item-spacer" - }) : null] - }, `${i}:${item.label || item.query}`); - }) - })] - }); - } - __name(History, "History"); - __name$B(History, "History"); - function HistoryItem(props2) { - const { - editLabel, - toggleFavorite - } = useHistoryContext({ - nonNull: true, - caller: HistoryItem - }); - const { - headerEditor, - queryEditor, - variableEditor - } = useEditorContext({ - nonNull: true, - caller: HistoryItem - }); - const inputRef = (0, React.useRef)(null); - const buttonRef = (0, React.useRef)(null); - const [isEditable, setIsEditable] = (0, React.useState)(false); - (0, React.useEffect)(() => { - if (isEditable && inputRef.current) { - inputRef.current.focus(); - } - }, [isEditable]); - const displayName = props2.item.label || props2.item.operationName || formatQuery(props2.item.query); - return /* @__PURE__ */jsx("li", { - className: clsx("graphiql-history-item", isEditable && "editable"), - children: isEditable ? /* @__PURE__ */jsxs(Fragment, { - children: [/* @__PURE__ */jsx("input", { - type: "text", - defaultValue: props2.item.label, - ref: inputRef, - onKeyDown: e2 => { - if (e2.keyCode === 27) { - setIsEditable(false); - } else if (e2.keyCode === 13) { - setIsEditable(false); - editLabel(__spreadProps(__spreadValues({}, props2.item), { - label: e2.currentTarget.value - })); - } - }, - placeholder: "Type a label" - }), /* @__PURE__ */jsx(UnStyledButton, { - type: "button", - ref: buttonRef, - onClick: () => { - var _a; - setIsEditable(false); - editLabel(__spreadProps(__spreadValues({}, props2.item), { - label: (_a = inputRef.current) == null ? void 0 : _a.value - })); - }, - children: "Save" - }), /* @__PURE__ */jsx(UnStyledButton, { - type: "button", - ref: buttonRef, - onClick: () => { - setIsEditable(false); - }, - children: /* @__PURE__ */jsx(CloseIcon, {}) - })] - }) : /* @__PURE__ */jsxs(Fragment, { - children: [/* @__PURE__ */jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-label", - onClick: () => { - var _a, _b, _c; - queryEditor == null ? void 0 : queryEditor.setValue((_a = props2.item.query) != null ? _a : ""); - variableEditor == null ? void 0 : variableEditor.setValue((_b = props2.item.variables) != null ? _b : ""); - headerEditor == null ? void 0 : headerEditor.setValue((_c = props2.item.headers) != null ? _c : ""); - }, - children: displayName - }), /* @__PURE__ */jsx(Tooltip, { - label: "Edit label", - children: /* @__PURE__ */jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-action", - onClick: e2 => { - e2.stopPropagation(); - setIsEditable(true); - }, - "aria-label": "Edit label", - children: /* @__PURE__ */jsx(PenIcon, { - "aria-hidden": "true" - }) - }) - }), /* @__PURE__ */jsx(Tooltip, { - label: props2.item.favorite ? "Remove favorite" : "Add favorite", - children: /* @__PURE__ */jsx(UnStyledButton, { - type: "button", - className: "graphiql-history-item-action", - onClick: e2 => { - e2.stopPropagation(); - toggleFavorite(props2.item); - }, - "aria-label": props2.item.favorite ? "Remove favorite" : "Add favorite", - children: props2.item.favorite ? /* @__PURE__ */jsx(StarFilledIcon, { - "aria-hidden": "true" - }) : /* @__PURE__ */jsx(StarIcon, { - "aria-hidden": "true" - }) - }) - })] - }) - }); - } - __name(HistoryItem, "HistoryItem"); - __name$B(HistoryItem, "HistoryItem"); - function formatQuery(query) { - return query == null ? void 0 : query.split("\n").map(line => line.replace(/#(.*)/, "")).join(" ").replace(/{/g, " { ").replace(/}/g, " } ").replace(/[\s]{2,}/g, " "); - } - __name(formatQuery, "formatQuery"); - __name$B(formatQuery, "formatQuery"); - var __defProp$A = Object.defineProperty; - var __name$A = /* @__PURE__ */__name((target2, value3) => __defProp$A(target2, "name", { - value: value3, - configurable: true - }), "__name$A"); - const ExecutionContext = createNullableContext("ExecutionContext"); - _exports.r = ExecutionContext; - function ExecutionContextProvider(props2) { - if (!props2.fetcher) { - throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop."); - } - const { - externalFragments, - headerEditor, - queryEditor, - responseEditor, - variableEditor, - updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller: ExecutionContextProvider - }); - const history = useHistoryContext(); - const autoCompleteLeafs = useAutoCompleteLeafs({ - getDefaultFieldNames: props2.getDefaultFieldNames, - caller: ExecutionContextProvider - }); - const [isFetching, setIsFetching] = (0, React.useState)(false); - const [subscription, setSubscription] = (0, React.useState)(null); - const queryIdRef = (0, React.useRef)(0); - const stop = (0, React.useCallback)(() => { - subscription == null ? void 0 : subscription.unsubscribe(); - setIsFetching(false); - setSubscription(null); - }, [subscription]); - const { - fetcher, - children, - operationName - } = props2; - const run3 = (0, React.useCallback)(async () => { - var _a, _b; - if (!queryEditor || !responseEditor) { - return; - } - if (subscription) { - stop(); - return; - } - const setResponse = /* @__PURE__ */__name$A(value22 => { - responseEditor.setValue(value22); - updateActiveTabValues({ - response: value22 - }); - }, "setResponse"); - queryIdRef.current += 1; - const queryId = queryIdRef.current; - let query = autoCompleteLeafs() || queryEditor.getValue(); - const variablesString = variableEditor == null ? void 0 : variableEditor.getValue(); - let variables; - try { - variables = tryParseJsonObject({ - json: variablesString, - errorMessageParse: "Variables are invalid JSON", - errorMessageType: "Variables are not a JSON object." - }); - } catch (error2) { - setResponse(error2 instanceof Error ? error2.message : `${error2}`); - return; - } - const headersString = headerEditor == null ? void 0 : headerEditor.getValue(); - let headers; - try { - headers = tryParseJsonObject({ - json: headersString, - errorMessageParse: "Headers are invalid JSON", - errorMessageType: "Headers are not a JSON object." - }); - } catch (error2) { - setResponse(error2 instanceof Error ? error2.message : `${error2}`); - return; - } - if (externalFragments) { - const fragmentDependencies = queryEditor.documentAST ? getFragmentDependenciesForAST(queryEditor.documentAST, externalFragments) : []; - if (fragmentDependencies.length > 0) { - query += "\n" + fragmentDependencies.map(node => (0, _graphql.print)(node)).join("\n"); - } - } - setResponse(""); - setIsFetching(true); - const opName = (_a = operationName != null ? operationName : queryEditor.operationName) != null ? _a : void 0; - history == null ? void 0 : history.addToHistory({ - query, - variables: variablesString, - headers: headersString, - operationName: opName - }); - try { - let fullResponse = { - data: {} - }; - const handleResponse = /* @__PURE__ */__name$A(result => { - if (queryId !== queryIdRef.current) { - return; - } - let maybeMultipart = Array.isArray(result) ? result : false; - if (!maybeMultipart && typeof result === "object" && result !== null && "hasNext" in result) { - maybeMultipart = [result]; - } - if (maybeMultipart) { - const payload = { - data: fullResponse.data - }; - const maybeErrors = [...((fullResponse == null ? void 0 : fullResponse.errors) || []), ...maybeMultipart.map(i => i.errors).flat().filter(Boolean)]; - if (maybeErrors.length) { - payload.errors = maybeErrors; - } - for (const part2 of maybeMultipart) { - const _a2 = part2, - { - path, - data, - errors: errors2 - } = _a2, - rest = __objRest(_a2, ["path", "data", "errors"]); - if (path) { - if (!data) { - throw new Error(`Expected part to contain a data property, but got ${part2}`); - } - setValue_1(payload.data, path, data, { - merge: true - }); - } else if (data) { - payload.data = data; - } - fullResponse = __spreadValues(__spreadValues({}, payload), rest); - } - setIsFetching(false); - setResponse(formatResult(fullResponse)); - } else { - const response = formatResult(result); - setIsFetching(false); - setResponse(response); - } - }, "handleResponse"); - const fetch2 = fetcher({ - query, - variables, - operationName: opName - }, { - headers: headers != null ? headers : void 0, - documentAST: (_b = queryEditor.documentAST) != null ? _b : void 0 - }); - const value22 = await Promise.resolve(fetch2); - if (isObservable(value22)) { - setSubscription(value22.subscribe({ - next(result) { - handleResponse(result); - }, - error(error2) { - setIsFetching(false); - if (error2) { - setResponse(formatError(error2)); - } - setSubscription(null); - }, - complete() { - setIsFetching(false); - setSubscription(null); - } - })); - } else if (isAsyncIterable(value22)) { - setSubscription({ - unsubscribe: () => { - var _a2, _b2; - return (_b2 = (_a2 = value22[Symbol.asyncIterator]()).return) == null ? void 0 : _b2.call(_a2); - } - }); - try { - for await (const result of value22) { - handleResponse(result); - } - setIsFetching(false); - setSubscription(null); - } catch (error2) { - setIsFetching(false); - setResponse(formatError(error2)); - setSubscription(null); - } - } else { - handleResponse(value22); - } - } catch (error2) { - setIsFetching(false); - setResponse(formatError(error2)); - setSubscription(null); - } - }, [autoCompleteLeafs, externalFragments, fetcher, headerEditor, history, operationName, queryEditor, responseEditor, stop, subscription, updateActiveTabValues, variableEditor]); - const isSubscribed = Boolean(subscription); - const value3 = (0, React.useMemo)(() => ({ - isFetching, - isSubscribed, - operationName: operationName != null ? operationName : null, - run: run3, - stop - }), [isFetching, isSubscribed, operationName, run3, stop]); - return /* @__PURE__ */jsx(ExecutionContext.Provider, { - value: value3, - children - }); - } - __name(ExecutionContextProvider, "ExecutionContextProvider"); - __name$A(ExecutionContextProvider, "ExecutionContextProvider"); - const useExecutionContext = createContextHook(ExecutionContext); - _exports.v = useExecutionContext; - function tryParseJsonObject(_ref76) { - let { - json, - errorMessageParse, - errorMessageType - } = _ref76; - let parsed = void 0; - try { - parsed = json && json.trim() !== "" ? JSON.parse(json) : void 0; - } catch (error2) { - throw new Error(`${errorMessageParse}: ${error2 instanceof Error ? error2.message : error2}.`); - } - const isObject3 = typeof parsed === "object" && parsed !== null && !Array.isArray(parsed); - if (parsed !== void 0 && !isObject3) { - throw new Error(errorMessageType); - } - return parsed; - } - __name(tryParseJsonObject, "tryParseJsonObject"); - __name$A(tryParseJsonObject, "tryParseJsonObject"); - var __defProp$z = Object.defineProperty; - var __name$z = /* @__PURE__ */__name((target2, value3) => __defProp$z(target2, "name", { - value: value3, - configurable: true - }), "__name$z"); - const DEFAULT_EDITOR_THEME = "graphiql"; - const DEFAULT_KEY_MAP = "sublime"; - let isMacOs = false; - if (typeof window === "object") { - isMacOs = window.navigator.platform.toLowerCase().indexOf("mac") === 0; - } - const commonKeys = { - [isMacOs ? "Cmd-F" : "Ctrl-F"]: "findPersistent", - "Cmd-G": "findPersistent", - "Ctrl-G": "findPersistent", - "Ctrl-Left": "goSubwordLeft", - "Ctrl-Right": "goSubwordRight", - "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight" - }; - async function importCodeMirror(addons, options) { - const CodeMirror = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js", 23)).then(function (n2) { - return n2.c; - }).then(c2 => typeof c2 === "function" ? c2 : c2.default); - await Promise.all((options == null ? void 0 : options.useCommonAddons) === false ? addons : [Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./show-hint.es.js */ "../../graphiql-react/dist/show-hint.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./matchbrackets.es.js */ "../../graphiql-react/dist/matchbrackets.es.js", 23)).then(function (n2) { - return n2.m; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./closebrackets.es.js */ "../../graphiql-react/dist/closebrackets.es.js", 23)).then(function (n2) { - return n2.c; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./brace-fold.es.js */ "../../graphiql-react/dist/brace-fold.es.js", 23)).then(function (n2) { - return n2.b; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./foldgutter.es.js */ "../../graphiql-react/dist/foldgutter.es.js", 23)).then(function (n2) { - return n2.f; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./lint.es3.js */ "../../graphiql-react/dist/lint.es3.js", 23)).then(function (n2) { - return n2.l; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./searchcursor.es.js */ "../../graphiql-react/dist/searchcursor.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./jump-to-line.es.js */ "../../graphiql-react/dist/jump-to-line.es.js", 23)).then(function (n2) { - return n2.j; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./dialog.es.js */ "../../graphiql-react/dist/dialog.es.js", 23)).then(function (n2) { - return n2.d; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./sublime.es.js */ "../../graphiql-react/dist/sublime.es.js", 23)).then(function (n2) { - return n2.s; - }), ...addons]); - return CodeMirror; - } - __name(importCodeMirror, "importCodeMirror"); - __name$z(importCodeMirror, "importCodeMirror"); - var toggleSelection = /* @__PURE__ */__name(function () { - var selection = document.getSelection(); - if (!selection.rangeCount) { - return function () {}; - } - var active = document.activeElement; - var ranges = []; - for (var i = 0; i < selection.rangeCount; i++) { - ranges.push(selection.getRangeAt(i)); - } - switch (active.tagName.toUpperCase()) { - case "INPUT": - case "TEXTAREA": - active.blur(); - break; - default: - active = null; - break; - } - selection.removeAllRanges(); - return function () { - selection.type === "Caret" && selection.removeAllRanges(); - if (!selection.rangeCount) { - ranges.forEach(function (range2) { - selection.addRange(range2); - }); - } - active && active.focus(); - }; - }, "toggleSelection"); - var deselectCurrent = toggleSelection; - var clipboardToIE11Formatting = { - "text/plain": "Text", - "text/html": "Url", - "default": "Text" - }; - var defaultMessage = "Copy to clipboard: #{key}, Enter"; - function format2(message) { - var copyKey = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C"; - return message.replace(/#{\s*key\s*}/g, copyKey); - } - __name(format2, "format"); - function copy(text3, options) { - var debug, - message, - reselectPrevious, - range2, - selection, - mark, - success = false; - if (!options) { - options = {}; - } - debug = options.debug || false; - try { - reselectPrevious = deselectCurrent(); - range2 = document.createRange(); - selection = document.getSelection(); - mark = document.createElement("span"); - mark.textContent = text3; - mark.ariaHidden = "true"; - mark.style.all = "unset"; - mark.style.position = "fixed"; - mark.style.top = 0; - mark.style.clip = "rect(0, 0, 0, 0)"; - mark.style.whiteSpace = "pre"; - mark.style.webkitUserSelect = "text"; - mark.style.MozUserSelect = "text"; - mark.style.msUserSelect = "text"; - mark.style.userSelect = "text"; - mark.addEventListener("copy", function (e2) { - e2.stopPropagation(); - if (options.format) { - e2.preventDefault(); - if (typeof e2.clipboardData === "undefined") { - debug && console.warn("unable to use e.clipboardData"); - debug && console.warn("trying IE specific stuff"); - window.clipboardData.clearData(); - var format3 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]; - window.clipboardData.setData(format3, text3); - } else { - e2.clipboardData.clearData(); - e2.clipboardData.setData(options.format, text3); - } - } - if (options.onCopy) { - e2.preventDefault(); - options.onCopy(e2.clipboardData); - } - }); - document.body.appendChild(mark); - range2.selectNodeContents(mark); - selection.addRange(range2); - var successful = document.execCommand("copy"); - if (!successful) { - throw new Error("copy command was unsuccessful"); - } - success = true; - } catch (err) { - debug && console.error("unable to copy using execCommand: ", err); - debug && console.warn("trying IE specific stuff"); - try { - window.clipboardData.setData(options.format || "text", text3); - options.onCopy && options.onCopy(window.clipboardData); - success = true; - } catch (err2) { - debug && console.error("unable to copy using clipboardData: ", err2); - debug && console.error("falling back to prompt"); - message = format2("message" in options ? options.message : defaultMessage); - window.prompt(message, text3); - } - } finally { - if (selection) { - if (typeof selection.removeRange == "function") { - selection.removeRange(range2); - } else { - selection.removeAllRanges(); - } - } - if (mark) { - document.body.removeChild(mark); - } - reselectPrevious(); - } - return success; - } - __name(copy, "copy"); - var copyToClipboard = copy; - var defaultValue = /* @__PURE__ */(() => ".graphiql-doc-explorer-default-value{color:hsl(var(--color-success))}\n")(); - var __defProp$y = Object.defineProperty; - var __name$y = /* @__PURE__ */__name((target2, value3) => __defProp$y(target2, "name", { - value: value3, - configurable: true - }), "__name$y"); - const printDefault = /* @__PURE__ */__name$y(ast2 => { - if (!ast2) { - return ""; - } - return (0, _graphql.print)(ast2); - }, "printDefault"); - function DefaultValue(_ref77) { - let { - field - } = _ref77; - if (!("defaultValue" in field) || field.defaultValue === void 0) { - return null; - } - const ast2 = (0, _graphql.astFromValue)(field.defaultValue, field.type); - if (!ast2) { - return null; - } - return /* @__PURE__ */jsxs(Fragment, { - children: [" = ", /* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-default-value", - children: printDefault(ast2) - })] - }); - } - __name(DefaultValue, "DefaultValue"); - __name$y(DefaultValue, "DefaultValue"); - var __defProp$x = Object.defineProperty; - var __name$x = /* @__PURE__ */__name((target2, value3) => __defProp$x(target2, "name", { - value: value3, - configurable: true - }), "__name$x"); - const SchemaContext = createNullableContext("SchemaContext"); - _exports.a4 = SchemaContext; - function SchemaContextProvider(props2) { - if (!props2.fetcher) { - throw new TypeError("The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop."); - } - const { - initialHeaders, - headerEditor - } = useEditorContext({ - nonNull: true, - caller: SchemaContextProvider - }); - const [schema, setSchema] = (0, React.useState)(); - const [isFetching, setIsFetching] = (0, React.useState)(false); - const [fetchError, setFetchError] = (0, React.useState)(null); - const counterRef = (0, React.useRef)(0); - (0, React.useEffect)(() => { - setSchema((0, _graphql.isSchema)(props2.schema) || props2.schema === null || props2.schema === void 0 ? props2.schema : void 0); - counterRef.current++; - }, [props2.schema]); - const headersRef = (0, React.useRef)(initialHeaders); - (0, React.useEffect)(() => { - if (headerEditor) { - headersRef.current = headerEditor.getValue(); - } - }); - const { - introspectionQuery, - introspectionQueryName, - introspectionQuerySansSubscriptions - } = useIntrospectionQuery({ - inputValueDeprecation: props2.inputValueDeprecation, - introspectionQueryName: props2.introspectionQueryName, - schemaDescription: props2.schemaDescription - }); - const { - fetcher, - onSchemaChange, - dangerouslyAssumeSchemaIsValid, - children - } = props2; - const introspect = (0, React.useCallback)(() => { - if ((0, _graphql.isSchema)(props2.schema) || props2.schema === null) { - return; - } - const counter = ++counterRef.current; - const maybeIntrospectionData = props2.schema; - async function fetchIntrospectionData() { - if (maybeIntrospectionData) { - return maybeIntrospectionData; - } - const parsedHeaders = parseHeaderString(headersRef.current); - if (!parsedHeaders.isValidJSON) { - setFetchError("Introspection failed as headers are invalid."); - return; - } - const fetcherOpts = parsedHeaders.headers ? { - headers: parsedHeaders.headers - } : {}; - const fetch2 = fetcherReturnToPromise(fetcher({ - query: introspectionQuery, - operationName: introspectionQueryName - }, fetcherOpts)); - if (!isPromise(fetch2)) { - setFetchError("Fetcher did not return a Promise for introspection."); - return; - } - setIsFetching(true); - setFetchError(null); - let result = await fetch2; - if (typeof result !== "object" || result === null || !("data" in result)) { - const fetch22 = fetcherReturnToPromise(fetcher({ - query: introspectionQuerySansSubscriptions, - operationName: introspectionQueryName - }, fetcherOpts)); - if (!isPromise(fetch22)) { - throw new Error("Fetcher did not return a Promise for introspection."); - } - result = await fetch22; - } - setIsFetching(false); - if ((result == null ? void 0 : result.data) && "__schema" in result.data) { - return result.data; - } - const responseString = typeof result === "string" ? result : formatResult(result); - setFetchError(responseString); - } - __name(fetchIntrospectionData, "fetchIntrospectionData"); - __name$x(fetchIntrospectionData, "fetchIntrospectionData"); - fetchIntrospectionData().then(introspectionData => { - if (counter !== counterRef.current || !introspectionData) { - return; - } - try { - const newSchema = (0, _graphql.buildClientSchema)(introspectionData); - setSchema(newSchema); - onSchemaChange == null ? void 0 : onSchemaChange(newSchema); - } catch (error2) { - setFetchError(formatError(error2)); - } - }).catch(error2 => { - if (counter !== counterRef.current) { - return; - } - setFetchError(formatError(error2)); - setIsFetching(false); - }); - }, [fetcher, introspectionQueryName, introspectionQuery, introspectionQuerySansSubscriptions, onSchemaChange, props2.schema]); - (0, React.useEffect)(() => { - introspect(); - }, [introspect]); - (0, React.useEffect)(() => { - function triggerIntrospection(event) { - if (event.keyCode === 82 && event.shiftKey && event.ctrlKey) { - introspect(); - } - } - __name(triggerIntrospection, "triggerIntrospection"); - __name$x(triggerIntrospection, "triggerIntrospection"); - window.addEventListener("keydown", triggerIntrospection); - return () => window.removeEventListener("keydown", triggerIntrospection); - }); - const validationErrors = (0, React.useMemo)(() => { - if (!schema || dangerouslyAssumeSchemaIsValid) { - return []; - } - return (0, _graphql.validateSchema)(schema); - }, [schema, dangerouslyAssumeSchemaIsValid]); - const value3 = (0, React.useMemo)(() => ({ - fetchError, - introspect, - isFetching, - schema, - validationErrors - }), [fetchError, introspect, isFetching, schema, validationErrors]); - return /* @__PURE__ */jsx(SchemaContext.Provider, { - value: value3, - children - }); - } - __name(SchemaContextProvider, "SchemaContextProvider"); - __name$x(SchemaContextProvider, "SchemaContextProvider"); - const useSchemaContext = createContextHook(SchemaContext); - _exports.a6 = useSchemaContext; - function useIntrospectionQuery(_ref78) { - let { - inputValueDeprecation, - introspectionQueryName, - schemaDescription - } = _ref78; - return (0, React.useMemo)(() => { - const queryName = introspectionQueryName || "IntrospectionQuery"; - let query = (0, _graphql.getIntrospectionQuery)({ - inputValueDeprecation, - schemaDescription - }); - if (introspectionQueryName) { - query = query.replace("query IntrospectionQuery", `query ${queryName}`); - } - const querySansSubscriptions = query.replace("subscriptionType { name }", ""); - return { - introspectionQueryName: queryName, - introspectionQuery: query, - introspectionQuerySansSubscriptions: querySansSubscriptions - }; - }, [inputValueDeprecation, introspectionQueryName, schemaDescription]); - } - __name(useIntrospectionQuery, "useIntrospectionQuery"); - __name$x(useIntrospectionQuery, "useIntrospectionQuery"); - function parseHeaderString(headersString) { - let headers = null; - let isValidJSON = true; - try { - if (headersString) { - headers = JSON.parse(headersString); - } - } catch { - isValidJSON = false; - } - return { - headers, - isValidJSON - }; - } - __name(parseHeaderString, "parseHeaderString"); - __name$x(parseHeaderString, "parseHeaderString"); - var __defProp$w = Object.defineProperty; - var __name$w = /* @__PURE__ */__name((target2, value3) => __defProp$w(target2, "name", { - value: value3, - configurable: true - }), "__name$w"); - const initialNavStackItem = { - name: "Docs" - }; - const ExplorerContext = createNullableContext("ExplorerContext"); - _exports.z = ExplorerContext; - function ExplorerContextProvider(props2) { - const { - schema, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: ExplorerContextProvider - }); - const [navStack, setNavStack] = (0, React.useState)([initialNavStackItem]); - const push = (0, React.useCallback)(item => { - setNavStack(currentState => { - const lastItem = currentState[currentState.length - 1]; - return lastItem.def === item.def ? currentState : [...currentState, item]; - }); - }, []); - const pop = (0, React.useCallback)(() => { - setNavStack(currentState => currentState.length > 1 ? currentState.slice(0, -1) : currentState); - }, []); - const reset = (0, React.useCallback)(() => { - setNavStack(currentState => currentState.length === 1 ? currentState : [initialNavStackItem]); - }, []); - (0, React.useEffect)(() => { - if (schema == null || validationErrors.length > 0) { - reset(); - } else { - setNavStack(oldNavStack => { - if (oldNavStack.length === 1) { - return oldNavStack; - } - const newNavStack = [initialNavStackItem]; - let lastEntity = null; - for (const item of oldNavStack) { - if (item === initialNavStackItem) { - continue; - } - if (item.def) { - if ((0, _graphql.isNamedType)(item.def)) { - const newType = schema.getType(item.def.name); - if (newType) { - newNavStack.push({ - name: item.name, - def: newType - }); - lastEntity = newType; - } else { - break; - } - } else if (lastEntity === null) { - break; - } else if ((0, _graphql.isObjectType)(lastEntity) || (0, _graphql.isInputObjectType)(lastEntity)) { - const field = lastEntity.getFields()[item.name]; - if (field) { - newNavStack.push({ - name: item.name, - def: field - }); - } else { - break; - } - } else if ((0, _graphql.isScalarType)(lastEntity) || (0, _graphql.isEnumType)(lastEntity) || (0, _graphql.isInterfaceType)(lastEntity) || (0, _graphql.isUnionType)(lastEntity)) { - break; - } else { - const field = lastEntity; - const arg = field.args.find(a2 => a2.name === item.name); - if (arg) { - newNavStack.push({ - name: item.name, - def: field - }); - } else { - break; - } - } - } else { - lastEntity = null; - newNavStack.push(item); - } - } - return newNavStack; - }); - } - }, [reset, schema, validationErrors]); - const value3 = (0, React.useMemo)(() => ({ - explorerNavStack: navStack, - push, - pop, - reset - }), [navStack, push, pop, reset]); - return /* @__PURE__ */jsx(ExplorerContext.Provider, { - value: value3, - children: props2.children - }); - } - __name(ExplorerContextProvider, "ExplorerContextProvider"); - __name$w(ExplorerContextProvider, "ExplorerContextProvider"); - const useExplorerContext = createContextHook(ExplorerContext); - _exports.U = useExplorerContext; - var __defProp$v = Object.defineProperty; - var __name$v = /* @__PURE__ */__name((target2, value3) => __defProp$v(target2, "name", { - value: value3, - configurable: true - }), "__name$v"); - function renderType(type2, renderNamedType) { - if ((0, _graphql.isNonNullType)(type2)) { - return /* @__PURE__ */jsxs(Fragment, { - children: [renderType(type2.ofType, renderNamedType), "!"] - }); - } - if ((0, _graphql.isListType)(type2)) { - return /* @__PURE__ */jsxs(Fragment, { - children: ["[", renderType(type2.ofType, renderNamedType), "]"] - }); - } - return renderNamedType(type2); - } - __name(renderType, "renderType"); - __name$v(renderType, "renderType"); - var typeLink = /* @__PURE__ */(() => "a.graphiql-doc-explorer-type-name{color:hsl(var(--color-warning));text-decoration:none}a.graphiql-doc-explorer-type-name:hover{text-decoration:underline}a.graphiql-doc-explorer-type-name:focus{outline:hsl(var(--color-warning)) auto 1px}\n")(); - var __defProp$u = Object.defineProperty; - var __name$u = /* @__PURE__ */__name((target2, value3) => __defProp$u(target2, "name", { - value: value3, - configurable: true - }), "__name$u"); - function TypeLink(props2) { - const { - push - } = useExplorerContext({ - nonNull: true, - caller: TypeLink - }); - if (!props2.type) { - return null; - } - return renderType(props2.type, namedType => /* @__PURE__ */jsx("a", { - className: "graphiql-doc-explorer-type-name", - onClick: event => { - event.preventDefault(); - push({ - name: namedType.name, - def: namedType - }); - }, - href: "#", - children: namedType.name - })); - } - __name(TypeLink, "TypeLink"); - __name$u(TypeLink, "TypeLink"); - var argument = /* @__PURE__ */(() => ".graphiql-doc-explorer-argument>*+*{margin-top:var(--px-12)}.graphiql-doc-explorer-argument-name{color:hsl(var(--color-secondary))}.graphiql-doc-explorer-argument-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--border-radius-4);color:hsl(var(--color-warning));padding:var(--px-8)}.graphiql-doc-explorer-argument-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}\n")(); - var __defProp$t = Object.defineProperty; - var __name$t = /* @__PURE__ */__name((target2, value3) => __defProp$t(target2, "name", { - value: value3, - configurable: true - }), "__name$t"); - function Argument(_ref79) { - let { - arg, - showDefaultValue, - inline: inline3 - } = _ref79; - const definition = /* @__PURE__ */jsxs("span", { - children: [/* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-argument-name", - children: arg.name - }), ": ", /* @__PURE__ */jsx(TypeLink, { - type: arg.type - }), showDefaultValue !== false && /* @__PURE__ */jsx(DefaultValue, { - field: arg - })] - }); - if (inline3) { - return definition; - } - return /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-argument", - children: [definition, arg.description ? /* @__PURE__ */jsx(MarkdownContent, { - type: "description", - children: arg.description - }) : null, arg.deprecationReason ? /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-argument-deprecation", - children: [/* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-argument-deprecation-label", - children: "Deprecated" - }), /* @__PURE__ */jsx(MarkdownContent, { - type: "deprecation", - children: arg.deprecationReason - })] - }) : null] - }); - } - __name(Argument, "Argument"); - __name$t(Argument, "Argument"); - var deprecationReason = /* @__PURE__ */(() => ".graphiql-doc-explorer-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--px-4);color:hsl(var(--color-warning));padding:var(--px-8)}.graphiql-doc-explorer-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}\n")(); - var __defProp$s = Object.defineProperty; - var __name$s = /* @__PURE__ */__name((target2, value3) => __defProp$s(target2, "name", { - value: value3, - configurable: true - }), "__name$s"); - function DeprecationReason(props2) { - return props2.children ? /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-deprecation", - children: [/* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-deprecation-label", - children: "Deprecated" - }), /* @__PURE__ */jsx(MarkdownContent, { - type: "deprecation", - onlyShowFirstChild: true, - children: props2.children - })] - }) : null; - } - __name(DeprecationReason, "DeprecationReason"); - __name$s(DeprecationReason, "DeprecationReason"); - var directive = /* @__PURE__ */(() => ".graphiql-doc-explorer-directive{color:hsl(var(--color-secondary))}\n")(); - var __defProp$r = Object.defineProperty; - var __name$r = /* @__PURE__ */__name((target2, value3) => __defProp$r(target2, "name", { - value: value3, - configurable: true - }), "__name$r"); - function Directive(_ref80) { - let { - directive: directive2 - } = _ref80; - return /* @__PURE__ */jsxs("span", { - className: "graphiql-doc-explorer-directive", - children: ["@", directive2.name.value] - }); - } - __name(Directive, "Directive"); - __name$r(Directive, "Directive"); - var section = /* @__PURE__ */(() => ".graphiql-doc-explorer-section-title{align-items:center;display:flex;font-size:var(--font-size-hint);font-weight:var(--font-weight-medium);line-height:1}.graphiql-doc-explorer-section-title>svg{height:var(--px-16);margin-right:var(--px-8);width:var(--px-16)}.graphiql-doc-explorer-section-content{margin-left:var(--px-8);margin-top:var(--px-16)}.graphiql-doc-explorer-section-content>*+*{margin-top:var(--px-16)}\n")(); - var __defProp$q = Object.defineProperty; - var __name$q = /* @__PURE__ */__name((target2, value3) => __defProp$q(target2, "name", { - value: value3, - configurable: true - }), "__name$q"); - function ExplorerSection(props2) { - const Icon2 = TYPE_TO_ICON[props2.title]; - return /* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-section-title", - children: [/* @__PURE__ */jsx(Icon2, {}), props2.title] - }), /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-section-content", - children: props2.children - })] - }); - } - __name(ExplorerSection, "ExplorerSection"); - __name$q(ExplorerSection, "ExplorerSection"); - const TYPE_TO_ICON = { - Arguments: ArgumentIcon, - "Deprecated Arguments": DeprecatedArgumentIcon, - "Deprecated Enum Values": DeprecatedEnumValueIcon, - "Deprecated Fields": DeprecatedFieldIcon, - Directives: DirectiveIcon, - "Enum Values": EnumValueIcon, - Fields: FieldIcon, - Implements: ImplementsIcon, - Implementations: TypeIcon, - "Possible Types": TypeIcon, - "Root Types": RootTypeIcon, - Type: TypeIcon - }; - var __defProp$p = Object.defineProperty; - var __name$p = /* @__PURE__ */__name((target2, value3) => __defProp$p(target2, "name", { - value: value3, - configurable: true - }), "__name$p"); - function FieldDocumentation(props2) { - return /* @__PURE__ */jsxs(Fragment, { - children: [props2.field.description ? /* @__PURE__ */jsx(MarkdownContent, { - type: "description", - children: props2.field.description - }) : null, /* @__PURE__ */jsx(DeprecationReason, { - children: props2.field.deprecationReason - }), /* @__PURE__ */jsx(ExplorerSection, { - title: "Type", - children: /* @__PURE__ */jsx(TypeLink, { - type: props2.field.type - }) - }), /* @__PURE__ */jsx(Arguments, { - field: props2.field - }), /* @__PURE__ */jsx(Directives, { - field: props2.field - })] - }); - } - __name(FieldDocumentation, "FieldDocumentation"); - __name$p(FieldDocumentation, "FieldDocumentation"); - function Arguments(_ref81) { - let { - field - } = _ref81; - const [showDeprecated, setShowDeprecated] = (0, React.useState)(false); - if (!("args" in field)) { - return null; - } - const args = []; - const deprecatedArgs = []; - for (const argument2 of field.args) { - if (argument2.deprecationReason) { - deprecatedArgs.push(argument2); - } else { - args.push(argument2); - } - } - return /* @__PURE__ */jsxs(Fragment, { - children: [args.length > 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Arguments", - children: args.map(arg => /* @__PURE__ */jsx(Argument, { - arg - }, arg.name)) - }) : null, deprecatedArgs.length > 0 ? showDeprecated || args.length === 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Deprecated Arguments", - children: deprecatedArgs.map(arg => /* @__PURE__ */jsx(Argument, { - arg - }, arg.name)) - }) : /* @__PURE__ */jsx(Button, { - type: "button", - onClick: () => { - setShowDeprecated(true); - }, - children: "Show Deprecated Arguments" - }) : null] - }); - } - __name(Arguments, "Arguments"); - __name$p(Arguments, "Arguments"); - function Directives(_ref82) { - let { - field - } = _ref82; - var _a; - const directives = ((_a = field.astNode) == null ? void 0 : _a.directives) || []; - if (!directives || directives.length === 0) { - return null; - } - return /* @__PURE__ */jsx(ExplorerSection, { - title: "Directives", - children: directives.map(directive2 => /* @__PURE__ */jsx("div", { - children: /* @__PURE__ */jsx(Directive, { - directive: directive2 - }) - }, directive2.name.value)) - }); - } - __name(Directives, "Directives"); - __name$p(Directives, "Directives"); - var schemaDocumentation = /* @__PURE__ */(() => ".graphiql-doc-explorer-root-type{color:hsl(var(--color-info))}\n")(); - var __defProp$o = Object.defineProperty; - var __name$o = /* @__PURE__ */__name((target2, value3) => __defProp$o(target2, "name", { - value: value3, - configurable: true - }), "__name$o"); - function SchemaDocumentation(props2) { - var _a, _b, _c, _d; - const queryType = props2.schema.getQueryType(); - const mutationType = (_b = (_a = props2.schema).getMutationType) == null ? void 0 : _b.call(_a); - const subscriptionType = (_d = (_c = props2.schema).getSubscriptionType) == null ? void 0 : _d.call(_c); - return /* @__PURE__ */jsxs(Fragment, { - children: [/* @__PURE__ */jsx(MarkdownContent, { - type: "description", - children: props2.schema.description || "A GraphQL schema provides a root type for each kind of operation." - }), /* @__PURE__ */jsxs(ExplorerSection, { - title: "Root Types", - children: [queryType ? /* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "query" - }), ": ", /* @__PURE__ */jsx(TypeLink, { - type: queryType - })] - }) : null, mutationType && /* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "mutation" - }), ": ", /* @__PURE__ */jsx(TypeLink, { - type: mutationType - })] - }), subscriptionType && /* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-root-type", - children: "subscription" - }), ": ", /* @__PURE__ */jsx(TypeLink, { - type: subscriptionType - })] - })] - })] - }); - } - __name(SchemaDocumentation, "SchemaDocumentation"); - __name$o(SchemaDocumentation, "SchemaDocumentation"); - function useUpdateEffect(effect, deps) { - var mounted = (0, React.useRef)(false); - (0, React.useEffect)(function () { - if (mounted.current) { - effect(); - } else { - mounted.current = true; - } - }, deps); - } - __name(useUpdateEffect, "useUpdateEffect"); - function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target2 = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target2[key] = source[key]; - } - return target2; - } - __name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose"); - function _extends() { - _extends = Object.assign || function (target2) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target2[key] = source[key]; - } - } - } - return target2; - }; - return _extends.apply(this, arguments); - } - __name(_extends, "_extends"); - function findAll(_ref2) { - var autoEscape2 = _ref2.autoEscape, - _ref$caseSensitive = _ref2.caseSensitive, - caseSensitive = _ref$caseSensitive === void 0 ? false : _ref$caseSensitive, - _ref$findChunks = _ref2.findChunks, - findChunks = _ref$findChunks === void 0 ? defaultFindChunks : _ref$findChunks, - sanitize = _ref2.sanitize, - searchWords = _ref2.searchWords, - textToHighlight = _ref2.textToHighlight; - return fillInChunks({ - chunksToHighlight: combineChunks({ - chunks: findChunks({ - autoEscape: autoEscape2, - caseSensitive, - sanitize, - searchWords, - textToHighlight - }) - }), - totalLength: textToHighlight ? textToHighlight.length : 0 - }); - } - __name(findAll, "findAll"); - function combineChunks(_ref2) { - var chunks = _ref2.chunks; - return chunks.sort(function (first, second) { - return first.start - second.start; - }).reduce(function (processedChunks, nextChunk) { - if (processedChunks.length === 0) { - return [nextChunk]; - } else { - var prevChunk = processedChunks.pop(); - if (nextChunk.start <= prevChunk.end) { - var endIndex = Math.max(prevChunk.end, nextChunk.end); - processedChunks.push({ - highlight: false, - start: prevChunk.start, - end: endIndex - }); - } else { - processedChunks.push(prevChunk, nextChunk); - } - return processedChunks; - } - }, []); - } - __name(combineChunks, "combineChunks"); - function defaultFindChunks(_ref3) { - var autoEscape2 = _ref3.autoEscape, - caseSensitive = _ref3.caseSensitive, - _ref3$sanitize = _ref3.sanitize, - sanitize = _ref3$sanitize === void 0 ? defaultSanitize : _ref3$sanitize, - searchWords = _ref3.searchWords, - textToHighlight = _ref3.textToHighlight; - textToHighlight = sanitize(textToHighlight || ""); - return searchWords.filter(function (searchWord) { - return searchWord; - }).reduce(function (chunks, searchWord) { - searchWord = sanitize(searchWord); - if (autoEscape2) { - searchWord = escapeRegExpFn(searchWord); - } - var regex2 = new RegExp(searchWord, caseSensitive ? "g" : "gi"); - var match2; - while (match2 = regex2.exec(textToHighlight || "")) { - var start = match2.index; - var end = regex2.lastIndex; - if (end > start) { - chunks.push({ - highlight: false, - start, - end - }); - } - if (match2.index === regex2.lastIndex) { - regex2.lastIndex++; - } - } - return chunks; - }, []); - } - __name(defaultFindChunks, "defaultFindChunks"); - function fillInChunks(_ref4) { - var chunksToHighlight = _ref4.chunksToHighlight, - totalLength = _ref4.totalLength; - var allChunks = []; - if (chunksToHighlight.length === 0) { - append(0, totalLength, false); - } else { - var lastIndex = 0; - chunksToHighlight.forEach(function (chunk) { - append(lastIndex, chunk.start, false); - append(chunk.start, chunk.end, true); - lastIndex = chunk.end; - }); - append(lastIndex, totalLength, false); - } - return allChunks; - function append(start, end, highlight) { - if (end - start > 0) { - allChunks.push({ - start, - end, - highlight - }); - } - } - __name(append, "append"); - } - __name(fillInChunks, "fillInChunks"); - function defaultSanitize(string) { - return string; - } - __name(defaultSanitize, "defaultSanitize"); - function escapeRegExpFn(string) { - return string.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); - } - __name(escapeRegExpFn, "escapeRegExpFn"); - var HighlightWords = { - combineChunks, - fillInChunks, - findAll, - findChunks: defaultFindChunks - }; - var _excluded = ["onSelect", "openOnFocus", "children", "as", "aria-label", "aria-labelledby"], - _excluded2 = ["as", "selectOnClick", "autocomplete", "onClick", "onChange", "onKeyDown", "onBlur", "onFocus", "value"], - _excluded3 = ["as", "children", "portal", "onKeyDown", "onBlur", "position"], - _excluded4 = ["persistSelection", "as"], - _excluded5 = ["as", "children", "index", "value", "onClick"]; - var _on, _on2, _on3, _on4, _states; - var IDLE = "IDLE"; - var SUGGESTING = "SUGGESTING"; - var NAVIGATING = "NAVIGATING"; - var INTERACTING = "INTERACTING"; - var CLEAR = "CLEAR"; - var CHANGE = "CHANGE"; - var INITIAL_CHANGE = "INITIAL_CHANGE"; - var NAVIGATE = "NAVIGATE"; - var SELECT_WITH_KEYBOARD = "SELECT_WITH_KEYBOARD"; - var SELECT_WITH_CLICK = "SELECT_WITH_CLICK"; - var ESCAPE = "ESCAPE"; - var BLUR = "BLUR"; - var INTERACT = "INTERACT"; - var FOCUS = "FOCUS"; - var OPEN_WITH_BUTTON = "OPEN_WITH_BUTTON"; - var OPEN_WITH_INPUT_CLICK = "OPEN_WITH_INPUT_CLICK"; - var CLOSE_WITH_BUTTON = "CLOSE_WITH_BUTTON"; - var stateChart = { - initial: IDLE, - states: (_states = {}, _states[IDLE] = { - on: (_on = {}, _on[BLUR] = IDLE, _on[CLEAR] = IDLE, _on[CHANGE] = SUGGESTING, _on[INITIAL_CHANGE] = IDLE, _on[FOCUS] = SUGGESTING, _on[NAVIGATE] = NAVIGATING, _on[OPEN_WITH_BUTTON] = SUGGESTING, _on[OPEN_WITH_INPUT_CLICK] = SUGGESTING, _on) - }, _states[SUGGESTING] = { - on: (_on2 = {}, _on2[CHANGE] = SUGGESTING, _on2[FOCUS] = SUGGESTING, _on2[NAVIGATE] = NAVIGATING, _on2[CLEAR] = IDLE, _on2[ESCAPE] = IDLE, _on2[BLUR] = IDLE, _on2[SELECT_WITH_CLICK] = IDLE, _on2[INTERACT] = INTERACTING, _on2[CLOSE_WITH_BUTTON] = IDLE, _on2) - }, _states[NAVIGATING] = { - on: (_on3 = {}, _on3[CHANGE] = SUGGESTING, _on3[FOCUS] = SUGGESTING, _on3[CLEAR] = IDLE, _on3[BLUR] = IDLE, _on3[ESCAPE] = IDLE, _on3[NAVIGATE] = NAVIGATING, _on3[SELECT_WITH_CLICK] = IDLE, _on3[SELECT_WITH_KEYBOARD] = IDLE, _on3[CLOSE_WITH_BUTTON] = IDLE, _on3[INTERACT] = INTERACTING, _on3) - }, _states[INTERACTING] = { - on: (_on4 = {}, _on4[CLEAR] = IDLE, _on4[CHANGE] = SUGGESTING, _on4[FOCUS] = SUGGESTING, _on4[BLUR] = IDLE, _on4[ESCAPE] = IDLE, _on4[NAVIGATE] = NAVIGATING, _on4[CLOSE_WITH_BUTTON] = IDLE, _on4[SELECT_WITH_CLICK] = IDLE, _on4) - }, _states) - }; - var reducer = /* @__PURE__ */__name(function reducer2(data, event) { - var nextState = _extends({}, data, { - lastEventType: event.type - }); - switch (event.type) { - case CHANGE: - case INITIAL_CHANGE: - return _extends({}, nextState, { - navigationValue: null, - value: event.value - }); - case NAVIGATE: - case OPEN_WITH_BUTTON: - case OPEN_WITH_INPUT_CLICK: - return _extends({}, nextState, { - navigationValue: findNavigationValue(nextState, event) - }); - case CLEAR: - return _extends({}, nextState, { - value: "", - navigationValue: null - }); - case BLUR: - case ESCAPE: - return _extends({}, nextState, { - navigationValue: null - }); - case SELECT_WITH_CLICK: - return _extends({}, nextState, { - value: event.isControlled ? data.value : event.value, - navigationValue: null - }); - case SELECT_WITH_KEYBOARD: - return _extends({}, nextState, { - value: event.isControlled ? data.value : data.navigationValue, - navigationValue: null - }); - case CLOSE_WITH_BUTTON: - return _extends({}, nextState, { - navigationValue: null - }); - case INTERACT: - return nextState; - case FOCUS: - return _extends({}, nextState, { - navigationValue: findNavigationValue(nextState, event) - }); - default: - return nextState; - } - }, "reducer"); - function popoverIsExpanded(state2) { - return [SUGGESTING, NAVIGATING, INTERACTING].includes(state2); - } - __name(popoverIsExpanded, "popoverIsExpanded"); - function findNavigationValue(stateData, event) { - if (event.value) { - return event.value; - } else if (event.persistSelection) { - return stateData.value; - } else { - return null; - } - } - __name(findNavigationValue, "findNavigationValue"); - var ComboboxDescendantContext = /* @__PURE__ */createDescendantContext(); - var ComboboxContext = /* @__PURE__ */createNamedContext("ComboboxContext", {}); - var OptionContext = /* @__PURE__ */createNamedContext("OptionContext", {}); - var Combobox = /* @__PURE__ */(0, React.forwardRef)(function (_ref2, forwardedRef) { - var _data$navigationValue; - var onSelect = _ref2.onSelect, - _ref$openOnFocus = _ref2.openOnFocus, - openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus, - children = _ref2.children, - _ref$as = _ref2.as, - Comp = _ref$as === void 0 ? "div" : _ref$as, - ariaLabel = _ref2["aria-label"], - ariaLabelledby = _ref2["aria-labelledby"], - props2 = _objectWithoutPropertiesLoose(_ref2, _excluded); - var _useDescendantsInit = useDescendantsInit(), - options = _useDescendantsInit[0], - setOptions = _useDescendantsInit[1]; - var inputRef = (0, React.useRef)(); - var popoverRef = (0, React.useRef)(); - var buttonRef = (0, React.useRef)(); - var autocompletePropRef = (0, React.useRef)(false); - var persistSelectionRef = (0, React.useRef)(false); - var defaultData = { - value: "", - navigationValue: null - }; - var _useReducerMachine = useReducerMachine(stateChart, reducer, defaultData), - state2 = _useReducerMachine[0], - data = _useReducerMachine[1], - transition2 = _useReducerMachine[2]; - useFocusManagement(data.lastEventType, inputRef); - var id2 = useId(props2.id); - var listboxId = id2 ? makeId("listbox", id2) : "listbox"; - var isControlledRef = (0, React.useRef)(false); - var isExpanded = popoverIsExpanded(state2); - var context = { - ariaLabel, - ariaLabelledby, - autocompletePropRef, - buttonRef, - comboboxId: id2, - data, - inputRef, - isExpanded, - listboxId, - onSelect: onSelect || noop, - openOnFocus, - persistSelectionRef, - popoverRef, - state: state2, - transition: transition2, - isControlledRef - }; - return /* @__PURE__ */(0, React.createElement)(DescendantProvider, { - context: ComboboxDescendantContext, - items: options, - set: setOptions - }, /* @__PURE__ */(0, React.createElement)(ComboboxContext.Provider, { - value: context - }, /* @__PURE__ */(0, React.createElement)(Comp, _extends({}, props2, { - "data-reach-combobox": "", - "data-state": getDataState(state2), - "data-expanded": isExpanded || void 0, - ref: forwardedRef - }), isFunction$1(children) ? children({ - id: id2, - isExpanded, - navigationValue: (_data$navigationValue = data.navigationValue) != null ? _data$navigationValue : null, - state: state2 - }) : children))); - }); - var ComboboxInput = /* @__PURE__ */(0, React.forwardRef)(function (_ref2, forwardedRef) { - var _ref2$as = _ref2.as, - Comp = _ref2$as === void 0 ? "input" : _ref2$as, - _ref2$selectOnClick = _ref2.selectOnClick, - selectOnClick = _ref2$selectOnClick === void 0 ? false : _ref2$selectOnClick, - _ref2$autocomplete = _ref2.autocomplete, - autocomplete = _ref2$autocomplete === void 0 ? true : _ref2$autocomplete, - onClick = _ref2.onClick, - onChange = _ref2.onChange, - onKeyDown = _ref2.onKeyDown, - onBlur3 = _ref2.onBlur, - onFocus3 = _ref2.onFocus, - controlledValue = _ref2.value, - props2 = _objectWithoutPropertiesLoose(_ref2, _excluded2); - var _React$useRef = (0, React.useRef)(controlledValue), - initialControlledValue = _React$useRef.current; - var controlledValueChangedRef = (0, React.useRef)(false); - useUpdateEffect(function () { - controlledValueChangedRef.current = true; - }, [controlledValue]); - var _React$useContext = (0, React.useContext)(ComboboxContext), - _React$useContext$dat = _React$useContext.data, - navigationValue4 = _React$useContext$dat.navigationValue, - value3 = _React$useContext$dat.value, - lastEventType = _React$useContext$dat.lastEventType, - inputRef = _React$useContext.inputRef, - state2 = _React$useContext.state, - transition2 = _React$useContext.transition, - listboxId = _React$useContext.listboxId, - autocompletePropRef = _React$useContext.autocompletePropRef, - openOnFocus = _React$useContext.openOnFocus, - isExpanded = _React$useContext.isExpanded, - ariaLabel = _React$useContext.ariaLabel, - ariaLabelledby = _React$useContext.ariaLabelledby, - persistSelectionRef = _React$useContext.persistSelectionRef, - isControlledRef = _React$useContext.isControlledRef; - var ref = useComposedRefs(inputRef, forwardedRef); - var selectOnClickRef = (0, React.useRef)(false); - var handleKeyDown = useKeyDown(); - var handleBlur = useBlur(); - var isControlled = typeof controlledValue !== "undefined"; - (0, React.useEffect)(function () { - isControlledRef.current = isControlled; - }, [isControlled]); - useIsomorphicLayoutEffect(function () { - autocompletePropRef.current = autocomplete; - }, [autocomplete, autocompletePropRef]); - var handleValueChange = (0, React.useCallback)(function (value4) { - if (value4.trim() === "") { - transition2(CLEAR, { - isControlled - }); - } else if (value4 === initialControlledValue && !controlledValueChangedRef.current) { - transition2(INITIAL_CHANGE, { - value: value4 - }); - } else { - transition2(CHANGE, { - value: value4 - }); - } - }, [initialControlledValue, transition2, isControlled]); - (0, React.useEffect)(function () { - if (isControlled && controlledValue !== value3 && (controlledValue.trim() === "" ? (value3 || "").trim() !== "" : true)) { - handleValueChange(controlledValue); - } - }, [controlledValue, handleValueChange, isControlled, value3]); - function handleChange(event) { - var value4 = event.target.value; - if (!isControlled) { - handleValueChange(value4); - } - } - __name(handleChange, "handleChange"); - function handleFocus() { - if (selectOnClick) { - selectOnClickRef.current = true; - } - if (openOnFocus && lastEventType !== SELECT_WITH_CLICK) { - transition2(FOCUS, { - persistSelection: persistSelectionRef.current - }); - } - } - __name(handleFocus, "handleFocus"); - function handleClick() { - if (selectOnClickRef.current) { - var _inputRef$current; - selectOnClickRef.current = false; - (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.select(); - } - if (openOnFocus && state2 === IDLE) { - transition2(OPEN_WITH_INPUT_CLICK); - } - } - __name(handleClick, "handleClick"); - var inputValue = autocomplete && (state2 === NAVIGATING || state2 === INTERACTING) ? navigationValue4 || controlledValue || value3 : controlledValue || value3; - return /* @__PURE__ */(0, React.createElement)(Comp, _extends({ - "aria-activedescendant": navigationValue4 ? String(makeHash(navigationValue4)) : void 0, - "aria-autocomplete": "both", - "aria-controls": listboxId, - "aria-expanded": isExpanded, - "aria-haspopup": "listbox", - "aria-label": ariaLabel, - "aria-labelledby": ariaLabel ? void 0 : ariaLabelledby, - role: "combobox" - }, props2, { - "data-reach-combobox-input": "", - "data-state": getDataState(state2), - ref, - onBlur: composeEventHandlers(onBlur3, handleBlur), - onChange: composeEventHandlers(onChange, handleChange), - onClick: composeEventHandlers(onClick, handleClick), - onFocus: composeEventHandlers(onFocus3, handleFocus), - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown), - value: inputValue || "" - })); - }); - var ComboboxPopover = /* @__PURE__ */(0, React.forwardRef)(function (_ref3, forwardedRef) { - var _ref3$as = _ref3.as, - Comp = _ref3$as === void 0 ? "div" : _ref3$as, - children = _ref3.children, - _ref3$portal = _ref3.portal, - portal = _ref3$portal === void 0 ? true : _ref3$portal, - onKeyDown = _ref3.onKeyDown, - onBlur3 = _ref3.onBlur, - _ref3$position = _ref3.position, - position = _ref3$position === void 0 ? positionMatchWidth : _ref3$position, - props2 = _objectWithoutPropertiesLoose(_ref3, _excluded3); - var _React$useContext2 = (0, React.useContext)(ComboboxContext), - popoverRef = _React$useContext2.popoverRef, - inputRef = _React$useContext2.inputRef, - isExpanded = _React$useContext2.isExpanded, - state2 = _React$useContext2.state; - var ref = useComposedRefs(popoverRef, forwardedRef); - var handleKeyDown = useKeyDown(); - var handleBlur = useBlur(); - var sharedProps = { - "data-reach-combobox-popover": "", - "data-state": getDataState(state2), - onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown), - onBlur: composeEventHandlers(onBlur3, handleBlur), - hidden: !isExpanded, - tabIndex: -1, - children - }; - return portal ? /* @__PURE__ */(0, React.createElement)(Popover, _extends({ - as: Comp - }, props2, { - ref, - "data-expanded": isExpanded || void 0, - position, - targetRef: inputRef, - unstable_skipInitialPortalRender: true - }, sharedProps)) : /* @__PURE__ */(0, React.createElement)(Comp, _extends({ - ref - }, props2, sharedProps)); - }); - var ComboboxList = /* @__PURE__ */(0, React.forwardRef)(function (_ref4, forwardedRef) { - var _ref4$persistSelectio = _ref4.persistSelection, - persistSelection = _ref4$persistSelectio === void 0 ? false : _ref4$persistSelectio, - _ref4$as = _ref4.as, - Comp = _ref4$as === void 0 ? "ul" : _ref4$as, - props2 = _objectWithoutPropertiesLoose(_ref4, _excluded4); - var _React$useContext3 = (0, React.useContext)(ComboboxContext), - persistSelectionRef = _React$useContext3.persistSelectionRef, - listboxId = _React$useContext3.listboxId; - if (persistSelection) { - persistSelectionRef.current = true; - } - return /* @__PURE__ */(0, React.createElement)(Comp, _extends({ - role: "listbox" - }, props2, { - ref: forwardedRef, - "data-reach-combobox-list": "", - id: listboxId - })); - }); - var ComboboxOption = /* @__PURE__ */(0, React.forwardRef)(function (_ref5, forwardedRef) { - var _ref5$as = _ref5.as, - Comp = _ref5$as === void 0 ? "li" : _ref5$as, - children = _ref5.children, - indexProp = _ref5.index, - value3 = _ref5.value, - onClick = _ref5.onClick, - props2 = _objectWithoutPropertiesLoose(_ref5, _excluded5); - var _React$useContext4 = (0, React.useContext)(ComboboxContext), - onSelect = _React$useContext4.onSelect, - navigationValue4 = _React$useContext4.data.navigationValue, - transition2 = _React$useContext4.transition, - isControlledRef = _React$useContext4.isControlledRef; - var ownRef = (0, React.useRef)(null); - var _useStatefulRefValue = useStatefulRefValue(ownRef, null), - element = _useStatefulRefValue[0], - handleRefSet = _useStatefulRefValue[1]; - var descendant = (0, React.useMemo)(function () { - return { - element, - value: value3 - }; - }, [value3, element]); - var index = useDescendant(descendant, ComboboxDescendantContext, indexProp); - var ref = useComposedRefs(forwardedRef, handleRefSet); - var isActive = navigationValue4 === value3; - var handleClick = /* @__PURE__ */__name(function handleClick2() { - onSelect && onSelect(value3); - transition2(SELECT_WITH_CLICK, { - value: value3, - isControlled: isControlledRef.current - }); - }, "handleClick"); - return /* @__PURE__ */(0, React.createElement)(OptionContext.Provider, { - value: { - value: value3, - index - } - }, /* @__PURE__ */(0, React.createElement)(Comp, _extends({ - "aria-selected": isActive, - role: "option" - }, props2, { - "data-reach-combobox-option": "", - ref, - id: String(makeHash(value3)), - "data-highlighted": isActive ? "" : void 0, - tabIndex: -1, - onClick: composeEventHandlers(onClick, handleClick) - }), children ? isFunction$1(children) ? children({ - value: value3, - index - }) : children : /* @__PURE__ */(0, React.createElement)(ComboboxOptionText, null))); - }); - function ComboboxOptionText() { - var _React$useContext5 = (0, React.useContext)(OptionContext), - value3 = _React$useContext5.value; - var _React$useContext6 = (0, React.useContext)(ComboboxContext), - contextValue = _React$useContext6.data.value; - var results = (0, React.useMemo)(function () { - return HighlightWords.findAll({ - searchWords: escapeRegexp(contextValue || "").split(/\s+/), - textToHighlight: value3 - }); - }, [contextValue, value3]); - return /* @__PURE__ */(0, React.createElement)(React.Fragment, null, results.length ? results.map(function (result, index) { - var str = value3.slice(result.start, result.end); - return /* @__PURE__ */(0, React.createElement)("span", { - key: index, - "data-reach-combobox-option-text": "", - "data-user-value": result.highlight ? true : void 0, - "data-suggested-value": result.highlight ? void 0 : true - }, str); - }) : value3); - } - __name(ComboboxOptionText, "ComboboxOptionText"); - function useFocusManagement(lastEventType, inputRef) { - useIsomorphicLayoutEffect(function () { - if (lastEventType === NAVIGATE || lastEventType === ESCAPE || lastEventType === SELECT_WITH_CLICK || lastEventType === OPEN_WITH_BUTTON) { - var _inputRef$current2; - (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus(); - } - }, [inputRef, lastEventType]); - } - __name(useFocusManagement, "useFocusManagement"); - function useKeyDown() { - var _React$useContext8 = (0, React.useContext)(ComboboxContext), - navigationValue4 = _React$useContext8.data.navigationValue, - onSelect = _React$useContext8.onSelect, - state2 = _React$useContext8.state, - transition2 = _React$useContext8.transition, - autocompletePropRef = _React$useContext8.autocompletePropRef, - persistSelectionRef = _React$useContext8.persistSelectionRef, - isControlledRef = _React$useContext8.isControlledRef; - var options = useDescendants(ComboboxDescendantContext); - return /* @__PURE__ */__name(function handleKeyDown(event) { - var index = options.findIndex(function (_ref7) { - var value3 = _ref7.value; - return value3 === navigationValue4; - }); - function getNextOption() { - var atBottom = index === options.length - 1; - if (atBottom) { - if (autocompletePropRef.current) { - return null; - } else { - return getFirstOption(); - } - } else { - return options[(index + 1) % options.length]; - } - } - __name(getNextOption, "getNextOption"); - function getPreviousOption() { - var atTop = index === 0; - if (atTop) { - if (autocompletePropRef.current) { - return null; - } else { - return getLastOption(); - } - } else if (index === -1) { - return getLastOption(); - } else { - return options[(index - 1 + options.length) % options.length]; - } - } - __name(getPreviousOption, "getPreviousOption"); - function getFirstOption() { - return options[0]; - } - __name(getFirstOption, "getFirstOption"); - function getLastOption() { - return options[options.length - 1]; - } - __name(getLastOption, "getLastOption"); - switch (event.key) { - case "ArrowDown": - event.preventDefault(); - if (!options || !options.length) { - return; - } - if (state2 === IDLE) { - transition2(NAVIGATE, { - persistSelection: persistSelectionRef.current - }); - } else { - var next = getNextOption(); - transition2(NAVIGATE, { - value: next ? next.value : null - }); - } - break; - case "ArrowUp": - event.preventDefault(); - if (!options || options.length === 0) { - return; - } - if (state2 === IDLE) { - transition2(NAVIGATE); - } else { - var prev = getPreviousOption(); - transition2(NAVIGATE, { - value: prev ? prev.value : null - }); - } - break; - case "Home": - case "PageUp": - event.preventDefault(); - if (!options || options.length === 0) { - return; - } - if (state2 === IDLE) { - transition2(NAVIGATE); - } else { - transition2(NAVIGATE, { - value: getFirstOption().value - }); - } - break; - case "End": - case "PageDown": - event.preventDefault(); - if (!options || options.length === 0) { - return; - } - if (state2 === IDLE) { - transition2(NAVIGATE); - } else { - transition2(NAVIGATE, { - value: getLastOption().value - }); - } - break; - case "Escape": - if (state2 !== IDLE) { - transition2(ESCAPE); - } - break; - case "Enter": - if (state2 === NAVIGATING && navigationValue4 !== null) { - event.preventDefault(); - onSelect && onSelect(navigationValue4); - transition2(SELECT_WITH_KEYBOARD, { - isControlled: isControlledRef.current - }); - } - break; - } - }, "handleKeyDown"); - } - __name(useKeyDown, "useKeyDown"); - function useBlur() { - var _React$useContext9 = (0, React.useContext)(ComboboxContext), - state2 = _React$useContext9.state, - transition2 = _React$useContext9.transition, - popoverRef = _React$useContext9.popoverRef, - inputRef = _React$useContext9.inputRef, - buttonRef = _React$useContext9.buttonRef; - return /* @__PURE__ */__name(function handleBlur(event) { - var popover = popoverRef.current; - var input = inputRef.current; - var button2 = buttonRef.current; - var activeElement = event.relatedTarget; - if (activeElement !== input && activeElement !== button2 && popover) { - if (popover.contains(activeElement)) { - if (state2 !== INTERACTING) { - transition2(INTERACT); - } - } else { - transition2(BLUR); - } - } - }, "handleBlur"); - } - __name(useBlur, "useBlur"); - function useReducerMachine(chart2, reducer3, initialData) { - var _React$useState = (0, React.useState)(chart2.initial), - state2 = _React$useState[0], - setState = _React$useState[1]; - var _React$useReducer = (0, React.useReducer)(reducer3, initialData), - data = _React$useReducer[0], - dispatch = _React$useReducer[1]; - var transition2 = /* @__PURE__ */__name(function transition3(event, payload) { - if (payload === void 0) { - payload = {}; - } - var currentState = chart2.states[state2]; - var nextState = currentState && currentState.on[event]; - if (nextState) { - dispatch(_extends({ - type: event, - state: state2, - nextState: state2 - }, payload)); - setState(nextState); - return; - } - }, "transition"); - return [state2, data, transition2]; - } - __name(useReducerMachine, "useReducerMachine"); - function makeHash(str) { - var hash = 0; - if (str.length === 0) { - return hash; - } - for (var i = 0; i < str.length; i++) { - var _char = str.charCodeAt(i); - hash = (hash << 5) - hash + _char; - hash = hash & hash; - } - return hash; - } - __name(makeHash, "makeHash"); - function getDataState(state2) { - return state2.toLowerCase(); - } - __name(getDataState, "getDataState"); - function escapeRegexp(str) { - return String(str).replace(/([.*+?=^!:${}()|[\]/\\])/g, "\\$1"); - } - __name(escapeRegexp, "escapeRegexp"); - var __defProp$n = Object.defineProperty; - var __name$n = /* @__PURE__ */__name((target2, value3) => __defProp$n(target2, "name", { - value: value3, - configurable: true - }), "__name$n"); - function debounce(duration, fn) { - let timeout; - return function () { - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; - } - if (timeout) { - window.clearTimeout(timeout); - } - timeout = window.setTimeout(() => { - timeout = null; - fn(...args); - }, duration); - }; - } - __name(debounce, "debounce"); - __name$n(debounce, "debounce"); - var search = /* @__PURE__ */(() => ':root{--reach-combobox: 1}[data-reach-combobox-popover]{border:solid 1px hsla(0,0%,0%,.25);background:hsla(0,100%,100%,.99);font-size:85%}[data-reach-combobox-list]{list-style:none;margin:0;padding:0;user-select:none}[data-reach-combobox-option]{cursor:pointer;margin:0;padding:.25rem .5rem}[data-reach-combobox-option][aria-selected=true]{background:hsl(211,10%,95%)}[data-reach-combobox-option]:hover{background:hsl(211,10%,92%)}[data-reach-combobox-option][aria-selected=true]:hover{background:hsl(211,10%,90%)}[data-suggested-value]{font-weight:700}[data-reach-combobox]{color:hsla(var(--color-neutral),var(--alpha-secondary))}[data-reach-combobox]:not([data-state="idle"]){border:var(--popover-border);border-radius:var(--border-radius-4);box-shadow:var(--popover-box-shadow);color:hsla(var(--color-neutral),1)}[data-reach-combobox]:not([data-state="idle"]) .graphiql-doc-explorer-search-input{background:hsl(var(--color-base));border-bottom-left-radius:0;border-bottom-right-radius:0}.graphiql-doc-explorer-search-input{align-items:center;background-color:hsla(var(--color-neutral),var(--alpha-background-light));border-radius:var(--border-radius-4);display:flex;padding:var(--px-8) var(--px-12)}[data-reach-combobox-input]{border:none;background-color:transparent;margin-left:var(--px-4);width:100%}[data-reach-combobox-input]:focus{outline:none}[data-reach-combobox-popover]{background-color:hsl(var(--color-base));border:none;border-bottom-left-radius:var(--border-radius-4);border-bottom-right-radius:var(--border-radius-4);border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));max-height:400px;overflow-y:auto;position:relative}[data-reach-combobox-list]{font-size:var(--font-size-body);padding:var(--px-4)}[data-reach-combobox-option]{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));overflow-x:hidden;padding:var(--px-8) var(--px-12);text-overflow:ellipsis;white-space:nowrap}[data-reach-combobox-option][data-highlighted]{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}[data-reach-combobox-option]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}[data-reach-combobox-option][data-highlighted]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-heavy))}[data-reach-combobox-option]+[data-reach-combobox-option]{margin-top:var(--px-4)}.graphiql-doc-explorer-search-type{color:hsl(var(--color-info))}.graphiql-doc-explorer-search-field{color:hsl(var(--color-warning))}.graphiql-doc-explorer-search-argument{color:hsl(var(--color-secondary))}.graphiql-doc-explorer-search-divider{color:hsla(var(--color-neutral),var(--alpha-secondary));font-size:var(--font-size-hint);font-weight:var(--font-weight-medium);margin-top:var(--px-8);padding:var(--px-8) var(--px-12)}.graphiql-doc-explorer-search-empty{color:hsla(var(--color-neutral),var(--alpha-secondary));padding:var(--px-8) var(--px-12)}\n')(); - var __defProp$m = Object.defineProperty; - var __name$m = /* @__PURE__ */__name((target2, value3) => __defProp$m(target2, "name", { - value: value3, - configurable: true - }), "__name$m"); - function Search() { - const { - explorerNavStack, - push - } = useExplorerContext({ - nonNull: true, - caller: Search - }); - const inputRef = (0, React.useRef)(null); - const popoverRef = (0, React.useRef)(null); - const getSearchResults = useSearchResults(); - const [searchValue, setSearchValue] = (0, React.useState)(""); - const [results, setResults] = (0, React.useState)(getSearchResults(searchValue)); - const debouncedGetSearchResults = (0, React.useMemo)(() => debounce(200, search2 => { - setResults(getSearchResults(search2)); - }), [getSearchResults]); - (0, React.useEffect)(() => { - debouncedGetSearchResults(searchValue); - }, [debouncedGetSearchResults, searchValue]); - (0, React.useEffect)(() => { - function handleKeyDown(event) { - if (event.metaKey && event.keyCode === 75 && inputRef.current) { - inputRef.current.focus(); - } - } - __name(handleKeyDown, "handleKeyDown"); - __name$m(handleKeyDown, "handleKeyDown"); - window.addEventListener("keydown", handleKeyDown); - return () => window.removeEventListener("keydown", handleKeyDown); - }, []); - const navItem = explorerNavStack[explorerNavStack.length - 1]; - const shouldSearchBoxAppear = explorerNavStack.length === 1 || (0, _graphql.isObjectType)(navItem.def) || (0, _graphql.isInterfaceType)(navItem.def) || (0, _graphql.isInputObjectType)(navItem.def); - return shouldSearchBoxAppear ? /* @__PURE__ */jsxs(Combobox, { - "aria-label": `Search ${navItem.name}...`, - onSelect: value3 => { - const def = value3; - push("field" in def ? { - name: def.field.name, - def: def.field - } : { - name: def.type.name, - def: def.type - }); - }, - children: [/* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-search-input", - onClick: () => { - if (inputRef.current) { - inputRef.current.focus(); - } - }, - children: [/* @__PURE__ */jsx(MagnifyingGlassIcon, {}), /* @__PURE__ */jsx(ComboboxInput, { - autocomplete: false, - onChange: event => { - setSearchValue(event.target.value); - }, - onKeyDown: event => { - if (!event.isDefaultPrevented()) { - const container = popoverRef.current; - if (!container) { - return; - } - window.requestAnimationFrame(() => { - const element = container.querySelector("[aria-selected=true]"); - if (!(element instanceof HTMLElement)) { - return; - } - const top2 = element.offsetTop - container.scrollTop; - const bottom2 = container.scrollTop + container.clientHeight - (element.offsetTop + element.clientHeight); - if (bottom2 < 0) { - container.scrollTop -= bottom2; - } - if (top2 < 0) { - container.scrollTop += top2; - } - }); - } - event.stopPropagation(); - }, - placeholder: "\u2318 K", - ref: inputRef, - value: searchValue - })] - }), /* @__PURE__ */jsx(ComboboxPopover, { - portal: false, - ref: popoverRef, - children: /* @__PURE__ */jsxs(ComboboxList, { - children: [results.within.map((result, i) => /* @__PURE__ */jsx(ComboboxOption, { - index: i, - value: result, - children: /* @__PURE__ */jsx(Field$1, { - field: result.field, - argument: result.argument - }) - }, `within-${i}`)), results.within.length > 0 && results.types.length + results.fields.length > 0 ? /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-search-divider", - children: "Other results" - }) : null, results.types.map((result, i) => /* @__PURE__ */jsx(ComboboxOption, { - index: results.within.length + i, - value: result, - children: /* @__PURE__ */jsx(Type, { - type: result.type - }) - }, `type-${i}`)), results.fields.map((result, i) => /* @__PURE__ */jsxs(ComboboxOption, { - index: results.within.length + results.types.length + i, - value: result, - children: [/* @__PURE__ */jsx(Type, { - type: result.type - }), ".", /* @__PURE__ */jsx(Field$1, { - field: result.field, - argument: result.argument - })] - }, `field-${i}`)), results.within.length + results.types.length + results.fields.length === 0 ? /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-search-empty", - children: "No results found" - }) : null] - }) - })] - }) : null; - } - __name(Search, "Search"); - __name$m(Search, "Search"); - function useSearchResults(caller) { - const { - explorerNavStack - } = useExplorerContext({ - nonNull: true, - caller: caller || useSearchResults - }); - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useSearchResults - }); - const navItem = explorerNavStack[explorerNavStack.length - 1]; - return (0, React.useCallback)(searchValue => { - const matches2 = { - within: [], - types: [], - fields: [] - }; - if (!schema) { - return matches2; - } - const withinType = navItem.def; - const typeMap = schema.getTypeMap(); - let typeNames = Object.keys(typeMap); - if (withinType) { - typeNames = typeNames.filter(n2 => n2 !== withinType.name); - typeNames.unshift(withinType.name); - } - for (const typeName of typeNames) { - if (matches2.within.length + matches2.types.length + matches2.fields.length >= 100) { - break; - } - const type2 = typeMap[typeName]; - if (withinType !== type2 && isMatch(typeName, searchValue)) { - matches2.types.push({ - type: type2 - }); - } - if (!(0, _graphql.isObjectType)(type2) && !(0, _graphql.isInterfaceType)(type2) && !(0, _graphql.isInputObjectType)(type2)) { - continue; - } - const fields = type2.getFields(); - for (const fieldName in fields) { - const field = fields[fieldName]; - let matchingArgs; - if (!isMatch(fieldName, searchValue)) { - if ("args" in field) { - matchingArgs = field.args.filter(arg => isMatch(arg.name, searchValue)); - if (matchingArgs.length === 0) { - continue; - } - } else { - continue; - } - } - matches2[withinType === type2 ? "within" : "fields"].push(...(matchingArgs ? matchingArgs.map(argument2 => ({ - type: type2, - field, - argument: argument2 - })) : [{ - type: type2, - field - }])); - } - } - return matches2; - }, [navItem.def, schema]); - } - __name(useSearchResults, "useSearchResults"); - __name$m(useSearchResults, "useSearchResults"); - function isMatch(sourceText, searchValue) { - try { - const escaped = searchValue.replace(/[^_0-9A-Za-z]/g, ch => "\\" + ch); - return sourceText.search(new RegExp(escaped, "i")) !== -1; - } catch { - return sourceText.toLowerCase().includes(searchValue.toLowerCase()); - } - } - __name(isMatch, "isMatch"); - __name$m(isMatch, "isMatch"); - function Type(props2) { - return /* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-search-type", - children: props2.type.name - }); - } - __name(Type, "Type"); - __name$m(Type, "Type"); - function Field$1(props2) { - return /* @__PURE__ */jsxs(Fragment, { - children: [/* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-search-field", - children: props2.field.name - }), props2.argument ? /* @__PURE__ */jsxs(Fragment, { - children: ["(", /* @__PURE__ */jsx("span", { - className: "graphiql-doc-explorer-search-argument", - children: props2.argument.name - }), ":", " ", renderType(props2.argument.type, namedType => /* @__PURE__ */jsx(Type, { - type: namedType - })), ")"] - }) : null] - }); - } - __name(Field$1, "Field$1"); - __name$m(Field$1, "Field"); - var fieldLink = /* @__PURE__ */(() => "a.graphiql-doc-explorer-field-name{color:hsl(var(--color-info));text-decoration:none}a.graphiql-doc-explorer-field-name:hover{text-decoration:underline}a.graphiql-doc-explorer-field-name:focus{outline:hsl(var(--color-info)) auto 1px}\n")(); - var __defProp$l = Object.defineProperty; - var __name$l = /* @__PURE__ */__name((target2, value3) => __defProp$l(target2, "name", { - value: value3, - configurable: true - }), "__name$l"); - function FieldLink(props2) { - const { - push - } = useExplorerContext({ - nonNull: true - }); - return /* @__PURE__ */jsx("a", { - className: "graphiql-doc-explorer-field-name", - onClick: event => { - event.preventDefault(); - push({ - name: props2.field.name, - def: props2.field - }); - }, - href: "#", - children: props2.field.name - }); - } - __name(FieldLink, "FieldLink"); - __name$l(FieldLink, "FieldLink"); - var typeDocumentation = /* @__PURE__ */(() => ".graphiql-doc-explorer-item>:not(:first-child){margin-top:var(--px-12)}.graphiql-doc-explorer-argument-multiple{margin-left:var(--px-8)}.graphiql-doc-explorer-enum-value{color:hsl(var(--color-info))}\n")(); - var __defProp$k = Object.defineProperty; - var __name$k = /* @__PURE__ */__name((target2, value3) => __defProp$k(target2, "name", { - value: value3, - configurable: true - }), "__name$k"); - function TypeDocumentation(props2) { - return (0, _graphql.isNamedType)(props2.type) ? /* @__PURE__ */jsxs(Fragment, { - children: [props2.type.description ? /* @__PURE__ */jsx(MarkdownContent, { - type: "description", - children: props2.type.description - }) : null, /* @__PURE__ */jsx(ImplementsInterfaces, { - type: props2.type - }), /* @__PURE__ */jsx(Fields, { - type: props2.type - }), /* @__PURE__ */jsx(EnumValues, { - type: props2.type - }), /* @__PURE__ */jsx(PossibleTypes, { - type: props2.type - })] - }) : null; - } - __name(TypeDocumentation, "TypeDocumentation"); - __name$k(TypeDocumentation, "TypeDocumentation"); - function ImplementsInterfaces(_ref83) { - let { - type: type2 - } = _ref83; - if (!(0, _graphql.isObjectType)(type2)) { - return null; - } - const interfaces = type2.getInterfaces(); - return interfaces.length > 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Implements", - children: type2.getInterfaces().map(implementedInterface => /* @__PURE__ */jsx("div", { - children: /* @__PURE__ */jsx(TypeLink, { - type: implementedInterface - }) - }, implementedInterface.name)) - }) : null; - } - __name(ImplementsInterfaces, "ImplementsInterfaces"); - __name$k(ImplementsInterfaces, "ImplementsInterfaces"); - function Fields(_ref84) { - let { - type: type2 - } = _ref84; - const [showDeprecated, setShowDeprecated] = (0, React.useState)(false); - if (!(0, _graphql.isObjectType)(type2) && !(0, _graphql.isInterfaceType)(type2) && !(0, _graphql.isInputObjectType)(type2)) { - return null; - } - const fieldMap = type2.getFields(); - const fields = []; - const deprecatedFields = []; - for (const field of Object.keys(fieldMap).map(name2 => fieldMap[name2])) { - if (field.deprecationReason) { - deprecatedFields.push(field); - } else { - fields.push(field); - } - } - return /* @__PURE__ */jsxs(Fragment, { - children: [fields.length > 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Fields", - children: fields.map(field => /* @__PURE__ */jsx(Field, { - field - }, field.name)) - }) : null, deprecatedFields.length > 0 ? showDeprecated || fields.length === 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Deprecated Fields", - children: deprecatedFields.map(field => /* @__PURE__ */jsx(Field, { - field - }, field.name)) - }) : /* @__PURE__ */jsx(Button, { - type: "button", - onClick: () => { - setShowDeprecated(true); - }, - children: "Show Deprecated Fields" - }) : null] - }); - } - __name(Fields, "Fields"); - __name$k(Fields, "Fields"); - function Field(_ref85) { - let { - field - } = _ref85; - const args = "args" in field ? field.args.filter(arg => !arg.deprecationReason) : []; - return /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-item", - children: [/* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsx(FieldLink, { - field - }), args.length > 0 ? /* @__PURE__ */jsxs(Fragment, { - children: ["(", /* @__PURE__ */jsx("span", { - children: args.map(arg => args.length === 1 ? /* @__PURE__ */jsx(Argument, { - arg, - inline: true - }, arg.name) : /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-argument-multiple", - children: /* @__PURE__ */jsx(Argument, { - arg, - inline: true - }) - }, arg.name)) - }), ")"] - }) : null, ": ", /* @__PURE__ */jsx(TypeLink, { - type: field.type - }), /* @__PURE__ */jsx(DefaultValue, { - field - })] - }), field.description ? /* @__PURE__ */jsx(MarkdownContent, { - type: "description", - onlyShowFirstChild: true, - children: field.description - }) : null, /* @__PURE__ */jsx(DeprecationReason, { - children: field.deprecationReason - })] - }); - } - __name(Field, "Field"); - __name$k(Field, "Field"); - function EnumValues(_ref86) { - let { - type: type2 - } = _ref86; - const [showDeprecated, setShowDeprecated] = (0, React.useState)(false); - if (!(0, _graphql.isEnumType)(type2)) { - return null; - } - const values = []; - const deprecatedValues = []; - for (const value3 of type2.getValues()) { - if (value3.deprecationReason) { - deprecatedValues.push(value3); - } else { - values.push(value3); - } - } - return /* @__PURE__ */jsxs(Fragment, { - children: [values.length > 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Enum Values", - children: values.map(value3 => /* @__PURE__ */jsx(EnumValue, { - value: value3 - }, value3.name)) - }) : null, deprecatedValues.length > 0 ? showDeprecated || values.length === 0 ? /* @__PURE__ */jsx(ExplorerSection, { - title: "Deprecated Enum Values", - children: deprecatedValues.map(value3 => /* @__PURE__ */jsx(EnumValue, { - value: value3 - }, value3.name)) - }) : /* @__PURE__ */jsx(Button, { - type: "button", - onClick: () => { - setShowDeprecated(true); - }, - children: "Show Deprecated Values" - }) : null] - }); - } - __name(EnumValues, "EnumValues"); - __name$k(EnumValues, "EnumValues"); - function EnumValue(_ref87) { - let { - value: value3 - } = _ref87; - return /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-item", - children: [/* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-enum-value", - children: value3.name - }), value3.description ? /* @__PURE__ */jsx(MarkdownContent, { - type: "description", - children: value3.description - }) : null, value3.deprecationReason ? /* @__PURE__ */jsx(MarkdownContent, { - type: "deprecation", - children: value3.deprecationReason - }) : null] - }); - } - __name(EnumValue, "EnumValue"); - __name$k(EnumValue, "EnumValue"); - function PossibleTypes(_ref88) { - let { - type: type2 - } = _ref88; - const { - schema - } = useSchemaContext({ - nonNull: true - }); - if (!schema || !(0, _graphql.isAbstractType)(type2)) { - return null; - } - return /* @__PURE__ */jsx(ExplorerSection, { - title: (0, _graphql.isInterfaceType)(type2) ? "Implementations" : "Possible Types", - children: schema.getPossibleTypes(type2).map(possibleType => /* @__PURE__ */jsx("div", { - children: /* @__PURE__ */jsx(TypeLink, { - type: possibleType - }) - }, possibleType.name)) - }); - } - __name(PossibleTypes, "PossibleTypes"); - __name$k(PossibleTypes, "PossibleTypes"); - var docExplorer = /* @__PURE__ */(() => ".graphiql-doc-explorer-header{display:flex;justify-content:space-between;position:relative}.graphiql-doc-explorer-header:focus-within .graphiql-doc-explorer-title{visibility:hidden}.graphiql-doc-explorer-header:focus-within .graphiql-doc-explorer-back:not(:focus){color:transparent}.graphiql-doc-explorer-header-content{display:flex;flex-direction:column;min-width:0}.graphiql-doc-explorer-search{height:100%;position:absolute;right:0;top:0}.graphiql-doc-explorer-search:focus-within{left:0}.graphiql-doc-explorer-search [data-reach-combobox-input]{height:24px;width:4ch}.graphiql-doc-explorer-search [data-reach-combobox-input]:focus{width:100%}a.graphiql-doc-explorer-back{align-items:center;color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;text-decoration:none}a.graphiql-doc-explorer-back:hover{text-decoration:underline}a.graphiql-doc-explorer-back:focus{outline:hsla(var(--color-neutral),var(--alpha-secondary)) auto 1px}a.graphiql-doc-explorer-back:focus+.graphiql-doc-explorer-title{visibility:unset}a.graphiql-doc-explorer-back>svg{height:var(--px-8);margin-right:var(--px-8);width:var(--px-8)}.graphiql-doc-explorer-title{font-weight:var(--font-weight-medium);font-size:var(--font-size-h2);overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.graphiql-doc-explorer-title:not(:first-child){font-size:var(--font-size-h3);margin-top:var(--px-8)}.graphiql-doc-explorer-content>*{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-20)}.graphiql-doc-explorer-error{background-color:hsla(var(--color-error),var(--alpha-background-heavy));border:1px solid hsl(var(--color-error));border-radius:var(--border-radius-8);color:hsl(var(--color-error));padding:var(--px-8) var(--px-12)}\n")(); - var __defProp$j = Object.defineProperty; - var __name$j = /* @__PURE__ */__name((target2, value3) => __defProp$j(target2, "name", { - value: value3, - configurable: true - }), "__name$j"); - function DocExplorer() { - const { - fetchError, - isFetching, - schema, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: DocExplorer - }); - const { - explorerNavStack, - pop - } = useExplorerContext({ - nonNull: true, - caller: DocExplorer - }); - const navItem = explorerNavStack[explorerNavStack.length - 1]; - let content = null; - if (fetchError) { - content = /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-error", - children: "Error fetching schema" - }); - } else if (validationErrors.length > 0) { - content = /* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-error", - children: ["Schema is invalid: ", validationErrors[0].message] - }); - } else if (isFetching) { - content = /* @__PURE__ */jsx(Spinner, {}); - } else if (!schema) { - content = /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-error", - children: "No GraphQL schema available" - }); - } else if (explorerNavStack.length === 1) { - content = /* @__PURE__ */jsx(SchemaDocumentation, { - schema - }); - } else if ((0, _graphql.isType)(navItem.def)) { - content = /* @__PURE__ */jsx(TypeDocumentation, { - type: navItem.def - }); - } else if (navItem.def) { - content = /* @__PURE__ */jsx(FieldDocumentation, { - field: navItem.def - }); - } - let prevName; - if (explorerNavStack.length > 1) { - prevName = explorerNavStack[explorerNavStack.length - 2].name; - } - return /* @__PURE__ */jsxs("section", { - className: "graphiql-doc-explorer", - "aria-label": "Documentation Explorer", - children: [/* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-header", - children: [/* @__PURE__ */jsxs("div", { - className: "graphiql-doc-explorer-header-content", - children: [prevName && /* @__PURE__ */jsxs("a", { - href: "#", - className: "graphiql-doc-explorer-back", - onClick: event => { - event.preventDefault(); - pop(); - }, - "aria-label": `Go back to ${prevName}`, - children: [/* @__PURE__ */jsx(ChevronLeftIcon, {}), prevName] - }), /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-title", - children: navItem.name - })] - }), /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-search", - children: /* @__PURE__ */jsx(Search, {}, navItem.name) - })] - }), /* @__PURE__ */jsx("div", { - className: "graphiql-doc-explorer-content", - children: content - })] - }); - } - __name(DocExplorer, "DocExplorer"); - __name$j(DocExplorer, "DocExplorer"); - var __defProp$i = Object.defineProperty; - var __name$i = /* @__PURE__ */__name((target2, value3) => __defProp$i(target2, "name", { - value: value3, - configurable: true - }), "__name$i"); - const DOC_EXPLORER_PLUGIN = { - title: "Documentation Explorer", - icon: /* @__PURE__ */__name$i( /* @__PURE__ */__name(function Icon() { - const pluginContext = usePluginContext(); - return (pluginContext == null ? void 0 : pluginContext.visiblePlugin) === DOC_EXPLORER_PLUGIN ? /* @__PURE__ */jsx(DocsFilledIcon, {}) : /* @__PURE__ */jsx(DocsIcon, {}); - }, "Icon"), "Icon"), - content: DocExplorer - }; - _exports._ = DOC_EXPLORER_PLUGIN; - const HISTORY_PLUGIN = { - title: "History", - icon: HistoryIcon, - content: History - }; - _exports.$ = HISTORY_PLUGIN; - const PluginContext = createNullableContext("PluginContext"); - _exports.a0 = PluginContext; - function PluginContextProvider(props2) { - const storage = useStorageContext(); - const explorerContext = useExplorerContext(); - const historyContext = useHistoryContext(); - const hasExplorerContext = Boolean(explorerContext); - const hasHistoryContext = Boolean(historyContext); - const plugins = (0, React.useMemo)(() => { - const pluginList = []; - const pluginTitles = {}; - if (hasExplorerContext) { - pluginList.push(DOC_EXPLORER_PLUGIN); - pluginTitles[DOC_EXPLORER_PLUGIN.title] = true; - } - if (hasHistoryContext) { - pluginList.push(HISTORY_PLUGIN); - pluginTitles[HISTORY_PLUGIN.title] = true; - } - for (const plugin of props2.plugins || []) { - if (typeof plugin.title !== "string" || !plugin.title) { - throw new Error("All GraphiQL plugins must have a unique title"); - } - if (pluginTitles[plugin.title]) { - throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${plugin.title}'`); - } else { - pluginList.push(plugin); - pluginTitles[plugin.title] = true; - } - } - return pluginList; - }, [hasExplorerContext, hasHistoryContext, props2.plugins]); - const [visiblePlugin, internalSetVisiblePlugin] = (0, React.useState)(() => { - const storedValue = storage == null ? void 0 : storage.get(STORAGE_KEY$4); - const pluginForStoredValue = plugins.find(plugin => plugin.title === storedValue); - if (pluginForStoredValue) { - return pluginForStoredValue; - } - if (storedValue) { - storage == null ? void 0 : storage.set(STORAGE_KEY$4, ""); - } - if (!props2.visiblePlugin) { - return null; - } - return plugins.find(plugin => (typeof props2.visiblePlugin === "string" ? plugin.title : plugin) === props2.visiblePlugin) || null; - }); - const { - onTogglePluginVisibility, - children - } = props2; - const setVisiblePlugin = (0, React.useCallback)(plugin => { - const newVisiblePlugin = plugin ? plugins.find(p2 => (typeof plugin === "string" ? p2.title : p2) === plugin) || null : null; - internalSetVisiblePlugin(current => { - if (newVisiblePlugin === current) { - return current; - } - onTogglePluginVisibility == null ? void 0 : onTogglePluginVisibility(newVisiblePlugin); - return newVisiblePlugin; - }); - }, [onTogglePluginVisibility, plugins]); - (0, React.useEffect)(() => { - if (props2.visiblePlugin) { - setVisiblePlugin(props2.visiblePlugin); - } - }, [plugins, props2.visiblePlugin, setVisiblePlugin]); - const value3 = (0, React.useMemo)(() => ({ - plugins, - setVisiblePlugin, - visiblePlugin - }), [plugins, setVisiblePlugin, visiblePlugin]); - return /* @__PURE__ */jsx(PluginContext.Provider, { - value: value3, - children - }); - } - __name(PluginContextProvider, "PluginContextProvider"); - __name$i(PluginContextProvider, "PluginContextProvider"); - const usePluginContext = createContextHook(PluginContext); - _exports.a2 = usePluginContext; - const STORAGE_KEY$4 = "visiblePlugin"; - var __defProp$h = Object.defineProperty; - var __name$h = /* @__PURE__ */__name((target2, value3) => __defProp$h(target2, "name", { - value: value3, - configurable: true - }), "__name$h"); - function onHasCompletion(_cm, data, schema, explorer, plugin, callback) { - importCodeMirror([], { - useCommonAddons: false - }).then(CodeMirror => { - let information; - let fieldName; - let typeNamePill; - let typeNamePrefix; - let typeName; - let typeNameSuffix; - let description; - let deprecation; - let deprecationReason2; - CodeMirror.on(data, "select", (ctx, el2) => { - if (!information) { - const hintsUl = el2.parentNode; - information = document.createElement("div"); - information.className = "CodeMirror-hint-information"; - hintsUl.appendChild(information); - const header = document.createElement("header"); - header.className = "CodeMirror-hint-information-header"; - information.appendChild(header); - fieldName = document.createElement("span"); - fieldName.className = "CodeMirror-hint-information-field-name"; - header.appendChild(fieldName); - typeNamePill = document.createElement("span"); - typeNamePill.className = "CodeMirror-hint-information-type-name-pill"; - header.appendChild(typeNamePill); - typeNamePrefix = document.createElement("span"); - typeNamePill.appendChild(typeNamePrefix); - typeName = document.createElement("a"); - typeName.className = "CodeMirror-hint-information-type-name"; - typeName.href = "javascript:void 0"; - typeName.addEventListener("click", onClickHintInformation); - typeNamePill.appendChild(typeName); - typeNameSuffix = document.createElement("span"); - typeNamePill.appendChild(typeNameSuffix); - description = document.createElement("div"); - description.className = "CodeMirror-hint-information-description"; - information.appendChild(description); - deprecation = document.createElement("div"); - deprecation.className = "CodeMirror-hint-information-deprecation"; - information.appendChild(deprecation); - const deprecationLabel = document.createElement("span"); - deprecationLabel.className = "CodeMirror-hint-information-deprecation-label"; - deprecationLabel.innerText = "Deprecated"; - deprecation.appendChild(deprecationLabel); - deprecationReason2 = document.createElement("div"); - deprecationReason2.className = "CodeMirror-hint-information-deprecation-reason"; - deprecation.appendChild(deprecationReason2); - const defaultInformationPadding = parseInt(window.getComputedStyle(information).paddingBottom.replace(/px$/, ""), 10) || 0; - const defaultInformationMaxHeight = parseInt(window.getComputedStyle(information).maxHeight.replace(/px$/, ""), 10) || 0; - const handleScroll2 = /* @__PURE__ */__name$h(() => { - if (information) { - information.style.paddingTop = hintsUl.scrollTop + defaultInformationPadding + "px"; - information.style.maxHeight = hintsUl.scrollTop + defaultInformationMaxHeight + "px"; - } - }, "handleScroll"); - hintsUl.addEventListener("scroll", handleScroll2); - let onRemoveFn; - hintsUl.addEventListener("DOMNodeRemoved", onRemoveFn = /* @__PURE__ */__name$h(event => { - if (event.target === hintsUl) { - hintsUl.removeEventListener("scroll", handleScroll2); - hintsUl.removeEventListener("DOMNodeRemoved", onRemoveFn); - if (information) { - information.removeEventListener("click", onClickHintInformation); - } - information = null; - fieldName = null; - typeNamePill = null; - typeNamePrefix = null; - typeName = null; - typeNameSuffix = null; - description = null; - deprecation = null; - deprecationReason2 = null; - onRemoveFn = null; - } - }, "onRemoveFn")); - } - if (fieldName) { - fieldName.innerText = ctx.text; - } - if (typeNamePill && typeNamePrefix && typeName && typeNameSuffix) { - if (ctx.type) { - typeNamePill.style.display = "inline"; - const renderType2 = /* @__PURE__ */__name$h(type2 => { - if ((0, _graphql.isNonNullType)(type2)) { - typeNameSuffix.innerText = "!" + typeNameSuffix.innerText; - renderType2(type2.ofType); - } else if ((0, _graphql.isListType)(type2)) { - typeNamePrefix.innerText += "["; - typeNameSuffix.innerText = "]" + typeNameSuffix.innerText; - renderType2(type2.ofType); - } else { - typeName.innerText = type2.name; - } - }, "renderType"); - typeNamePrefix.innerText = ""; - typeNameSuffix.innerText = ""; - renderType2(ctx.type); - } else { - typeNamePrefix.innerText = ""; - typeName.innerText = ""; - typeNameSuffix.innerText = ""; - typeNamePill.style.display = "none"; - } - } - if (description) { - if (ctx.description) { - description.style.display = "block"; - description.innerHTML = markdown$1.render(ctx.description); - } else { - description.style.display = "none"; - description.innerHTML = ""; - } - } - if (deprecation && deprecationReason2) { - if (ctx.deprecationReason) { - deprecation.style.display = "block"; - deprecationReason2.innerHTML = markdown$1.render(ctx.deprecationReason); - } else { - deprecation.style.display = "none"; - deprecationReason2.innerHTML = ""; - } - } - }); - }); - function onClickHintInformation(event) { - if (!schema || !explorer || !plugin || !(event.currentTarget instanceof HTMLElement)) { - return; - } - const typeName = event.currentTarget.innerText; - const type2 = schema.getType(typeName); - if (type2) { - plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); - explorer.push({ - name: type2.name, - def: type2 - }); - callback == null ? void 0 : callback(type2); - } - } - __name(onClickHintInformation, "onClickHintInformation"); - __name$h(onClickHintInformation, "onClickHintInformation"); - } - __name(onHasCompletion, "onHasCompletion"); - __name$h(onHasCompletion, "onHasCompletion"); - var __defProp$g = Object.defineProperty; - var __name$g = /* @__PURE__ */__name((target2, value3) => __defProp$g(target2, "name", { - value: value3, - configurable: true - }), "__name$g"); - function useSynchronizeValue(editor2, value3) { - (0, React.useEffect)(() => { - if (editor2 && typeof value3 === "string" && value3 !== editor2.getValue()) { - editor2.setValue(value3); - } - }, [editor2, value3]); - } - __name(useSynchronizeValue, "useSynchronizeValue"); - __name$g(useSynchronizeValue, "useSynchronizeValue"); - function useSynchronizeOption(editor2, option, value3) { - (0, React.useEffect)(() => { - if (editor2) { - editor2.setOption(option, value3); - } - }, [editor2, option, value3]); - } - __name(useSynchronizeOption, "useSynchronizeOption"); - __name$g(useSynchronizeOption, "useSynchronizeOption"); - function useChangeHandler(editor2, callback, storageKey, tabProperty, caller) { - const { - updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller - }); - const storage = useStorageContext(); - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - const store = debounce(500, value3 => { - if (!storage || storageKey === null) { - return; - } - storage.set(storageKey, value3); - }); - const updateTab = debounce(100, value3 => { - updateActiveTabValues({ - [tabProperty]: value3 - }); - }); - const handleChange = /* @__PURE__ */__name$g((editorInstance, changeObj) => { - if (!changeObj) { - return; - } - const newValue = editorInstance.getValue(); - store(newValue); - updateTab(newValue); - callback == null ? void 0 : callback(newValue); - }, "handleChange"); - editor2.on("change", handleChange); - return () => editor2.off("change", handleChange); - }, [callback, editor2, storage, storageKey, tabProperty, updateActiveTabValues]); - } - __name(useChangeHandler, "useChangeHandler"); - __name$g(useChangeHandler, "useChangeHandler"); - function useCompletion(editor2, callback, caller) { - const { - schema - } = useSchemaContext({ - nonNull: true, - caller - }); - const explorer = useExplorerContext(); - const plugin = usePluginContext(); - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - const handleCompletion = /* @__PURE__ */__name$g((instance, changeObj) => { - onHasCompletion(instance, changeObj, schema, explorer, plugin, type2 => { - callback == null ? void 0 : callback({ - kind: "Type", - type: type2, - schema: schema || void 0 - }); - }); - }, "handleCompletion"); - editor2.on("hasCompletion", handleCompletion); - return () => editor2.off("hasCompletion", handleCompletion); - }, [callback, editor2, explorer, plugin, schema]); - } - __name(useCompletion, "useCompletion"); - __name$g(useCompletion, "useCompletion"); - function useKeyMap(editor2, keys, callback) { - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - for (const key of keys) { - editor2.removeKeyMap(key); - } - if (callback) { - const keyMap2 = {}; - for (const key of keys) { - keyMap2[key] = () => callback(); - } - editor2.addKeyMap(keyMap2); - } - }, [editor2, keys, callback]); - } - __name(useKeyMap, "useKeyMap"); - __name$g(useKeyMap, "useKeyMap"); - function useCopyQuery() { - let { - caller, - onCopyQuery - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useCopyQuery - }); - return (0, React.useCallback)(() => { - if (!queryEditor) { - return; - } - const query = queryEditor.getValue(); - copyToClipboard(query); - onCopyQuery == null ? void 0 : onCopyQuery(query); - }, [queryEditor, onCopyQuery]); - } - __name(useCopyQuery, "useCopyQuery"); - __name$g(useCopyQuery, "useCopyQuery"); - function useMergeQuery() { - let { - caller - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useMergeQuery - }); - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: useMergeQuery - }); - return (0, React.useCallback)(() => { - const documentAST = queryEditor == null ? void 0 : queryEditor.documentAST; - const query = queryEditor == null ? void 0 : queryEditor.getValue(); - if (!documentAST || !query) { - return; - } - queryEditor.setValue((0, _graphql.print)(mergeAst(documentAST, schema))); - }, [queryEditor, schema]); - } - __name(useMergeQuery, "useMergeQuery"); - __name$g(useMergeQuery, "useMergeQuery"); - function usePrettifyEditors() { - let { - caller - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - queryEditor, - headerEditor, - variableEditor - } = useEditorContext({ - nonNull: true, - caller: caller || usePrettifyEditors - }); - return (0, React.useCallback)(() => { - if (variableEditor) { - const variableEditorContent = variableEditor.getValue(); - try { - const prettifiedVariableEditorContent = JSON.stringify(JSON.parse(variableEditorContent), null, 2); - if (prettifiedVariableEditorContent !== variableEditorContent) { - variableEditor.setValue(prettifiedVariableEditorContent); - } - } catch {} - } - if (headerEditor) { - const headerEditorContent = headerEditor.getValue(); - try { - const prettifiedHeaderEditorContent = JSON.stringify(JSON.parse(headerEditorContent), null, 2); - if (prettifiedHeaderEditorContent !== headerEditorContent) { - headerEditor.setValue(prettifiedHeaderEditorContent); - } - } catch {} - } - if (queryEditor) { - const editorContent = queryEditor.getValue(); - const prettifiedEditorContent = (0, _graphql.print)((0, _graphql.parse)(editorContent)); - if (prettifiedEditorContent !== editorContent) { - queryEditor.setValue(prettifiedEditorContent); - } - } - }, [queryEditor, variableEditor, headerEditor]); - } - __name(usePrettifyEditors, "usePrettifyEditors"); - __name$g(usePrettifyEditors, "usePrettifyEditors"); - function useAutoCompleteLeafs() { - let { - getDefaultFieldNames, - caller - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useAutoCompleteLeafs - }); - const { - queryEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useAutoCompleteLeafs - }); - return (0, React.useCallback)(() => { - if (!queryEditor) { - return; - } - const query = queryEditor.getValue(); - const { - insertions, - result - } = fillLeafs(schema, query, getDefaultFieldNames); - if (insertions && insertions.length > 0) { - queryEditor.operation(() => { - const cursor = queryEditor.getCursor(); - const cursorIndex = queryEditor.indexFromPos(cursor); - queryEditor.setValue(result || ""); - let added = 0; - const markers = insertions.map(_ref89 => { - let { - index, - string - } = _ref89; - return queryEditor.markText(queryEditor.posFromIndex(index + added), queryEditor.posFromIndex(index + (added += string.length)), { - className: "auto-inserted-leaf", - clearOnEnter: true, - title: "Automatically added leaf fields" - }); - }); - setTimeout(() => markers.forEach(marker2 => marker2.clear()), 7e3); - let newCursorIndex = cursorIndex; - insertions.forEach(_ref90 => { - let { - index, - string - } = _ref90; - if (index < cursorIndex) { - newCursorIndex += string.length; - } - }); - queryEditor.setCursor(queryEditor.posFromIndex(newCursorIndex)); - }); - } - return result; - }, [getDefaultFieldNames, queryEditor, schema]); - } - __name(useAutoCompleteLeafs, "useAutoCompleteLeafs"); - __name$g(useAutoCompleteLeafs, "useAutoCompleteLeafs"); - var __defProp$f = Object.defineProperty; - var __name$f = /* @__PURE__ */__name((target2, value3) => __defProp$f(target2, "name", { - value: value3, - configurable: true - }), "__name$f"); - function useHeaderEditor() { - let { - editorTheme = DEFAULT_EDITOR_THEME, - keyMap: keyMap2 = DEFAULT_KEY_MAP, - onEdit, - readOnly = false - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let caller = arguments.length > 1 ? arguments[1] : undefined; - const { - initialHeaders, - headerEditor, - setHeaderEditor, - shouldPersistHeaders - } = useEditorContext({ - nonNull: true, - caller: caller || useHeaderEditor - }); - const executionContext = useExecutionContext(); - const merge = useMergeQuery({ - caller: caller || useHeaderEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useHeaderEditor - }); - const ref = (0, React.useRef)(null); - (0, React.useEffect)(() => { - let isActive = true; - importCodeMirror([Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./javascript.es.js */ "../../graphiql-react/dist/javascript.es.js", 23)).then(function (n2) { - return n2.j; - })]).then(CodeMirror => { - if (!isActive) { - return; - } - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialHeaders, - lineNumbers: true, - tabSize: 2, - mode: { - name: "javascript", - json: true - }, - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - foldGutter: true, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: commonKeys - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - const code3 = event.keyCode; - if (code3 >= 65 && code3 <= 90 || !event.shiftKey && code3 >= 48 && code3 <= 57 || event.shiftKey && code3 === 189 || event.shiftKey && code3 === 222) { - editorInstance.execCommand("autocomplete"); - } - }); - setHeaderEditor(newEditor); - }); - return () => { - isActive = false; - }; - }, [editorTheme, initialHeaders, readOnly, setHeaderEditor]); - useSynchronizeOption(headerEditor, "keyMap", keyMap2); - useChangeHandler(headerEditor, onEdit, shouldPersistHeaders ? STORAGE_KEY$3 : null, "headers", useHeaderEditor); - useKeyMap(headerEditor, ["Cmd-Enter", "Ctrl-Enter"], executionContext == null ? void 0 : executionContext.run); - useKeyMap(headerEditor, ["Shift-Ctrl-P"], prettify); - useKeyMap(headerEditor, ["Shift-Ctrl-M"], merge); - return ref; - } - __name(useHeaderEditor, "useHeaderEditor"); - __name$f(useHeaderEditor, "useHeaderEditor"); - const STORAGE_KEY$3 = "headers"; - var __defProp$e = Object.defineProperty; - var __name$e = /* @__PURE__ */__name((target2, value3) => __defProp$e(target2, "name", { - value: value3, - configurable: true - }), "__name$e"); - const invalidCharacters = Array.from({ - length: 11 - }, (_, i) => { - return String.fromCharCode(8192 + i); - }).concat(["\u2028", "\u2029", "\u202F", "\xA0"]); - const sanitizeRegex = new RegExp("[" + invalidCharacters.join("") + "]", "g"); - function normalizeWhitespace(line) { - return line.replace(sanitizeRegex, " "); - } - __name(normalizeWhitespace, "normalizeWhitespace"); - __name$e(normalizeWhitespace, "normalizeWhitespace"); - var __defProp$d = Object.defineProperty; - var __name$d = /* @__PURE__ */__name((target2, value3) => __defProp$d(target2, "name", { - value: value3, - configurable: true - }), "__name$d"); - function useQueryEditor() { - let { - editorTheme = DEFAULT_EDITOR_THEME, - keyMap: keyMap2 = DEFAULT_KEY_MAP, - onClickReference, - onCopyQuery, - onEdit, - readOnly = false - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let caller = arguments.length > 1 ? arguments[1] : undefined; - const { - schema - } = useSchemaContext({ - nonNull: true, - caller: caller || useQueryEditor - }); - const { - externalFragments, - initialQuery, - queryEditor, - setOperationName, - setQueryEditor, - validationRules, - variableEditor, - updateActiveTabValues - } = useEditorContext({ - nonNull: true, - caller: caller || useQueryEditor - }); - const executionContext = useExecutionContext(); - const storage = useStorageContext(); - const explorer = useExplorerContext(); - const plugin = usePluginContext(); - const copy2 = useCopyQuery({ - caller: caller || useQueryEditor, - onCopyQuery - }); - const merge = useMergeQuery({ - caller: caller || useQueryEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useQueryEditor - }); - const ref = (0, React.useRef)(null); - const codeMirrorRef = (0, React.useRef)(); - const onClickReferenceRef = (0, React.useRef)(() => {}); - (0, React.useEffect)(() => { - onClickReferenceRef.current = reference3 => { - if (!explorer || !plugin) { - return; - } - plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN); - if (reference3 && reference3.kind === "Type") { - explorer.push({ - name: reference3.type.name, - def: reference3.type - }); - } else if (reference3.kind === "Field") { - explorer.push({ - name: reference3.field.name, - def: reference3.field - }); - } else if (reference3.kind === "Argument" && reference3.field) { - explorer.push({ - name: reference3.field.name, - def: reference3.field - }); - } else if (reference3.kind === "EnumValue" && reference3.type) { - explorer.push({ - name: reference3.type.name, - def: reference3.type - }); - } - onClickReference == null ? void 0 : onClickReference(reference3); - }; - }, [explorer, onClickReference, plugin]); - (0, React.useEffect)(() => { - let isActive = true; - importCodeMirror([Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./comment.es.js */ "../../graphiql-react/dist/comment.es.js", 23)).then(function (n2) { - return n2.c; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./search.es.js */ "../../graphiql-react/dist/search.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./hint.es.js */ "../../graphiql-react/dist/hint.es.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./lint.es.js */ "../../graphiql-react/dist/lint.es.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./info.es.js */ "../../graphiql-react/dist/info.es.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./jump.es.js */ "../../graphiql-react/dist/jump.es.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./mode.es.js */ "../../graphiql-react/dist/mode.es.js", 23))]).then(CodeMirror => { - if (!isActive) { - return; - } - codeMirrorRef.current = CodeMirror; - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialQuery, - lineNumbers: true, - tabSize: 2, - foldGutter: true, - mode: "graphql", - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - lint: { - schema: void 0, - validationRules: null, - externalFragments: void 0 - }, - hintOptions: { - schema: void 0, - closeOnUnfocus: false, - completeSingle: false, - container, - externalFragments: void 0 - }, - info: { - schema: void 0, - renderDescription: text3 => markdown$1.render(text3), - onClick: reference3 => { - onClickReferenceRef.current(reference3); - } - }, - jump: { - schema: void 0, - onClick: reference3 => { - onClickReferenceRef.current(reference3); - } - }, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: __spreadProps(__spreadValues({}, commonKeys), { - "Cmd-S"() {}, - "Ctrl-S"() {} - }) - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - }, - "Shift-Alt-Space"() { - newEditor.showHint({ - completeSingle: true, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - if (AUTO_COMPLETE_AFTER_KEY.test(event.key)) { - editorInstance.execCommand("autocomplete"); - } - }); - let showingHints = false; - newEditor.on("startCompletion", () => { - showingHints = true; - }); - newEditor.on("endCompletion", () => { - showingHints = false; - }); - newEditor.on("keydown", (editorInstance, event) => { - if (event.key === "Escape" && showingHints) { - event.stopPropagation(); - } - }); - newEditor.on("beforeChange", (editorInstance, change) => { - var _a; - if (change.origin === "paste") { - const text3 = change.text.map(normalizeWhitespace); - (_a = change.update) == null ? void 0 : _a.call(change, change.from, change.to, text3); - } - }); - newEditor.documentAST = null; - newEditor.operationName = null; - newEditor.operations = null; - newEditor.variableToType = null; - setQueryEditor(newEditor); - }); - return () => { - isActive = false; - }; - }, [editorTheme, initialQuery, readOnly, setQueryEditor]); - useSynchronizeOption(queryEditor, "keyMap", keyMap2); - (0, React.useEffect)(() => { - if (!queryEditor) { - return; - } - function getAndUpdateOperationFacts(editorInstance) { - var _a, _b, _c, _d, _e; - const operationFacts = getOperationFacts(schema, editorInstance.getValue()); - const operationName = getSelectedOperationName((_a = editorInstance.operations) != null ? _a : void 0, (_b = editorInstance.operationName) != null ? _b : void 0, operationFacts == null ? void 0 : operationFacts.operations); - editorInstance.documentAST = (_c = operationFacts == null ? void 0 : operationFacts.documentAST) != null ? _c : null; - editorInstance.operationName = operationName != null ? operationName : null; - editorInstance.operations = (_d = operationFacts == null ? void 0 : operationFacts.operations) != null ? _d : null; - if (variableEditor) { - variableEditor.state.lint.linterOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - variableEditor.options.lint.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - variableEditor.options.hintOptions.variableToType = operationFacts == null ? void 0 : operationFacts.variableToType; - (_e = codeMirrorRef.current) == null ? void 0 : _e.signal(variableEditor, "change", variableEditor); - } - return operationFacts ? __spreadProps(__spreadValues({}, operationFacts), { - operationName - }) : null; - } - __name(getAndUpdateOperationFacts, "getAndUpdateOperationFacts"); - __name$d(getAndUpdateOperationFacts, "getAndUpdateOperationFacts"); - const handleChange = debounce(100, editorInstance => { - var _a; - const query = editorInstance.getValue(); - storage == null ? void 0 : storage.set(STORAGE_KEY_QUERY, query); - const currentOperationName = editorInstance.operationName; - const operationFacts = getAndUpdateOperationFacts(editorInstance); - if ((operationFacts == null ? void 0 : operationFacts.operationName) !== void 0) { - storage == null ? void 0 : storage.set(STORAGE_KEY_OPERATION_NAME, operationFacts.operationName); - } - onEdit == null ? void 0 : onEdit(query, operationFacts == null ? void 0 : operationFacts.documentAST); - if ((operationFacts == null ? void 0 : operationFacts.operationName) && currentOperationName !== operationFacts.operationName) { - setOperationName(operationFacts.operationName); - } - updateActiveTabValues({ - query, - operationName: (_a = operationFacts == null ? void 0 : operationFacts.operationName) != null ? _a : null - }); - }); - getAndUpdateOperationFacts(queryEditor); - queryEditor.on("change", handleChange); - return () => queryEditor.off("change", handleChange); - }, [onEdit, queryEditor, schema, setOperationName, storage, variableEditor, updateActiveTabValues]); - useSynchronizeSchema(queryEditor, schema != null ? schema : null, codeMirrorRef); - useSynchronizeValidationRules(queryEditor, validationRules != null ? validationRules : null, codeMirrorRef); - useSynchronizeExternalFragments(queryEditor, externalFragments, codeMirrorRef); - useCompletion(queryEditor, onClickReference || null, useQueryEditor); - const run3 = executionContext == null ? void 0 : executionContext.run; - const runAtCursor = (0, React.useCallback)(() => { - var _a; - if (!run3 || !queryEditor || !queryEditor.operations || !queryEditor.hasFocus()) { - run3 == null ? void 0 : run3(); - return; - } - const cursorIndex = queryEditor.indexFromPos(queryEditor.getCursor()); - let operationName; - for (const operation of queryEditor.operations) { - if (operation.loc && operation.loc.start <= cursorIndex && operation.loc.end >= cursorIndex) { - operationName = (_a = operation.name) == null ? void 0 : _a.value; - } - } - if (operationName && operationName !== queryEditor.operationName) { - setOperationName(operationName); - } - run3(); - }, [queryEditor, run3, setOperationName]); - useKeyMap(queryEditor, ["Cmd-Enter", "Ctrl-Enter"], runAtCursor); - useKeyMap(queryEditor, ["Shift-Ctrl-C"], copy2); - useKeyMap(queryEditor, ["Shift-Ctrl-P", "Shift-Ctrl-F"], prettify); - useKeyMap(queryEditor, ["Shift-Ctrl-M"], merge); - return ref; - } - __name(useQueryEditor, "useQueryEditor"); - __name$d(useQueryEditor, "useQueryEditor"); - function useSynchronizeSchema(editor2, schema, codeMirrorRef) { - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - const didChange = editor2.options.lint.schema !== schema; - editor2.state.lint.linterOptions.schema = schema; - editor2.options.lint.schema = schema; - editor2.options.hintOptions.schema = schema; - editor2.options.info.schema = schema; - editor2.options.jump.schema = schema; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor2, "change", editor2); - } - }, [editor2, schema, codeMirrorRef]); - } - __name(useSynchronizeSchema, "useSynchronizeSchema"); - __name$d(useSynchronizeSchema, "useSynchronizeSchema"); - function useSynchronizeValidationRules(editor2, validationRules, codeMirrorRef) { - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - const didChange = editor2.options.lint.validationRules !== validationRules; - editor2.state.lint.linterOptions.validationRules = validationRules; - editor2.options.lint.validationRules = validationRules; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor2, "change", editor2); - } - }, [editor2, validationRules, codeMirrorRef]); - } - __name(useSynchronizeValidationRules, "useSynchronizeValidationRules"); - __name$d(useSynchronizeValidationRules, "useSynchronizeValidationRules"); - function useSynchronizeExternalFragments(editor2, externalFragments, codeMirrorRef) { - const externalFragmentList = (0, React.useMemo)(() => [...externalFragments.values()], [externalFragments]); - (0, React.useEffect)(() => { - if (!editor2) { - return; - } - const didChange = editor2.options.lint.externalFragments !== externalFragmentList; - editor2.state.lint.linterOptions.externalFragments = externalFragmentList; - editor2.options.lint.externalFragments = externalFragmentList; - editor2.options.hintOptions.externalFragments = externalFragmentList; - if (didChange && codeMirrorRef.current) { - codeMirrorRef.current.signal(editor2, "change", editor2); - } - }, [editor2, externalFragmentList, codeMirrorRef]); - } - __name(useSynchronizeExternalFragments, "useSynchronizeExternalFragments"); - __name$d(useSynchronizeExternalFragments, "useSynchronizeExternalFragments"); - const AUTO_COMPLETE_AFTER_KEY = /^[a-zA-Z0-9_@(]$/; - const STORAGE_KEY_QUERY = "query"; - const STORAGE_KEY_OPERATION_NAME = "operationName"; - var __defProp$c = Object.defineProperty; - var __name$c = /* @__PURE__ */__name((target2, value3) => __defProp$c(target2, "name", { - value: value3, - configurable: true - }), "__name$c"); - function getDefaultTabState(_ref91) { - let { - defaultQuery, - defaultHeaders, - headers, - defaultTabs, - query, - variables, - storage - } = _ref91; - const storedState = storage == null ? void 0 : storage.get(STORAGE_KEY$2); - try { - if (!storedState) { - throw new Error("Storage for tabs is empty"); - } - const parsed = JSON.parse(storedState); - if (isTabsState(parsed)) { - const expectedHash = hashFromTabContents({ - query, - variables, - headers - }); - let matchingTabIndex = -1; - for (let index = 0; index < parsed.tabs.length; index++) { - const tab = parsed.tabs[index]; - tab.hash = hashFromTabContents({ - query: tab.query, - variables: tab.variables, - headers: tab.headers - }); - if (tab.hash === expectedHash) { - matchingTabIndex = index; - } - } - if (matchingTabIndex >= 0) { - parsed.activeTabIndex = matchingTabIndex; - } else { - const operationName = query ? fuzzyExtractOperationName(query) : null; - parsed.tabs.push({ - id: guid(), - hash: expectedHash, - title: operationName || DEFAULT_TITLE, - query, - variables, - headers, - operationName, - response: null - }); - parsed.activeTabIndex = parsed.tabs.length - 1; - } - return parsed; - } - throw new Error("Storage for tabs is invalid"); - } catch { - return { - activeTabIndex: 0, - tabs: (defaultTabs || [{ - query: query != null ? query : defaultQuery, - variables, - headers: headers != null ? headers : defaultHeaders - }]).map(createTab) - }; - } - } - __name(getDefaultTabState, "getDefaultTabState"); - __name$c(getDefaultTabState, "getDefaultTabState"); - function isTabsState(obj) { - return obj && typeof obj === "object" && !Array.isArray(obj) && hasNumberKey(obj, "activeTabIndex") && "tabs" in obj && Array.isArray(obj.tabs) && obj.tabs.every(isTabState); - } - __name(isTabsState, "isTabsState"); - __name$c(isTabsState, "isTabsState"); - function isTabState(obj) { - return obj && typeof obj === "object" && !Array.isArray(obj) && hasStringKey(obj, "id") && hasStringKey(obj, "title") && hasStringOrNullKey(obj, "query") && hasStringOrNullKey(obj, "variables") && hasStringOrNullKey(obj, "headers") && hasStringOrNullKey(obj, "operationName") && hasStringOrNullKey(obj, "response"); - } - __name(isTabState, "isTabState"); - __name$c(isTabState, "isTabState"); - function hasNumberKey(obj, key) { - return key in obj && typeof obj[key] === "number"; - } - __name(hasNumberKey, "hasNumberKey"); - __name$c(hasNumberKey, "hasNumberKey"); - function hasStringKey(obj, key) { - return key in obj && typeof obj[key] === "string"; - } - __name(hasStringKey, "hasStringKey"); - __name$c(hasStringKey, "hasStringKey"); - function hasStringOrNullKey(obj, key) { - return key in obj && (typeof obj[key] === "string" || obj[key] === null); - } - __name(hasStringOrNullKey, "hasStringOrNullKey"); - __name$c(hasStringOrNullKey, "hasStringOrNullKey"); - function useSynchronizeActiveTabValues(_ref92) { - let { - queryEditor, - variableEditor, - headerEditor, - responseEditor - } = _ref92; - return (0, React.useCallback)(state2 => { - var _a, _b, _c, _d, _e; - const query = (_a = queryEditor == null ? void 0 : queryEditor.getValue()) != null ? _a : null; - const variables = (_b = variableEditor == null ? void 0 : variableEditor.getValue()) != null ? _b : null; - const headers = (_c = headerEditor == null ? void 0 : headerEditor.getValue()) != null ? _c : null; - const operationName = (_d = queryEditor == null ? void 0 : queryEditor.operationName) != null ? _d : null; - const response = (_e = responseEditor == null ? void 0 : responseEditor.getValue()) != null ? _e : null; - return setPropertiesInActiveTab(state2, { - query, - variables, - headers, - response, - operationName - }); - }, [queryEditor, variableEditor, headerEditor, responseEditor]); - } - __name(useSynchronizeActiveTabValues, "useSynchronizeActiveTabValues"); - __name$c(useSynchronizeActiveTabValues, "useSynchronizeActiveTabValues"); - function serializeTabState(tabState) { - let shouldPersistHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return JSON.stringify(tabState, (key, value3) => key === "hash" || key === "response" || !shouldPersistHeaders && key === "headers" ? null : value3); - } - __name(serializeTabState, "serializeTabState"); - __name$c(serializeTabState, "serializeTabState"); - function useStoreTabs(_ref93) { - let { - storage, - shouldPersistHeaders - } = _ref93; - const store = (0, React.useMemo)(() => debounce(500, value3 => { - storage == null ? void 0 : storage.set(STORAGE_KEY$2, value3); - }), [storage]); - return (0, React.useCallback)(currentState => { - store(serializeTabState(currentState, shouldPersistHeaders)); - }, [shouldPersistHeaders, store]); - } - __name(useStoreTabs, "useStoreTabs"); - __name$c(useStoreTabs, "useStoreTabs"); - function useSetEditorValues(_ref94) { - let { - queryEditor, - variableEditor, - headerEditor, - responseEditor - } = _ref94; - return (0, React.useCallback)(_ref95 => { - let { - query, - variables, - headers, - response - } = _ref95; - queryEditor == null ? void 0 : queryEditor.setValue(query != null ? query : ""); - variableEditor == null ? void 0 : variableEditor.setValue(variables != null ? variables : ""); - headerEditor == null ? void 0 : headerEditor.setValue(headers != null ? headers : ""); - responseEditor == null ? void 0 : responseEditor.setValue(response != null ? response : ""); - }, [headerEditor, queryEditor, responseEditor, variableEditor]); - } - __name(useSetEditorValues, "useSetEditorValues"); - __name$c(useSetEditorValues, "useSetEditorValues"); - function createTab() { - let { - query = null, - variables = null, - headers = null - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return { - id: guid(), - hash: hashFromTabContents({ - query, - variables, - headers - }), - title: query && fuzzyExtractOperationName(query) || DEFAULT_TITLE, - query, - variables, - headers, - operationName: null, - response: null - }; - } - __name(createTab, "createTab"); - __name$c(createTab, "createTab"); - function setPropertiesInActiveTab(state2, partialTab) { - return __spreadProps(__spreadValues({}, state2), { - tabs: state2.tabs.map((tab, index) => { - if (index !== state2.activeTabIndex) { - return tab; - } - const newTab = __spreadValues(__spreadValues({}, tab), partialTab); - return __spreadProps(__spreadValues({}, newTab), { - hash: hashFromTabContents(newTab), - title: newTab.operationName || (newTab.query ? fuzzyExtractOperationName(newTab.query) : void 0) || DEFAULT_TITLE - }); - }) - }); - } - __name(setPropertiesInActiveTab, "setPropertiesInActiveTab"); - __name$c(setPropertiesInActiveTab, "setPropertiesInActiveTab"); - function guid() { - const s4 = /* @__PURE__ */__name$c(() => { - return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1); - }, "s4"); - return `${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`; - } - __name(guid, "guid"); - __name$c(guid, "guid"); - function hashFromTabContents(args) { - var _a, _b, _c; - return [(_a = args.query) != null ? _a : "", (_b = args.variables) != null ? _b : "", (_c = args.headers) != null ? _c : ""].join("|"); - } - __name(hashFromTabContents, "hashFromTabContents"); - __name$c(hashFromTabContents, "hashFromTabContents"); - function fuzzyExtractOperationName(str) { - var _a; - const regex2 = /^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m; - const match2 = regex2.exec(str); - return (_a = match2 == null ? void 0 : match2[2]) != null ? _a : null; - } - __name(fuzzyExtractOperationName, "fuzzyExtractOperationName"); - __name$c(fuzzyExtractOperationName, "fuzzyExtractOperationName"); - function clearHeadersFromTabs(storage) { - const persistedTabs = storage == null ? void 0 : storage.get(STORAGE_KEY$2); - if (persistedTabs) { - const parsedTabs = JSON.parse(persistedTabs); - storage == null ? void 0 : storage.set(STORAGE_KEY$2, JSON.stringify(parsedTabs, (key, value3) => key === "headers" ? null : value3)); - } - } - __name(clearHeadersFromTabs, "clearHeadersFromTabs"); - __name$c(clearHeadersFromTabs, "clearHeadersFromTabs"); - const DEFAULT_TITLE = ""; - const STORAGE_KEY$2 = "tabState"; - var __defProp$b = Object.defineProperty; - var __name$b = /* @__PURE__ */__name((target2, value3) => __defProp$b(target2, "name", { - value: value3, - configurable: true - }), "__name$b"); - function useVariableEditor() { - let { - editorTheme = DEFAULT_EDITOR_THEME, - keyMap: keyMap2 = DEFAULT_KEY_MAP, - onClickReference, - onEdit, - readOnly = false - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let caller = arguments.length > 1 ? arguments[1] : undefined; - const { - initialVariables, - variableEditor, - setVariableEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useVariableEditor - }); - const executionContext = useExecutionContext(); - const merge = useMergeQuery({ - caller: caller || useVariableEditor - }); - const prettify = usePrettifyEditors({ - caller: caller || useVariableEditor - }); - const ref = (0, React.useRef)(null); - const codeMirrorRef = (0, React.useRef)(); - (0, React.useEffect)(() => { - let isActive = true; - importCodeMirror([Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./hint.es2.js */ "../../graphiql-react/dist/hint.es2.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./lint.es2.js */ "../../graphiql-react/dist/lint.es2.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./mode.es3.js */ "../../graphiql-react/dist/mode.es3.js", 23))]).then(CodeMirror => { - if (!isActive) { - return; - } - codeMirrorRef.current = CodeMirror; - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialVariables, - lineNumbers: true, - tabSize: 2, - mode: "graphql-variables", - theme: editorTheme, - autoCloseBrackets: true, - matchBrackets: true, - showCursorWhenSelecting: true, - readOnly: readOnly ? "nocursor" : false, - foldGutter: true, - lint: { - variableToType: void 0 - }, - hintOptions: { - closeOnUnfocus: false, - completeSingle: false, - container, - variableToType: void 0 - }, - gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], - extraKeys: commonKeys - }); - newEditor.addKeyMap({ - "Cmd-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Ctrl-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Alt-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - }, - "Shift-Space"() { - newEditor.showHint({ - completeSingle: false, - container - }); - } - }); - newEditor.on("keyup", (editorInstance, event) => { - const code3 = event.keyCode; - if (code3 >= 65 && code3 <= 90 || !event.shiftKey && code3 >= 48 && code3 <= 57 || event.shiftKey && code3 === 189 || event.shiftKey && code3 === 222) { - editorInstance.execCommand("autocomplete"); - } - }); - setVariableEditor(newEditor); - }); - return () => { - isActive = false; - }; - }, [editorTheme, initialVariables, readOnly, setVariableEditor]); - useSynchronizeOption(variableEditor, "keyMap", keyMap2); - useChangeHandler(variableEditor, onEdit, STORAGE_KEY$1, "variables", useVariableEditor); - useCompletion(variableEditor, onClickReference || null, useVariableEditor); - useKeyMap(variableEditor, ["Cmd-Enter", "Ctrl-Enter"], executionContext == null ? void 0 : executionContext.run); - useKeyMap(variableEditor, ["Shift-Ctrl-P"], prettify); - useKeyMap(variableEditor, ["Shift-Ctrl-M"], merge); - return ref; - } - __name(useVariableEditor, "useVariableEditor"); - __name$b(useVariableEditor, "useVariableEditor"); - const STORAGE_KEY$1 = "variables"; - var __defProp$a = Object.defineProperty; - var __name$a = /* @__PURE__ */__name((target2, value3) => __defProp$a(target2, "name", { - value: value3, - configurable: true - }), "__name$a"); - const EditorContext = createNullableContext("EditorContext"); - _exports.E = EditorContext; - function EditorContextProvider(props2) { - const storage = useStorageContext(); - const [headerEditor, setHeaderEditor] = (0, React.useState)(null); - const [queryEditor, setQueryEditor] = (0, React.useState)(null); - const [responseEditor, setResponseEditor] = (0, React.useState)(null); - const [variableEditor, setVariableEditor] = (0, React.useState)(null); - const [shouldPersistHeaders, setShouldPersistHeadersInternal] = (0, React.useState)(() => { - const isStored = (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) !== null; - return props2.shouldPersistHeaders !== false && isStored ? (storage == null ? void 0 : storage.get(PERSIST_HEADERS_STORAGE_KEY)) === "true" : Boolean(props2.shouldPersistHeaders); - }); - useSynchronizeValue(headerEditor, props2.headers); - useSynchronizeValue(queryEditor, props2.query); - useSynchronizeValue(responseEditor, props2.response); - useSynchronizeValue(variableEditor, props2.variables); - const storeTabs = useStoreTabs({ - storage, - shouldPersistHeaders - }); - const [initialState2] = (0, React.useState)(() => { - var _a, _b, _c, _d, _e, _f, _g, _h, _i; - const query = (_b = (_a = props2.query) != null ? _a : storage == null ? void 0 : storage.get(STORAGE_KEY_QUERY)) != null ? _b : null; - const variables = (_d = (_c = props2.variables) != null ? _c : storage == null ? void 0 : storage.get(STORAGE_KEY$1)) != null ? _d : null; - const headers = (_f = (_e = props2.headers) != null ? _e : storage == null ? void 0 : storage.get(STORAGE_KEY$3)) != null ? _f : null; - const response = (_g = props2.response) != null ? _g : ""; - const tabState2 = getDefaultTabState({ - query, - variables, - headers, - defaultTabs: props2.defaultTabs || props2.initialTabs, - defaultQuery: props2.defaultQuery || DEFAULT_QUERY, - defaultHeaders: props2.defaultHeaders, - storage - }); - storeTabs(tabState2); - return { - query: (_h = query != null ? query : tabState2.activeTabIndex === 0 ? tabState2.tabs[0].query : null) != null ? _h : "", - variables: variables != null ? variables : "", - headers: (_i = headers != null ? headers : props2.defaultHeaders) != null ? _i : "", - response, - tabState: tabState2 - }; - }); - const [tabState, setTabState] = (0, React.useState)(initialState2.tabState); - const setShouldPersistHeaders = (0, React.useCallback)(persist => { - var _a; - if (persist) { - storage == null ? void 0 : storage.set(STORAGE_KEY$3, (_a = headerEditor == null ? void 0 : headerEditor.getValue()) != null ? _a : ""); - const serializedTabs = serializeTabState(tabState, true); - storage == null ? void 0 : storage.set(STORAGE_KEY$2, serializedTabs); - } else { - storage == null ? void 0 : storage.set(STORAGE_KEY$3, ""); - clearHeadersFromTabs(storage); - } - setShouldPersistHeadersInternal(persist); - storage == null ? void 0 : storage.set(PERSIST_HEADERS_STORAGE_KEY, persist.toString()); - }, [storage, tabState, headerEditor]); - const lastShouldPersistHeadersProp = (0, React.useRef)(void 0); - (0, React.useEffect)(() => { - const propValue = Boolean(props2.shouldPersistHeaders); - if (lastShouldPersistHeadersProp.current !== propValue) { - setShouldPersistHeaders(propValue); - lastShouldPersistHeadersProp.current = propValue; - } - }, [props2.shouldPersistHeaders, setShouldPersistHeaders]); - const synchronizeActiveTabValues = useSynchronizeActiveTabValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor - }); - const setEditorValues = useSetEditorValues({ - queryEditor, - variableEditor, - headerEditor, - responseEditor - }); - const { - onTabChange, - defaultHeaders, - children - } = props2; - const addTab = (0, React.useCallback)(() => { - setTabState(current => { - const updatedValues = synchronizeActiveTabValues(current); - const updated = { - tabs: [...updatedValues.tabs, createTab({ - headers: defaultHeaders - })], - activeTabIndex: updatedValues.tabs.length - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; - }); - }, [defaultHeaders, onTabChange, setEditorValues, storeTabs, synchronizeActiveTabValues]); - const changeTab = (0, React.useCallback)(index => { - setTabState(current => { - const updated = __spreadProps(__spreadValues({}, synchronizeActiveTabValues(current)), { - activeTabIndex: index - }); - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; - }); - }, [onTabChange, setEditorValues, storeTabs, synchronizeActiveTabValues]); - const closeTab = (0, React.useCallback)(index => { - setTabState(current => { - const updated = { - tabs: current.tabs.filter((_tab, i) => index !== i), - activeTabIndex: Math.max(current.activeTabIndex - 1, 0) - }; - storeTabs(updated); - setEditorValues(updated.tabs[updated.activeTabIndex]); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; - }); - }, [onTabChange, setEditorValues, storeTabs]); - const updateActiveTabValues = (0, React.useCallback)(partialTab => { - setTabState(current => { - const updated = setPropertiesInActiveTab(current, partialTab); - storeTabs(updated); - onTabChange == null ? void 0 : onTabChange(updated); - return updated; - }); - }, [onTabChange, storeTabs]); - const { - onEditOperationName - } = props2; - const setOperationName = (0, React.useCallback)(operationName => { - if (!queryEditor) { - return; - } - queryEditor.operationName = operationName; - updateActiveTabValues({ - operationName - }); - onEditOperationName == null ? void 0 : onEditOperationName(operationName); - }, [onEditOperationName, queryEditor, updateActiveTabValues]); - const externalFragments = (0, React.useMemo)(() => { - const map2 = /* @__PURE__ */new Map(); - if (Array.isArray(props2.externalFragments)) { - for (const fragment of props2.externalFragments) { - map2.set(fragment.name.value, fragment); - } - } else if (typeof props2.externalFragments === "string") { - (0, _graphql.visit)((0, _graphql.parse)(props2.externalFragments, {}), { - FragmentDefinition(fragment) { - map2.set(fragment.name.value, fragment); - } - }); - } else if (props2.externalFragments) { - throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects."); - } - return map2; - }, [props2.externalFragments]); - const validationRules = (0, React.useMemo)(() => props2.validationRules || [], [props2.validationRules]); - const value3 = (0, React.useMemo)(() => __spreadProps(__spreadValues({}, tabState), { - addTab, - changeTab, - closeTab, - updateActiveTabValues, - headerEditor, - queryEditor, - responseEditor, - variableEditor, - setHeaderEditor, - setQueryEditor, - setResponseEditor, - setVariableEditor, - setOperationName, - initialQuery: initialState2.query, - initialVariables: initialState2.variables, - initialHeaders: initialState2.headers, - initialResponse: initialState2.response, - externalFragments, - validationRules, - shouldPersistHeaders, - setShouldPersistHeaders - }), [tabState, addTab, changeTab, closeTab, updateActiveTabValues, headerEditor, queryEditor, responseEditor, variableEditor, setOperationName, initialState2, externalFragments, validationRules, shouldPersistHeaders, setShouldPersistHeaders]); - return /* @__PURE__ */jsx(EditorContext.Provider, { - value: value3, - children - }); - } - __name(EditorContextProvider, "EditorContextProvider"); - __name$a(EditorContextProvider, "EditorContextProvider"); - const useEditorContext = createContextHook(EditorContext); - _exports.f = useEditorContext; - const PERSIST_HEADERS_STORAGE_KEY = "shouldPersistHeaders"; - const DEFAULT_QUERY = `# Welcome to GraphiQL -# -# GraphiQL is an in-browser tool for writing, validating, and -# testing GraphQL queries. -# -# Type queries into this side of the screen, and you will see intelligent -# typeaheads aware of the current GraphQL type schema and live syntax and -# validation errors highlighted within the text. -# -# GraphQL queries typically start with a "{" character. Lines that start -# with a # are ignored. -# -# An example GraphQL query might look like: -# -# { -# field(arg: "value") { -# subField -# } -# } -# -# Keyboard shortcuts: -# -# Prettify query: Shift-Ctrl-P (or press the prettify button) -# -# Merge fragments: Shift-Ctrl-M (or press the merge button) -# -# Run Query: Ctrl-Enter (or press the play button) -# -# Auto Complete: Ctrl-Space (or just start typing) -# - -`; - var codemirror = /* @__PURE__ */(() => '.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror{height:100%;position:absolute;width:100%}.CodeMirror{font-family:var(--font-family-mono)}.CodeMirror,.CodeMirror-gutters{background:none;background-color:var(--editor-background, hsl(var(--color-base)))}.CodeMirror-linenumber{padding:0}.CodeMirror-gutters{border:none}.cm-s-graphiql{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-keyword{color:hsl(var(--color-primary))}.cm-s-graphiql .cm-def{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-punctuation{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-variable{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-atom{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-number{color:hsl(var(--color-success))}.cm-s-graphiql .cm-string{color:hsl(var(--color-warning))}.cm-s-graphiql .cm-builtin{color:hsl(var(--color-success))}.cm-s-graphiql .cm-string-2{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-attribute,.cm-s-graphiql .cm-meta{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-property{color:hsl(var(--color-info))}.cm-s-graphiql .cm-qualifier{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-comment{color:hsla(var(--color-neutral),var(--alpha-secondary))}.cm-s-graphiql .cm-ws{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-invalidchar{color:hsl(var(--color-error))}.cm-s-graphiql .CodeMirror-cursor{border-left:2px solid hsla(var(--color-neutral),var(--alpha-secondary))}.cm-s-graphiql .CodeMirror-linenumber{color:hsla(var(--color-neutral),var(--alpha-tertiary))}div.CodeMirror span.CodeMirror-matchingbracket,div.CodeMirror span.CodeMirror-nonmatchingbracket{color:hsl(var(--color-warning))}.CodeMirror-selected,.CodeMirror-focused .CodeMirror-selected{background:hsla(var(--color-neutral),var(--alpha-background-heavy))}.CodeMirror-dialog{background:inherit;color:inherit;left:0;right:0;overflow:hidden;padding:var(--px-2) var(--px-6);position:absolute;z-index:6}.CodeMirror-dialog-top{border-bottom:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));padding-bottom:var(--px-12);top:0}.CodeMirror-dialog-bottom{border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));bottom:0;padding-top:var(--px-12)}.CodeMirror-search-hint{display:none}.CodeMirror-dialog input{border:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));border-radius:var(--border-radius-4);padding:var(--px-4)}.CodeMirror-dialog input:focus{outline:hsl(var(--color-primary)) solid 2px}.cm-searching{background-color:hsla(var(--color-warning),var(--alpha-background-light));padding-bottom:1.5px;padding-top:.5px}\n')(); - var fold = /* @__PURE__ */(() => '.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\\25be"}.CodeMirror-foldgutter-folded:after{content:"\\25b8"}.CodeMirror-foldgutter{width:var(--px-12)}.CodeMirror-foldmarker{background-color:hsl(var(--color-info));border-radius:var(--border-radius-4);color:hsl(var(--color-base));font-family:inherit;margin:0 var(--px-4);padding:0 var(--px-8);text-shadow:none}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.CodeMirror-foldgutter-open:after,.CodeMirror-foldgutter-folded:after{margin:0 var(--px-2)}\n')(); - var editor = /* @__PURE__ */(() => ".graphiql-editor{height:100%;position:relative;width:100%}.graphiql-editor.hidden{left:-9999px;position:absolute;top:-9999px;visibility:hidden}\n")(); - var __defProp$9 = Object.defineProperty; - var __name$9 = /* @__PURE__ */__name((target2, value3) => __defProp$9(target2, "name", { - value: value3, - configurable: true - }), "__name$9"); - function HeaderEditor(_ka) { - var _la = _ka, - { - isHidden: isHidden2 - } = _la, - hookArgs = __objRest(_la, ["isHidden"]); - const { - headerEditor - } = useEditorContext({ - nonNull: true, - caller: HeaderEditor - }); - const ref = useHeaderEditor(hookArgs, HeaderEditor); - (0, React.useEffect)(() => { - if (headerEditor && !isHidden2) { - headerEditor.refresh(); - } - }, [headerEditor, isHidden2]); - return /* @__PURE__ */jsx("div", { - className: clsx("graphiql-editor", isHidden2 && "hidden"), - ref - }); - } - __name(HeaderEditor, "HeaderEditor"); - __name$9(HeaderEditor, "HeaderEditor"); - var __defProp$8 = Object.defineProperty; - var __name$8 = /* @__PURE__ */__name((target2, value3) => __defProp$8(target2, "name", { - value: value3, - configurable: true - }), "__name$8"); - function ImagePreview(props2) { - var _a; - const [dimensions, setDimensions] = (0, React.useState)({ - width: null, - height: null - }); - const [mime, setMime] = (0, React.useState)(null); - const ref = (0, React.useRef)(null); - const src = (_a = tokenToURL(props2.token)) == null ? void 0 : _a.href; - (0, React.useEffect)(() => { - if (!ref.current) { - return; - } - if (!src) { - setDimensions({ - width: null, - height: null - }); - setMime(null); - return; - } - fetch(src, { - method: "HEAD" - }).then(response => { - setMime(response.headers.get("Content-Type")); - }).catch(() => { - setMime(null); - }); - }, [src]); - const dims = dimensions.width !== null && dimensions.height !== null ? /* @__PURE__ */jsxs("div", { - children: [dimensions.width, "x", dimensions.height, mime === null ? null : " " + mime] - }) : null; - return /* @__PURE__ */jsxs("div", { - children: [/* @__PURE__ */jsx("img", { - onLoad: () => { - var _a2, _b, _c, _d; - setDimensions({ - width: (_b = (_a2 = ref.current) == null ? void 0 : _a2.naturalWidth) != null ? _b : null, - height: (_d = (_c = ref.current) == null ? void 0 : _c.naturalHeight) != null ? _d : null - }); - }, - ref, - src - }), dims] - }); - } - __name(ImagePreview, "ImagePreview"); - __name$8(ImagePreview, "ImagePreview"); - ImagePreview.shouldRender = /* @__PURE__ */__name$8( /* @__PURE__ */__name(function shouldRender(token2) { - const url = tokenToURL(token2); - return url ? isImageURL(url) : false; - }, "shouldRender"), "shouldRender"); - function tokenToURL(token2) { - if (token2.type !== "string") { - return; - } - const value3 = token2.string.slice(1).slice(0, -1).trim(); - try { - const { - location - } = window; - return new URL(value3, location.protocol + "//" + location.host); - } catch { - return; - } - } - __name(tokenToURL, "tokenToURL"); - __name$8(tokenToURL, "tokenToURL"); - function isImageURL(url) { - return /(bmp|gif|jpeg|jpg|png|svg)$/.test(url.pathname); - } - __name(isImageURL, "isImageURL"); - __name$8(isImageURL, "isImageURL"); - var lint = /* @__PURE__ */(() => ".CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px;color:#000;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:#b74c5114}.CodeMirror-lint-line-warning{background-color:#ffd3001a}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-repeat:repeat-x;background-size:10px 3px;background-position:0 95%}.cm-s-graphiql .CodeMirror-lint-mark-error{color:hsl(var(--color-error))}.CodeMirror-lint-mark-error{background-image:linear-gradient(45deg,transparent 65%,hsl(var(--color-error)) 80%,transparent 90%),linear-gradient(135deg,transparent 5%,hsl(var(--color-error)) 15%,transparent 25%),linear-gradient(135deg,transparent 45%,hsl(var(--color-error)) 55%,transparent 65%),linear-gradient(45deg,transparent 25%,hsl(var(--color-error)) 35%,transparent 50%)}.cm-s-graphiql .CodeMirror-lint-mark-warning{color:hsl(var(--color-warning))}.CodeMirror-lint-mark-warning{background-image:linear-gradient(45deg,transparent 65%,hsl(var(--color-warning)) 80%,transparent 90%),linear-gradient(135deg,transparent 5%,hsl(var(--color-warning)) 15%,transparent 25%),linear-gradient(135deg,transparent 45%,hsl(var(--color-warning)) 55%,transparent 65%),linear-gradient(45deg,transparent 25%,hsl(var(--color-warning)) 35%,transparent 50%)}.CodeMirror-lint-tooltip{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);font-size:var(--font-size-body);font-family:var(--font-family);max-width:600px;overflow:hidden;padding:var(--px-12)}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{background-image:none;padding:0}.CodeMirror-lint-message-error{color:hsl(var(--color-error))}.CodeMirror-lint-message-warning{color:hsl(var(--color-warning))}\n")(); - var hint = /* @__PURE__ */(() => ".CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-hints{background:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);display:grid;font-family:var(--font-family);font-size:var(--font-size-body);grid-template-columns:auto fit-content(300px);max-height:264px;padding:0}.CodeMirror-hint{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));grid-column:1 / 2;margin:var(--px-4);padding:var(--px-6) var(--px-8)!important}.CodeMirror-hint:not(:first-child){margin-top:0}li.CodeMirror-hint-active{background:hsla(var(--color-primary),var(--alpha-background-medium));color:hsl(var(--color-primary))}.CodeMirror-hint-information{border-left:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));grid-column:2 / 3;grid-row:1 / 99999;max-height:264px;overflow:auto;padding:var(--px-12)}.CodeMirror-hint-information-header{display:flex;align-items:baseline}.CodeMirror-hint-information-field-name{font-size:var(--font-size-h4);font-weight:var(--font-weight-medium)}.CodeMirror-hint-information-type-name-pill{border:1px solid hsla(var(--color-neutral),var(--alpha-tertiary));border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));margin-left:var(--px-6);padding:var(--px-4)}.CodeMirror-hint-information-type-name{color:inherit;text-decoration:none}.CodeMirror-hint-information-type-name:hover{text-decoration:underline dotted}.CodeMirror-hint-information-description{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-12)}\n")(); - var info = /* @__PURE__ */(() => ".CodeMirror-info{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);color:hsla(var(--color-neutral),1);max-height:300px;max-width:400px;opacity:0;overflow:auto;padding:var(--px-12);position:fixed;transition:opacity .15s;z-index:10}.CodeMirror-info a{color:inherit;text-decoration:none}.CodeMirror-info a:hover{text-decoration:underline dotted}.CodeMirror-info .CodeMirror-info-header{display:flex;align-items:baseline}.CodeMirror-info .CodeMirror-info-header>.type-name,.CodeMirror-info .CodeMirror-info-header>.field-name,.CodeMirror-info .CodeMirror-info-header>.arg-name,.CodeMirror-info .CodeMirror-info-header>.directive-name,.CodeMirror-info .CodeMirror-info-header>.enum-value{font-size:var(--font-size-h4);font-weight:var(--font-weight-medium)}.CodeMirror-info .type-name-pill{border:1px solid hsla(var(--color-neutral),var(--alpha-tertiary));border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));margin-left:var(--px-6);padding:var(--px-4)}.CodeMirror-info .info-description{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-12);overflow:hidden}\n")(); - var jump = /* @__PURE__ */(() => ".CodeMirror-jump-token{text-decoration:underline dotted;cursor:pointer}\n")(); - var autoInsertion = /* @__PURE__ */(() => ".auto-inserted-leaf.cm-property{animation-duration:6s;animation-name:insertionFade;border-radius:var(--border-radius-4);padding:var(--px-2)}@keyframes insertionFade{0%,to{background-color:none}15%,85%{background-color:hsla(var(--color-warning),var(--alpha-background-light))}}\n")(); - var __defProp$7 = Object.defineProperty; - var __name$7 = /* @__PURE__ */__name((target2, value3) => __defProp$7(target2, "name", { - value: value3, - configurable: true - }), "__name$7"); - function QueryEditor(props2) { - const ref = useQueryEditor(props2, QueryEditor); - return /* @__PURE__ */jsx("div", { - className: "graphiql-editor", - ref - }); - } - __name(QueryEditor, "QueryEditor"); - __name$7(QueryEditor, "QueryEditor"); - var __defProp$6 = Object.defineProperty; - var __name$6 = /* @__PURE__ */__name((target2, value3) => __defProp$6(target2, "name", { - value: value3, - configurable: true - }), "__name$6"); - function useResponseEditor() { - let { - responseTooltip, - editorTheme = DEFAULT_EDITOR_THEME, - keyMap: keyMap2 = DEFAULT_KEY_MAP - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let caller = arguments.length > 1 ? arguments[1] : undefined; - const { - fetchError, - validationErrors - } = useSchemaContext({ - nonNull: true, - caller: caller || useResponseEditor - }); - const { - initialResponse, - responseEditor, - setResponseEditor - } = useEditorContext({ - nonNull: true, - caller: caller || useResponseEditor - }); - const ref = (0, React.useRef)(null); - const responseTooltipRef = (0, React.useRef)(responseTooltip); - (0, React.useEffect)(() => { - responseTooltipRef.current = responseTooltip; - }, [responseTooltip]); - (0, React.useEffect)(() => { - let isActive = true; - importCodeMirror([Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./foldgutter.es.js */ "../../graphiql-react/dist/foldgutter.es.js", 23)).then(function (n2) { - return n2.f; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./brace-fold.es.js */ "../../graphiql-react/dist/brace-fold.es.js", 23)).then(function (n2) { - return n2.b; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./dialog.es.js */ "../../graphiql-react/dist/dialog.es.js", 23)).then(function (n2) { - return n2.d; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./search.es.js */ "../../graphiql-react/dist/search.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./searchcursor.es.js */ "../../graphiql-react/dist/searchcursor.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./jump-to-line.es.js */ "../../graphiql-react/dist/jump-to-line.es.js", 23)).then(function (n2) { - return n2.j; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./sublime.es.js */ "../../graphiql-react/dist/sublime.es.js", 23)).then(function (n2) { - return n2.s; - }), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./mode.es2.js */ "../../graphiql-react/dist/mode.es2.js", 23)), Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./info-addon.es.js */ "../../graphiql-react/dist/info-addon.es.js", 23))], { - useCommonAddons: false - }).then(CodeMirror => { - if (!isActive) { - return; - } - const tooltipDiv = document.createElement("div"); - CodeMirror.registerHelper("info", "graphql-results", (token2, _options, _cm, pos) => { - const infoElements = []; - const ResponseTooltipComponent = responseTooltipRef.current; - if (ResponseTooltipComponent) { - infoElements.push( /* @__PURE__ */jsx(ResponseTooltipComponent, { - pos, - token: token2 - })); - } - if (ImagePreview.shouldRender(token2)) { - infoElements.push( /* @__PURE__ */jsx(ImagePreview, { - token: token2 - }, "image-preview")); - } - if (!infoElements.length) { - _reactDom.default.unmountComponentAtNode(tooltipDiv); - return null; - } - _reactDom.default.render(infoElements, tooltipDiv); - return tooltipDiv; - }); - const container = ref.current; - if (!container) { - return; - } - const newEditor = CodeMirror(container, { - value: initialResponse, - lineWrapping: true, - readOnly: true, - theme: editorTheme, - mode: "graphql-results", - foldGutter: true, - gutters: ["CodeMirror-foldgutter"], - info: true, - extraKeys: commonKeys - }); - setResponseEditor(newEditor); - }); - return () => { - isActive = false; - }; - }, [editorTheme, initialResponse, setResponseEditor]); - useSynchronizeOption(responseEditor, "keyMap", keyMap2); - (0, React.useEffect)(() => { - if (fetchError) { - responseEditor == null ? void 0 : responseEditor.setValue(fetchError); - } - if (validationErrors.length > 0) { - responseEditor == null ? void 0 : responseEditor.setValue(formatError(validationErrors)); - } - }, [responseEditor, fetchError, validationErrors]); - return ref; - } - __name(useResponseEditor, "useResponseEditor"); - __name$6(useResponseEditor, "useResponseEditor"); - var __defProp$5 = Object.defineProperty; - var __name$5 = /* @__PURE__ */__name((target2, value3) => __defProp$5(target2, "name", { - value: value3, - configurable: true - }), "__name$5"); - function ResponseEditor(props2) { - const ref = useResponseEditor(props2, ResponseEditor); - return /* @__PURE__ */jsx("section", { - className: "result-window", - "aria-label": "Result Window", - "aria-live": "polite", - "aria-atomic": "true", - ref - }); - } - __name(ResponseEditor, "ResponseEditor"); - __name$5(ResponseEditor, "ResponseEditor"); - var __defProp$4 = Object.defineProperty; - var __name$4 = /* @__PURE__ */__name((target2, value3) => __defProp$4(target2, "name", { - value: value3, - configurable: true - }), "__name$4"); - function VariableEditor(_ma) { - var _na = _ma, - { - isHidden: isHidden2 - } = _na, - hookArgs = __objRest(_na, ["isHidden"]); - const { - variableEditor - } = useEditorContext({ - nonNull: true, - caller: VariableEditor - }); - const ref = useVariableEditor(hookArgs, VariableEditor); - (0, React.useEffect)(() => { - if (variableEditor && !isHidden2) { - variableEditor.refresh(); - } - }, [variableEditor, isHidden2]); - return /* @__PURE__ */jsx("div", { - className: clsx("graphiql-editor", isHidden2 && "hidden"), - ref - }); - } - __name(VariableEditor, "VariableEditor"); - __name$4(VariableEditor, "VariableEditor"); - var __defProp$3 = Object.defineProperty; - var __name$3 = /* @__PURE__ */__name((target2, value3) => __defProp$3(target2, "name", { - value: value3, - configurable: true - }), "__name$3"); - function GraphiQLProvider(_ref96) { - let { - children, - dangerouslyAssumeSchemaIsValid, - defaultQuery, - defaultHeaders, - defaultTabs, - externalFragments, - fetcher, - getDefaultFieldNames, - headers, - initialTabs, - inputValueDeprecation, - introspectionQueryName, - maxHistoryLength, - onEditOperationName, - onSchemaChange, - onTabChange, - onTogglePluginVisibility, - operationName, - plugins, - query, - response, - schema, - schemaDescription, - shouldPersistHeaders, - storage, - validationRules, - variables, - visiblePlugin - } = _ref96; - return /* @__PURE__ */jsx(StorageContextProvider, { - storage, - children: /* @__PURE__ */jsx(HistoryContextProvider, { - maxHistoryLength, - children: /* @__PURE__ */jsx(EditorContextProvider, { - defaultQuery, - defaultHeaders, - defaultTabs, - externalFragments, - headers, - initialTabs, - onEditOperationName, - onTabChange, - query, - response, - shouldPersistHeaders, - validationRules, - variables, - children: /* @__PURE__ */jsx(SchemaContextProvider, { - dangerouslyAssumeSchemaIsValid, - fetcher, - inputValueDeprecation, - introspectionQueryName, - onSchemaChange, - schema, - schemaDescription, - children: /* @__PURE__ */jsx(ExecutionContextProvider, { - getDefaultFieldNames, - fetcher, - operationName, - children: /* @__PURE__ */jsx(ExplorerContextProvider, { - children: /* @__PURE__ */jsx(PluginContextProvider, { - onTogglePluginVisibility, - plugins, - visiblePlugin, - children - }) - }) - }) - }) - }) - }) - }); - } - __name(GraphiQLProvider, "GraphiQLProvider"); - __name$3(GraphiQLProvider, "GraphiQLProvider"); - var __defProp$2 = Object.defineProperty; - var __name$2 = /* @__PURE__ */__name((target2, value3) => __defProp$2(target2, "name", { - value: value3, - configurable: true - }), "__name$2"); - function useTheme() { - const storageContext = useStorageContext(); - const [theme, setThemeInternal] = (0, React.useState)(() => { - if (!storageContext) { - return null; - } - const stored = storageContext.get(STORAGE_KEY); - switch (stored) { - case "light": - return "light"; - case "dark": - return "dark"; - default: - if (typeof stored === "string") { - storageContext.set(STORAGE_KEY, ""); - } - return null; - } - }); - (0, React.useLayoutEffect)(() => { - if (typeof window === "undefined") { - return; - } - document.body.classList.remove(`graphiql-light`); - document.body.classList.remove(`graphiql-dark`); - if (theme) { - document.body.classList.add(`graphiql-${theme}`); - } - }, [theme]); - const setTheme = (0, React.useCallback)(newTheme => { - storageContext == null ? void 0 : storageContext.set(STORAGE_KEY, newTheme || ""); - setThemeInternal(newTheme); - }, [storageContext]); - return (0, React.useMemo)(() => ({ - theme, - setTheme - }), [theme, setTheme]); - } - __name(useTheme, "useTheme"); - __name$2(useTheme, "useTheme"); - const STORAGE_KEY = "theme"; - var __defProp$1 = Object.defineProperty; - var __name$1 = /* @__PURE__ */__name((target2, value3) => __defProp$1(target2, "name", { - value: value3, - configurable: true - }), "__name$1"); - function useDragResize(_ref97) { - let { - defaultSizeRelation = DEFAULT_FLEX, - direction, - initiallyHidden, - onHiddenElementChange, - sizeThresholdFirst = 100, - sizeThresholdSecond = 100, - storageKey - } = _ref97; - const storage = useStorageContext(); - const store = (0, React.useMemo)(() => debounce(500, value3 => { - if (storage && storageKey) { - storage.set(storageKey, value3); - } - }), [storage, storageKey]); - const [hiddenElement, setHiddenElement] = (0, React.useState)(() => { - const storedValue = storage && storageKey ? storage.get(storageKey) : null; - if (storedValue === HIDE_FIRST || initiallyHidden === "first") { - return "first"; - } - if (storedValue === HIDE_SECOND || initiallyHidden === "second") { - return "second"; - } - return null; - }); - const setHiddenElementWithCallback = (0, React.useCallback)(element => { - if (element !== hiddenElement) { - setHiddenElement(element); - onHiddenElementChange == null ? void 0 : onHiddenElementChange(element); - } - }, [hiddenElement, onHiddenElementChange]); - const firstRef = (0, React.useRef)(null); - const dragBarRef = (0, React.useRef)(null); - const secondRef = (0, React.useRef)(null); - const defaultFlexRef = (0, React.useRef)(`${defaultSizeRelation}`); - (0, React.useLayoutEffect)(() => { - const storedValue = storage && storageKey ? storage.get(storageKey) || defaultFlexRef.current : defaultFlexRef.current; - const flexDirection = direction === "horizontal" ? "row" : "column"; - if (firstRef.current) { - firstRef.current.style.display = "flex"; - firstRef.current.style.flexDirection = flexDirection; - firstRef.current.style.flex = storedValue === HIDE_FIRST || storedValue === HIDE_SECOND ? defaultFlexRef.current : storedValue; - } - if (secondRef.current) { - secondRef.current.style.display = "flex"; - secondRef.current.style.flexDirection = flexDirection; - secondRef.current.style.flex = "1"; - } - if (dragBarRef.current) { - dragBarRef.current.style.display = "flex"; - dragBarRef.current.style.flexDirection = flexDirection; - } - }, [direction, storage, storageKey]); - const hide = (0, React.useCallback)(resizableElement => { - const element = resizableElement === "first" ? firstRef.current : secondRef.current; - if (!element) { - return; - } - element.style.left = "-1000px"; - element.style.position = "absolute"; - element.style.opacity = "0"; - element.style.height = "500px"; - element.style.width = "500px"; - if (firstRef.current) { - const flex = parseFloat(firstRef.current.style.flex); - if (!Number.isFinite(flex) || flex < 1) { - firstRef.current.style.flex = "1"; - } - } - }, []); - const show = (0, React.useCallback)(resizableElement => { - const element = resizableElement === "first" ? firstRef.current : secondRef.current; - if (!element) { - return; - } - element.style.width = ""; - element.style.height = ""; - element.style.opacity = ""; - element.style.position = ""; - element.style.left = ""; - if (firstRef.current && storage && storageKey) { - const storedValue = storage == null ? void 0 : storage.get(storageKey); - if (storedValue !== HIDE_FIRST && storedValue !== HIDE_SECOND) { - firstRef.current.style.flex = storedValue || defaultFlexRef.current; - } - } - }, [storage, storageKey]); - (0, React.useLayoutEffect)(() => { - if (hiddenElement === "first") { - hide("first"); - } else { - show("first"); - } - if (hiddenElement === "second") { - hide("second"); - } else { - show("second"); - } - }, [hiddenElement, hide, show]); - (0, React.useEffect)(() => { - if (!dragBarRef.current || !firstRef.current || !secondRef.current) { - return; - } - const dragBarContainer = dragBarRef.current; - const firstContainer = firstRef.current; - const wrapper = firstContainer.parentElement; - const eventProperty = direction === "horizontal" ? "clientX" : "clientY"; - const rectProperty = direction === "horizontal" ? "left" : "top"; - const adjacentRectProperty = direction === "horizontal" ? "right" : "bottom"; - const sizeProperty = direction === "horizontal" ? "clientWidth" : "clientHeight"; - function handleMouseDown(downEvent) { - downEvent.preventDefault(); - const offset = downEvent[eventProperty] - dragBarContainer.getBoundingClientRect()[rectProperty]; - function handleMouseMove(moveEvent) { - if (moveEvent.buttons === 0) { - return handleMouseUp(); - } - const firstSize = moveEvent[eventProperty] - wrapper.getBoundingClientRect()[rectProperty] - offset; - const secondSize = wrapper.getBoundingClientRect()[adjacentRectProperty] - moveEvent[eventProperty] + offset - dragBarContainer[sizeProperty]; - if (firstSize < sizeThresholdFirst) { - setHiddenElementWithCallback("first"); - store(HIDE_FIRST); - } else if (secondSize < sizeThresholdSecond) { - setHiddenElementWithCallback("second"); - store(HIDE_SECOND); - } else { - setHiddenElementWithCallback(null); - const newFlex = `${firstSize / secondSize}`; - firstContainer.style.flex = newFlex; - store(newFlex); - } - } - __name(handleMouseMove, "handleMouseMove"); - __name$1(handleMouseMove, "handleMouseMove"); - function handleMouseUp() { - document.removeEventListener("mousemove", handleMouseMove); - document.removeEventListener("mouseup", handleMouseUp); - } - __name(handleMouseUp, "handleMouseUp"); - __name$1(handleMouseUp, "handleMouseUp"); - document.addEventListener("mousemove", handleMouseMove); - document.addEventListener("mouseup", handleMouseUp); - } - __name(handleMouseDown, "handleMouseDown"); - __name$1(handleMouseDown, "handleMouseDown"); - dragBarContainer.addEventListener("mousedown", handleMouseDown); - function reset() { - if (firstRef.current) { - firstRef.current.style.flex = defaultFlexRef.current; - } - store(defaultFlexRef.current); - setHiddenElementWithCallback(null); - } - __name(reset, "reset"); - __name$1(reset, "reset"); - dragBarContainer.addEventListener("dblclick", reset); - return () => { - dragBarContainer.removeEventListener("mousedown", handleMouseDown); - dragBarContainer.removeEventListener("dblclick", reset); - }; - }, [direction, setHiddenElementWithCallback, sizeThresholdFirst, sizeThresholdSecond, store]); - return (0, React.useMemo)(() => ({ - dragBarRef, - hiddenElement, - firstRef, - setHiddenElement, - secondRef - }), [hiddenElement, setHiddenElement]); - } - __name(useDragResize, "useDragResize"); - __name$1(useDragResize, "useDragResize"); - const DEFAULT_FLEX = 1; - const HIDE_FIRST = "hide-first"; - const HIDE_SECOND = "hide-second"; - var button = /* @__PURE__ */(() => "button.graphiql-toolbar-button{display:flex;align-items:center;justify-content:center;height:var(--toolbar-width);width:var(--toolbar-width)}button.graphiql-toolbar-button.error{background:hsla(var(--color-error),var(--alpha-background-heavy))}\n")(); - const ToolbarButton = /*#__PURE__*/(0, React.forwardRef)((_oa, ref) => { - var _pa = _oa, - { - label - } = _pa, - props2 = __objRest(_pa, ["label"]); - const [error2, setError] = (0, React.useState)(null); - return /* @__PURE__ */jsx(Tooltip, { - label, - children: /* @__PURE__ */jsx(UnStyledButton, __spreadProps(__spreadValues({}, props2), { - ref, - type: "button", - className: clsx("graphiql-toolbar-button", error2 && "error", props2.className), - onClick: event => { - var _a; - try { - (_a = props2.onClick) == null ? void 0 : _a.call(props2, event); - setError(null); - } catch (err) { - setError(err instanceof Error ? err : new Error(`Toolbar button click failed: ${err}`)); - } - }, - "aria-label": error2 ? error2.message : label, - "aria-invalid": error2 ? "true" : props2["aria-invalid"] - })) - }); - }); - _exports.aR = ToolbarButton; - ToolbarButton.displayName = "ToolbarButton"; - var execute = /* @__PURE__ */(() => ".graphiql-execute-button-wrapper{position:relative}button.graphiql-execute-button{background-color:hsl(var(--color-primary));border:none;border-radius:var(--border-radius-8);cursor:pointer;height:var(--toolbar-width);padding:0;width:var(--toolbar-width)}button.graphiql-execute-button:hover{background-color:hsla(var(--color-primary),.9)}button.graphiql-execute-button:active{background-color:hsla(var(--color-primary),.8)}button.graphiql-execute-button:focus{outline:hsla(var(--color-primary),.8) auto 1px}button.graphiql-execute-button>svg{color:#fff;display:block;height:var(--px-16);margin:auto;width:var(--px-16)}\n")(); - var __defProp2 = Object.defineProperty; - var __name2 = /* @__PURE__ */__name((target2, value3) => __defProp2(target2, "name", { - value: value3, - configurable: true - }), "__name"); - function ExecuteButton() { - const { - queryEditor, - setOperationName - } = useEditorContext({ - nonNull: true, - caller: ExecuteButton - }); - const { - isFetching, - isSubscribed, - operationName, - run: run3, - stop - } = useExecutionContext({ - nonNull: true, - caller: ExecuteButton - }); - const operations = (queryEditor == null ? void 0 : queryEditor.operations) || []; - const hasOptions = operations.length > 1 && typeof operationName !== "string"; - const isRunning = isFetching || isSubscribed; - const label = `${isRunning ? "Stop" : "Execute"} query (Ctrl-Enter)`; - const buttonProps = { - type: "button", - className: "graphiql-execute-button", - children: isRunning ? /* @__PURE__ */jsx(StopIcon, {}) : /* @__PURE__ */jsx(PlayIcon, {}), - "aria-label": label - }; - return hasOptions && !isRunning ? /* @__PURE__ */jsxs(Menu, { - children: [/* @__PURE__ */jsx(Tooltip, { - label, - children: /* @__PURE__ */jsx(Menu.Button, __spreadValues({}, buttonProps)) - }), /* @__PURE__ */jsx(Menu.List, { - children: operations.map((operation, i) => { - const opName = operation.name ? operation.name.value : ``; - return /* @__PURE__ */jsx(Menu.Item, { - onSelect: () => { - var _a; - const selectedOperationName = (_a = operation.name) == null ? void 0 : _a.value; - if (queryEditor && selectedOperationName && selectedOperationName !== queryEditor.operationName) { - setOperationName(selectedOperationName); - } - run3(); - }, - children: opName - }, `${opName}-${i}`); - }) - })] - }) : /* @__PURE__ */jsx(Tooltip, { - label, - children: /* @__PURE__ */jsx("button", __spreadProps(__spreadValues({}, buttonProps), { - onClick: () => { - if (isRunning) { - stop(); - } else { - run3(); - } - } - })) - }); - } - __name(ExecuteButton, "ExecuteButton"); - __name2(ExecuteButton, "ExecuteButton"); - var listbox = /* @__PURE__ */(() => ".graphiql-toolbar-listbox{display:block;height:var(--toolbar-width);width:var(--toolbar-width)}\n")(); - const ToolbarListboxRoot = /*#__PURE__*/(0, React.forwardRef)((_qa, ref) => { - var _ra = _qa, - { - button: button2, - children, - label - } = _ra, - props2 = __objRest(_ra, ["button", "children", "label"]); - const labelWithValue = `${label}${props2.value ? `: ${props2.value}` : ""}`; - return /* @__PURE__ */jsxs(Listbox2.Input, __spreadProps(__spreadValues({}, props2), { - ref, - className: clsx("graphiql-toolbar-listbox", props2.className), - "aria-label": labelWithValue, - children: [/* @__PURE__ */jsx(Tooltip, { - label: labelWithValue, - children: /* @__PURE__ */jsx(Listbox2.Button, { - children: button2 - }) - }), /* @__PURE__ */jsx(Listbox2.Popover, { - children - })] - })); - }); - ToolbarListboxRoot.displayName = "ToolbarListbox"; - const ToolbarListbox = createComponentGroup(ToolbarListboxRoot, { - Option: Listbox2.Option - }); - _exports.aT = ToolbarListbox; - var menu = /* @__PURE__ */(() => "button.graphiql-toolbar-menu{display:block;height:var(--toolbar-width);width:var(--toolbar-width)}\n")(); - const ToolbarMenuRoot = /*#__PURE__*/(0, React.forwardRef)((_sa, ref) => { - var _ta = _sa, - { - button: button2, - children, - label - } = _ta, - props2 = __objRest(_ta, ["button", "children", "label"]); - return /* @__PURE__ */jsxs(Menu, __spreadProps(__spreadValues({}, props2), { - ref, - children: [/* @__PURE__ */jsx(Tooltip, { - label, - children: /* @__PURE__ */jsx(Menu.Button, { - className: clsx("graphiql-un-styled graphiql-toolbar-menu", props2.className), - "aria-label": label, - children: button2 - }) - }), /* @__PURE__ */jsx(Menu.List, { - children - })] - })); - }); - ToolbarMenuRoot.displayName = "ToolbarMenu"; - const ToolbarMenu = createComponentGroup(ToolbarMenuRoot, { - Item: Menu.Item - }); - _exports.aU = ToolbarMenu; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/info-addon.es.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/info-addon.es.js ***! - \**************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _indexEs, _react, _graphql, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - _codemirrorEs.C.defineOption("info", false, (cm, options, old) => { - if (old && old !== _codemirrorEs.C.Init) { - const oldOnMouseOver = cm.state.info.onMouseOver; - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseover", oldOnMouseOver); - clearTimeout(cm.state.info.hoverTimeout); - delete cm.state.info; - } - if (options) { - const state = cm.state.info = createState(options); - state.onMouseOver = onMouseOver.bind(null, cm); - _codemirrorEs.C.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - } - }); - function createState(options) { - return { - options: options instanceof Function ? { - render: options - } : options === true ? {} : options - }; - } - __name(createState, "createState"); - function getHoverTime(cm) { - const { - options - } = cm.state.info; - return (options === null || options === void 0 ? void 0 : options.hoverTime) || 500; - } - __name(getHoverTime, "getHoverTime"); - function onMouseOver(cm, e) { - const state = cm.state.info; - const target = e.target || e.srcElement; - if (!(target instanceof HTMLElement)) { - return; - } - if (target.nodeName !== "SPAN" || state.hoverTimeout !== void 0) { - return; - } - const box = target.getBoundingClientRect(); - const onMouseMove = /* @__PURE__ */__name(function () { - clearTimeout(state.hoverTimeout); - state.hoverTimeout = setTimeout(onHover, hoverTime); - }, "onMouseMove"); - const onMouseOut = /* @__PURE__ */__name(function () { - _codemirrorEs.C.off(document, "mousemove", onMouseMove); - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseout", onMouseOut); - clearTimeout(state.hoverTimeout); - state.hoverTimeout = void 0; - }, "onMouseOut"); - const onHover = /* @__PURE__ */__name(function () { - _codemirrorEs.C.off(document, "mousemove", onMouseMove); - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseout", onMouseOut); - state.hoverTimeout = void 0; - onMouseHover(cm, box); - }, "onHover"); - const hoverTime = getHoverTime(cm); - state.hoverTimeout = setTimeout(onHover, hoverTime); - _codemirrorEs.C.on(document, "mousemove", onMouseMove); - _codemirrorEs.C.on(cm.getWrapperElement(), "mouseout", onMouseOut); - } - __name(onMouseOver, "onMouseOver"); - function onMouseHover(cm, box) { - const pos = cm.coordsChar({ - left: (box.left + box.right) / 2, - top: (box.top + box.bottom) / 2 - }); - const state = cm.state.info; - const { - options - } = state; - const render = options.render || cm.getHelper(pos, "info"); - if (render) { - const token = cm.getTokenAt(pos, true); - if (token) { - const info = render(token, options, cm, pos); - if (info) { - showPopup(cm, box, info); - } - } - } - } - __name(onMouseHover, "onMouseHover"); - function showPopup(cm, box, info) { - const popup = document.createElement("div"); - popup.className = "CodeMirror-info"; - popup.appendChild(info); - document.body.appendChild(popup); - const popupBox = popup.getBoundingClientRect(); - const popupStyle = window.getComputedStyle(popup); - const popupWidth = popupBox.right - popupBox.left + parseFloat(popupStyle.marginLeft) + parseFloat(popupStyle.marginRight); - const popupHeight = popupBox.bottom - popupBox.top + parseFloat(popupStyle.marginTop) + parseFloat(popupStyle.marginBottom); - let topPos = box.bottom; - if (popupHeight > window.innerHeight - box.bottom - 15 && box.top > window.innerHeight - box.bottom) { - topPos = box.top - popupHeight; - } - if (topPos < 0) { - topPos = box.bottom; - } - let leftPos = Math.max(0, window.innerWidth - popupWidth - 15); - if (leftPos > box.left) { - leftPos = box.left; - } - popup.style.opacity = "1"; - popup.style.top = topPos + "px"; - popup.style.left = leftPos + "px"; - let popupTimeout; - const onMouseOverPopup = /* @__PURE__ */__name(function () { - clearTimeout(popupTimeout); - }, "onMouseOverPopup"); - const onMouseOut = /* @__PURE__ */__name(function () { - clearTimeout(popupTimeout); - popupTimeout = setTimeout(hidePopup, 200); - }, "onMouseOut"); - const hidePopup = /* @__PURE__ */__name(function () { - _codemirrorEs.C.off(popup, "mouseover", onMouseOverPopup); - _codemirrorEs.C.off(popup, "mouseout", onMouseOut); - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseout", onMouseOut); - if (popup.style.opacity) { - popup.style.opacity = "0"; - setTimeout(() => { - if (popup.parentNode) { - popup.parentNode.removeChild(popup); - } - }, 600); - } else if (popup.parentNode) { - popup.parentNode.removeChild(popup); - } - }, "hidePopup"); - _codemirrorEs.C.on(popup, "mouseover", onMouseOverPopup); - _codemirrorEs.C.on(popup, "mouseout", onMouseOut); - _codemirrorEs.C.on(cm.getWrapperElement(), "mouseout", onMouseOut); - } - __name(showPopup, "showPopup"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/info.es.js": -/*!********************************************!*\ - !*** ../../graphiql-react/dist/info.es.js ***! - \********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./SchemaReference.es.js */ "../../graphiql-react/dist/SchemaReference.es.js"), __webpack_require__(/*! ./info-addon.es.js */ "../../graphiql-react/dist/info-addon.es.js"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom"), __webpack_require__(/*! ./forEachState.es.js */ "../../graphiql-react/dist/forEachState.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_graphql, _codemirrorEs, _SchemaReferenceEs, _infoAddonEs, _indexEs, _react, _reactDom, _forEachStateEs) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - _codemirrorEs.C.registerHelper("info", "graphql", (token, options) => { - if (!options.schema || !token.state) { - return; - } - const { - kind, - step - } = token.state; - const typeInfo = (0, _SchemaReferenceEs.g)(options.schema, token.state); - if (kind === "Field" && step === 0 && typeInfo.fieldDef || kind === "AliasedField" && step === 2 && typeInfo.fieldDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderField(header, typeInfo, options); - const into = document.createElement("div"); - into.appendChild(header); - renderDescription(into, options, typeInfo.fieldDef); - return into; - } - if (kind === "Directive" && step === 1 && typeInfo.directiveDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderDirective(header, typeInfo, options); - const into = document.createElement("div"); - into.appendChild(header); - renderDescription(into, options, typeInfo.directiveDef); - return into; - } - if (kind === "Argument" && step === 0 && typeInfo.argDef) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderArg(header, typeInfo, options); - const into = document.createElement("div"); - into.appendChild(header); - renderDescription(into, options, typeInfo.argDef); - return into; - } - if (kind === "EnumValue" && typeInfo.enumValue && typeInfo.enumValue.description) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderEnumValue(header, typeInfo, options); - const into = document.createElement("div"); - into.appendChild(header); - renderDescription(into, options, typeInfo.enumValue); - return into; - } - if (kind === "NamedType" && typeInfo.type && typeInfo.type.description) { - const header = document.createElement("div"); - header.className = "CodeMirror-info-header"; - renderType(header, typeInfo, options, typeInfo.type); - const into = document.createElement("div"); - into.appendChild(header); - renderDescription(into, options, typeInfo.type); - return into; - } - }); - function renderField(into, typeInfo, options) { - renderQualifiedField(into, typeInfo, options); - renderTypeAnnotation(into, typeInfo, options, typeInfo.type); - } - __name(renderField, "renderField"); - function renderQualifiedField(into, typeInfo, options) { - var _a; - const fieldName = ((_a = typeInfo.fieldDef) === null || _a === void 0 ? void 0 : _a.name) || ""; - text(into, fieldName, "field-name", options, (0, _SchemaReferenceEs.a)(typeInfo)); - } - __name(renderQualifiedField, "renderQualifiedField"); - function renderDirective(into, typeInfo, options) { - var _a; - const name = "@" + (((_a = typeInfo.directiveDef) === null || _a === void 0 ? void 0 : _a.name) || ""); - text(into, name, "directive-name", options, (0, _SchemaReferenceEs.b)(typeInfo)); - } - __name(renderDirective, "renderDirective"); - function renderArg(into, typeInfo, options) { - var _a; - const name = ((_a = typeInfo.argDef) === null || _a === void 0 ? void 0 : _a.name) || ""; - text(into, name, "arg-name", options, (0, _SchemaReferenceEs.c)(typeInfo)); - renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType); - } - __name(renderArg, "renderArg"); - function renderEnumValue(into, typeInfo, options) { - var _a; - const name = ((_a = typeInfo.enumValue) === null || _a === void 0 ? void 0 : _a.name) || ""; - renderType(into, typeInfo, options, typeInfo.inputType); - text(into, "."); - text(into, name, "enum-value", options, (0, _SchemaReferenceEs.d)(typeInfo)); - } - __name(renderEnumValue, "renderEnumValue"); - function renderTypeAnnotation(into, typeInfo, options, t) { - const typeSpan = document.createElement("span"); - typeSpan.className = "type-name-pill"; - if (t instanceof _graphql.GraphQLNonNull) { - renderType(typeSpan, typeInfo, options, t.ofType); - text(typeSpan, "!"); - } else if (t instanceof _graphql.GraphQLList) { - text(typeSpan, "["); - renderType(typeSpan, typeInfo, options, t.ofType); - text(typeSpan, "]"); - } else { - text(typeSpan, (t === null || t === void 0 ? void 0 : t.name) || "", "type-name", options, (0, _SchemaReferenceEs.e)(typeInfo, t)); - } - into.appendChild(typeSpan); - } - __name(renderTypeAnnotation, "renderTypeAnnotation"); - function renderType(into, typeInfo, options, t) { - if (t instanceof _graphql.GraphQLNonNull) { - renderType(into, typeInfo, options, t.ofType); - text(into, "!"); - } else if (t instanceof _graphql.GraphQLList) { - text(into, "["); - renderType(into, typeInfo, options, t.ofType); - text(into, "]"); - } else { - text(into, (t === null || t === void 0 ? void 0 : t.name) || "", "type-name", options, (0, _SchemaReferenceEs.e)(typeInfo, t)); - } - } - __name(renderType, "renderType"); - function renderDescription(into, options, def) { - const { - description - } = def; - if (description) { - const descriptionDiv = document.createElement("div"); - descriptionDiv.className = "info-description"; - if (options.renderDescription) { - descriptionDiv.innerHTML = options.renderDescription(description); - } else { - descriptionDiv.appendChild(document.createTextNode(description)); - } - into.appendChild(descriptionDiv); - } - renderDeprecation(into, options, def); - } - __name(renderDescription, "renderDescription"); - function renderDeprecation(into, options, def) { - const reason = def.deprecationReason; - if (reason) { - const deprecationDiv = document.createElement("div"); - deprecationDiv.className = "info-deprecation"; - into.appendChild(deprecationDiv); - const label = document.createElement("span"); - label.className = "info-deprecation-label"; - label.appendChild(document.createTextNode("Deprecated")); - deprecationDiv.appendChild(label); - const reasonDiv = document.createElement("div"); - reasonDiv.className = "info-deprecation-reason"; - if (options.renderDescription) { - reasonDiv.innerHTML = options.renderDescription(reason); - } else { - reasonDiv.appendChild(document.createTextNode(reason)); - } - deprecationDiv.appendChild(reasonDiv); - } - } - __name(renderDeprecation, "renderDeprecation"); - function text(into, content) { - let className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; - let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { - onClick: null - }; - let ref = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; - if (className) { - const { - onClick - } = options; - let node; - if (onClick) { - node = document.createElement("a"); - node.href = "javascript:void 0"; - node.addEventListener("click", e => { - onClick(ref, e); - }); - } else { - node = document.createElement("span"); - } - node.className = className; - node.appendChild(document.createTextNode(content)); - into.appendChild(node); - } else { - into.appendChild(document.createTextNode(content)); - } - } - __name(text, "text"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/javascript.es.js": -/*!**************************************************!*\ - !*** ../../graphiql-react/dist/javascript.es.js ***! - \**************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.j = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var javascript$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - CodeMirror.defineMode("javascript", function (config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var trackScope = parserConfig.trackScope !== false; - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - var keywords = function () { - function kw(type2) { - return { - type: type2, - style: "keyword" - }; - } - __name(kw, "kw"); - var A = kw("keyword a"), - B = kw("keyword b"), - C = kw("keyword c"), - D = kw("keyword d"); - var operator = kw("operator"), - atom = { - type: "atom", - style: "atom" - }; - return { - "if": kw("if"), - "while": A, - "with": A, - "else": B, - "do": B, - "try": B, - "finally": B, - "return": D, - "break": D, - "continue": D, - "new": kw("new"), - "delete": C, - "void": C, - "throw": C, - "debugger": kw("debugger"), - "var": kw("var"), - "const": kw("var"), - "let": kw("var"), - "function": kw("function"), - "catch": kw("catch"), - "for": kw("for"), - "switch": kw("switch"), - "case": kw("case"), - "default": kw("default"), - "in": operator, - "typeof": operator, - "instanceof": operator, - "true": atom, - "false": atom, - "null": atom, - "undefined": atom, - "NaN": atom, - "Infinity": atom, - "this": kw("this"), - "class": kw("class"), - "super": kw("atom"), - "yield": C, - "export": kw("export"), - "import": kw("import"), - "extends": C, - "await": C - }; - }(); - var isOperatorChar = /[+\-*&%=<>!?|~^@]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - function readRegexp(stream) { - var escaped = false, - next, - inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true;else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - __name(readRegexp, "readRegexp"); - var type, content; - function ret(tp, style, cont2) { - type = tp; - content = cont2; - return style; - } - __name(ret, "ret"); - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (expressionAllowed(stream, state, 1)) { - readRegexp(stream); - stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eat("="); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#" && stream.peek() == "!") { - stream.skipToEnd(); - return ret("meta", "meta"); - } else if (ch == "#" && stream.eatWhile(wordRE)) { - return ret("variable", "property"); - } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start))) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (isOperatorChar.test(ch)) { - if (ch != ">" || !state.lexical || state.lexical.type != ">") { - if (stream.eat("=")) { - if (ch == "!" || ch == "=") stream.eat("="); - } else if (/[<>*+\-|&?]/.test(ch)) { - stream.eat(ch); - if (ch == ">") stream.eat(ch); - } - } - if (ch == "?" && stream.eat(".")) return ret("."); - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current(); - if (state.lastType != ".") { - if (keywords.propertyIsEnumerable(word)) { - var kw = keywords[word]; - return ret(kw.type, kw.style, word); - } - if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) return ret("async", "keyword", word); - } - return ret("variable", "variable", word); - } - } - __name(tokenBase, "tokenBase"); - function tokenString(quote) { - return function (stream, state) { - var escaped = false, - next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)) { - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - __name(tokenString, "tokenString"); - function tokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = ch == "*"; - } - return ret("comment", "comment"); - } - __name(tokenComment, "tokenComment"); - function tokenQuasi(stream, state) { - var escaped = false, - next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - __name(tokenQuasi, "tokenQuasi"); - var brackets = "([{}])"; - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - if (isTS) { - var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)); - if (m) arrow = m.index; - } - var depth = 0, - sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { - ++pos; - break; - } - if (--depth == 0) { - if (ch == "(") sawSomething = true; - break; - } - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/`]/.test(ch)) { - for (;; --pos) { - if (pos == 0) return; - var next = stream.string.charAt(pos - 1); - if (next == ch && stream.string.charAt(pos - 2) != "\\") { - pos--; - break; - } - } - } else if (sawSomething && !depth) { - ++pos; - break; - } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - __name(findFatArrow, "findFatArrow"); - var atomicTypes = { - "atom": true, - "number": true, - "variable": true, - "string": true, - "regexp": true, - "this": true, - "import": true, - "jsonld-keyword": true - }; - function JSLexical(indented, column, type2, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type2; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - __name(JSLexical, "JSLexical"); - function inScope(state, varname) { - if (!trackScope) return false; - for (var v = state.localVars; v; v = v.next) if (v.name == varname) return true; - for (var cx2 = state.context; cx2; cx2 = cx2.prev) { - for (var v = cx2.vars; v; v = v.next) if (v.name == varname) return true; - } - } - __name(inScope, "inScope"); - function parseJS(state, style, type2, content2, stream) { - var cc = state.cc; - cx.state = state; - cx.stream = stream; - cx.marked = null, cx.cc = cc; - cx.style = style; - if (!state.lexical.hasOwnProperty("align")) state.lexical.align = true; - while (true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type2, content2)) { - while (cc.length && cc[cc.length - 1].lex) cc.pop()(); - if (cx.marked) return cx.marked; - if (type2 == "variable" && inScope(state, content2)) return "variable-2"; - return style; - } - } - } - __name(parseJS, "parseJS"); - var cx = { - state: null, - column: null, - marked: null, - cc: null - }; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - __name(pass, "pass"); - function cont() { - pass.apply(null, arguments); - return true; - } - __name(cont, "cont"); - function inList(name, list) { - for (var v = list; v; v = v.next) if (v.name == name) return true; - return false; - } - __name(inList, "inList"); - function register(varname) { - var state = cx.state; - cx.marked = "def"; - if (!trackScope) return; - if (state.context) { - if (state.lexical.info == "var" && state.context && state.context.block) { - var newContext = registerVarScoped(varname, state.context); - if (newContext != null) { - state.context = newContext; - return; - } - } else if (!inList(varname, state.localVars)) { - state.localVars = new Var(varname, state.localVars); - return; - } - } - if (parserConfig.globalVars && !inList(varname, state.globalVars)) state.globalVars = new Var(varname, state.globalVars); - } - __name(register, "register"); - function registerVarScoped(varname, context) { - if (!context) { - return null; - } else if (context.block) { - var inner = registerVarScoped(varname, context.prev); - if (!inner) return null; - if (inner == context.prev) return context; - return new Context(inner, context.vars, true); - } else if (inList(varname, context.vars)) { - return context; - } else { - return new Context(context.prev, new Var(varname, context.vars), false); - } - } - __name(registerVarScoped, "registerVarScoped"); - function isModifier(name) { - return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"; - } - __name(isModifier, "isModifier"); - function Context(prev, vars, block2) { - this.prev = prev; - this.vars = vars; - this.block = block2; - } - __name(Context, "Context"); - function Var(name, next) { - this.name = name; - this.next = next; - } - __name(Var, "Var"); - var defaultVars = new Var("this", new Var("arguments", null)); - function pushcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, false); - cx.state.localVars = defaultVars; - } - __name(pushcontext, "pushcontext"); - function pushblockcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, true); - cx.state.localVars = null; - } - __name(pushblockcontext, "pushblockcontext"); - pushcontext.lex = pushblockcontext.lex = true; - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - __name(popcontext, "popcontext"); - popcontext.lex = true; - function pushlex(type2, info) { - var result = /* @__PURE__ */__name(function () { - var state = cx.state, - indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented;else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type2, null, state.lexical, info); - }, "result"); - result.lex = true; - return result; - } - __name(pushlex, "pushlex"); - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - __name(poplex, "poplex"); - poplex.lex = true; - function expect(wanted) { - function exp(type2) { - if (type2 == wanted) return cont();else if (wanted == ";" || type2 == "}" || type2 == ")" || type2 == "]") return pass();else return cont(exp); - } - __name(exp, "exp"); - return exp; - } - __name(expect, "expect"); - function statement(type2, value) { - if (type2 == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); - if (type2 == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); - if (type2 == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type2 == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); - if (type2 == "debugger") return cont(expect(";")); - if (type2 == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); - if (type2 == ";") return cont(); - if (type2 == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) cx.state.cc.pop()(); - return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); - } - if (type2 == "function") return cont(functiondef); - if (type2 == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex); - if (type2 == "class" || isTS && value == "interface") { - cx.marked = "keyword"; - return cont(pushlex("form", type2 == "class" ? type2 : value), className, poplex); - } - if (type2 == "variable") { - if (isTS && value == "declare") { - cx.marked = "keyword"; - return cont(statement); - } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { - cx.marked = "keyword"; - if (value == "enum") return cont(enumdef);else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex); - } else if (isTS && value == "namespace") { - cx.marked = "keyword"; - return cont(pushlex("form"), expression, statement, poplex); - } else if (isTS && value == "abstract") { - cx.marked = "keyword"; - return cont(statement); - } else { - return cont(pushlex("stat"), maybelabel); - } - } - if (type2 == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, block, poplex, poplex, popcontext); - if (type2 == "case") return cont(expression, expect(":")); - if (type2 == "default") return cont(expect(":")); - if (type2 == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); - if (type2 == "export") return cont(pushlex("stat"), afterExport, poplex); - if (type2 == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type2 == "async") return cont(statement); - if (value == "@") return cont(expression, statement); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - __name(statement, "statement"); - function maybeCatchBinding(type2) { - if (type2 == "(") return cont(funarg, expect(")")); - } - __name(maybeCatchBinding, "maybeCatchBinding"); - function expression(type2, value) { - return expressionInner(type2, value, false); - } - __name(expression, "expression"); - function expressionNoComma(type2, value) { - return expressionInner(type2, value, true); - } - __name(expressionNoComma, "expressionNoComma"); - function parenExpr(type2) { - if (type2 != "(") return pass(); - return cont(pushlex(")"), maybeexpression, expect(")"), poplex); - } - __name(parenExpr, "parenExpr"); - function expressionInner(type2, value, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);else if (type2 == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type2)) return cont(maybeop); - if (type2 == "function") return cont(functiondef, maybeop); - if (type2 == "class" || isTS && value == "interface") { - cx.marked = "keyword"; - return cont(pushlex("form"), classExpression, poplex); - } - if (type2 == "keyword c" || type2 == "async") return cont(noComma ? expressionNoComma : expression); - if (type2 == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); - if (type2 == "operator" || type2 == "spread") return cont(noComma ? expressionNoComma : expression); - if (type2 == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type2 == "{") return contCommasep(objprop, "}", null, maybeop); - if (type2 == "quasi") return pass(quasi, maybeop); - if (type2 == "new") return cont(maybeTarget(noComma)); - return cont(); - } - __name(expressionInner, "expressionInner"); - function maybeexpression(type2) { - if (type2.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - __name(maybeexpression, "maybeexpression"); - function maybeoperatorComma(type2, value) { - if (type2 == ",") return cont(maybeexpression); - return maybeoperatorNoComma(type2, value, false); - } - __name(maybeoperatorComma, "maybeoperatorComma"); - function maybeoperatorNoComma(type2, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type2 == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type2 == "operator") { - if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); - if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false)) return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type2 == "quasi") { - return pass(quasi, me); - } - if (type2 == ";") return; - if (type2 == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type2 == ".") return cont(property, me); - if (type2 == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - if (isTS && value == "as") { - cx.marked = "keyword"; - return cont(typeexpr, me); - } - if (type2 == "regexp") { - cx.state.lastType = cx.marked = "operator"; - cx.stream.backUp(cx.stream.pos - cx.stream.start - 1); - return cont(expr); - } - } - __name(maybeoperatorNoComma, "maybeoperatorNoComma"); - function quasi(type2, value) { - if (type2 != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(maybeexpression, continueQuasi); - } - __name(quasi, "quasi"); - function continueQuasi(type2) { - if (type2 == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - __name(continueQuasi, "continueQuasi"); - function arrowBody(type2) { - findFatArrow(cx.stream, cx.state); - return pass(type2 == "{" ? statement : expression); - } - __name(arrowBody, "arrowBody"); - function arrowBodyNoComma(type2) { - findFatArrow(cx.stream, cx.state); - return pass(type2 == "{" ? statement : expressionNoComma); - } - __name(arrowBodyNoComma, "arrowBodyNoComma"); - function maybeTarget(noComma) { - return function (type2) { - if (type2 == ".") return cont(noComma ? targetNoComma : target);else if (type2 == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma);else return pass(noComma ? expressionNoComma : expression); - }; - } - __name(maybeTarget, "maybeTarget"); - function target(_, value) { - if (value == "target") { - cx.marked = "keyword"; - return cont(maybeoperatorComma); - } - } - __name(target, "target"); - function targetNoComma(_, value) { - if (value == "target") { - cx.marked = "keyword"; - return cont(maybeoperatorNoComma); - } - } - __name(targetNoComma, "targetNoComma"); - function maybelabel(type2) { - if (type2 == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - __name(maybelabel, "maybelabel"); - function property(type2) { - if (type2 == "variable") { - cx.marked = "property"; - return cont(); - } - } - __name(property, "property"); - function objprop(type2, value) { - if (type2 == "async") { - cx.marked = "property"; - return cont(objprop); - } else if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - var m; - if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) cx.state.fatArrowAt = cx.stream.pos + m[0].length; - return cont(afterprop); - } else if (type2 == "number" || type2 == "string") { - cx.marked = jsonldMode ? "property" : cx.style + " property"; - return cont(afterprop); - } else if (type2 == "jsonld-keyword") { - return cont(afterprop); - } else if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(objprop); - } else if (type2 == "[") { - return cont(expression, maybetype, expect("]"), afterprop); - } else if (type2 == "spread") { - return cont(expressionNoComma, afterprop); - } else if (value == "*") { - cx.marked = "keyword"; - return cont(objprop); - } else if (type2 == ":") { - return pass(afterprop); - } - } - __name(objprop, "objprop"); - function getterSetter(type2) { - if (type2 != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - __name(getterSetter, "getterSetter"); - function afterprop(type2) { - if (type2 == ":") return cont(expressionNoComma); - if (type2 == "(") return pass(functiondef); - } - __name(afterprop, "afterprop"); - function commasep(what, end, sep) { - function proceed(type2, value) { - if (sep ? sep.indexOf(type2) > -1 : type2 == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(function (type3, value2) { - if (type3 == end || value2 == end) return pass(); - return pass(what); - }, proceed); - } - if (type2 == end || value == end) return cont(); - if (sep && sep.indexOf(";") > -1) return pass(what); - return cont(expect(end)); - } - __name(proceed, "proceed"); - return function (type2, value) { - if (type2 == end || value == end) return cont(); - return pass(what, proceed); - }; - } - __name(commasep, "commasep"); - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - __name(contCommasep, "contCommasep"); - function block(type2) { - if (type2 == "}") return cont(); - return pass(statement, block); - } - __name(block, "block"); - function maybetype(type2, value) { - if (isTS) { - if (type2 == ":") return cont(typeexpr); - if (value == "?") return cont(maybetype); - } - } - __name(maybetype, "maybetype"); - function maybetypeOrIn(type2, value) { - if (isTS && (type2 == ":" || value == "in")) return cont(typeexpr); - } - __name(maybetypeOrIn, "maybetypeOrIn"); - function mayberettype(type2) { - if (isTS && type2 == ":") { - if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr);else return cont(typeexpr); - } - } - __name(mayberettype, "mayberettype"); - function isKW(_, value) { - if (value == "is") { - cx.marked = "keyword"; - return cont(); - } - } - __name(isKW, "isKW"); - function typeexpr(type2, value) { - if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") { - cx.marked = "keyword"; - return cont(value == "typeof" ? expressionNoComma : typeexpr); - } - if (type2 == "variable" || value == "void") { - cx.marked = "type"; - return cont(afterType); - } - if (value == "|" || value == "&") return cont(typeexpr); - if (type2 == "string" || type2 == "number" || type2 == "atom") return cont(afterType); - if (type2 == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType); - if (type2 == "{") return cont(pushlex("}"), typeprops, poplex, afterType); - if (type2 == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType); - if (type2 == "<") return cont(commasep(typeexpr, ">"), typeexpr); - if (type2 == "quasi") { - return pass(quasiType, afterType); - } - } - __name(typeexpr, "typeexpr"); - function maybeReturnType(type2) { - if (type2 == "=>") return cont(typeexpr); - } - __name(maybeReturnType, "maybeReturnType"); - function typeprops(type2) { - if (type2.match(/[\}\)\]]/)) return cont(); - if (type2 == "," || type2 == ";") return cont(typeprops); - return pass(typeprop, typeprops); - } - __name(typeprops, "typeprops"); - function typeprop(type2, value) { - if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(typeprop); - } else if (value == "?" || type2 == "number" || type2 == "string") { - return cont(typeprop); - } else if (type2 == ":") { - return cont(typeexpr); - } else if (type2 == "[") { - return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop); - } else if (type2 == "(") { - return pass(functiondecl, typeprop); - } else if (!type2.match(/[;\}\)\],]/)) { - return cont(); - } - } - __name(typeprop, "typeprop"); - function quasiType(type2, value) { - if (type2 != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasiType); - return cont(typeexpr, continueQuasiType); - } - __name(quasiType, "quasiType"); - function continueQuasiType(type2) { - if (type2 == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasiType); - } - } - __name(continueQuasiType, "continueQuasiType"); - function typearg(type2, value) { - if (type2 == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg); - if (type2 == ":") return cont(typeexpr); - if (type2 == "spread") return cont(typearg); - return pass(typeexpr); - } - __name(typearg, "typearg"); - function afterType(type2, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType); - if (value == "|" || type2 == "." || value == "&") return cont(typeexpr); - if (type2 == "[") return cont(typeexpr, expect("]"), afterType); - if (value == "extends" || value == "implements") { - cx.marked = "keyword"; - return cont(typeexpr); - } - if (value == "?") return cont(typeexpr, expect(":"), typeexpr); - } - __name(afterType, "afterType"); - function maybeTypeArgs(_, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType); - } - __name(maybeTypeArgs, "maybeTypeArgs"); - function typeparam() { - return pass(typeexpr, maybeTypeDefault); - } - __name(typeparam, "typeparam"); - function maybeTypeDefault(_, value) { - if (value == "=") return cont(typeexpr); - } - __name(maybeTypeDefault, "maybeTypeDefault"); - function vardef(_, value) { - if (value == "enum") { - cx.marked = "keyword"; - return cont(enumdef); - } - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - __name(vardef, "vardef"); - function pattern(type2, value) { - if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(pattern); - } - if (type2 == "variable") { - register(value); - return cont(); - } - if (type2 == "spread") return cont(pattern); - if (type2 == "[") return contCommasep(eltpattern, "]"); - if (type2 == "{") return contCommasep(proppattern, "}"); - } - __name(pattern, "pattern"); - function proppattern(type2, value) { - if (type2 == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type2 == "variable") cx.marked = "property"; - if (type2 == "spread") return cont(pattern); - if (type2 == "}") return pass(); - if (type2 == "[") return cont(expression, expect("]"), expect(":"), proppattern); - return cont(expect(":"), pattern, maybeAssign); - } - __name(proppattern, "proppattern"); - function eltpattern() { - return pass(pattern, maybeAssign); - } - __name(eltpattern, "eltpattern"); - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - __name(maybeAssign, "maybeAssign"); - function vardefCont(type2) { - if (type2 == ",") return cont(vardef); - } - __name(vardefCont, "vardefCont"); - function maybeelse(type2, value) { - if (type2 == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - __name(maybeelse, "maybeelse"); - function forspec(type2, value) { - if (value == "await") return cont(forspec); - if (type2 == "(") return cont(pushlex(")"), forspec1, poplex); - } - __name(forspec, "forspec"); - function forspec1(type2) { - if (type2 == "var") return cont(vardef, forspec2); - if (type2 == "variable") return cont(forspec2); - return pass(forspec2); - } - __name(forspec1, "forspec1"); - function forspec2(type2, value) { - if (type2 == ")") return cont(); - if (type2 == ";") return cont(forspec2); - if (value == "in" || value == "of") { - cx.marked = "keyword"; - return cont(expression, forspec2); - } - return pass(expression, forspec2); - } - __name(forspec2, "forspec2"); - function functiondef(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(functiondef); - } - if (type2 == "variable") { - register(value); - return cont(functiondef); - } - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef); - } - __name(functiondef, "functiondef"); - function functiondecl(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(functiondecl); - } - if (type2 == "variable") { - register(value); - return cont(functiondecl); - } - if (type2 == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl); - } - __name(functiondecl, "functiondecl"); - function typename(type2, value) { - if (type2 == "keyword" || type2 == "variable") { - cx.marked = "type"; - return cont(typename); - } else if (value == "<") { - return cont(pushlex(">"), commasep(typeparam, ">"), poplex); - } - } - __name(typename, "typename"); - function funarg(type2, value) { - if (value == "@") cont(expression, funarg); - if (type2 == "spread") return cont(funarg); - if (isTS && isModifier(value)) { - cx.marked = "keyword"; - return cont(funarg); - } - if (isTS && type2 == "this") return cont(maybetype, maybeAssign); - return pass(pattern, maybetype, maybeAssign); - } - __name(funarg, "funarg"); - function classExpression(type2, value) { - if (type2 == "variable") return className(type2, value); - return classNameAfter(type2, value); - } - __name(classExpression, "classExpression"); - function className(type2, value) { - if (type2 == "variable") { - register(value); - return cont(classNameAfter); - } - } - __name(className, "className"); - function classNameAfter(type2, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter); - if (value == "extends" || value == "implements" || isTS && type2 == ",") { - if (value == "implements") cx.marked = "keyword"; - return cont(isTS ? typeexpr : expression, classNameAfter); - } - if (type2 == "{") return cont(pushlex("}"), classBody, poplex); - } - __name(classNameAfter, "classNameAfter"); - function classBody(type2, value) { - if (type2 == "async" || type2 == "variable" && (value == "static" || value == "get" || value == "set" || isTS && isModifier(value)) && cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) { - cx.marked = "keyword"; - return cont(classBody); - } - if (type2 == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(classfield, classBody); - } - if (type2 == "number" || type2 == "string") return cont(classfield, classBody); - if (type2 == "[") return cont(expression, maybetype, expect("]"), classfield, classBody); - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (isTS && type2 == "(") return pass(functiondecl, classBody); - if (type2 == ";" || type2 == ",") return cont(classBody); - if (type2 == "}") return cont(); - if (value == "@") return cont(expression, classBody); - } - __name(classBody, "classBody"); - function classfield(type2, value) { - if (value == "!") return cont(classfield); - if (value == "?") return cont(classfield); - if (type2 == ":") return cont(typeexpr, maybeAssign); - if (value == "=") return cont(expressionNoComma); - var context = cx.state.lexical.prev, - isInterface = context && context.info == "interface"; - return pass(isInterface ? functiondecl : functiondef); - } - __name(classfield, "classfield"); - function afterExport(type2, value) { - if (value == "*") { - cx.marked = "keyword"; - return cont(maybeFrom, expect(";")); - } - if (value == "default") { - cx.marked = "keyword"; - return cont(expression, expect(";")); - } - if (type2 == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); - return pass(statement); - } - __name(afterExport, "afterExport"); - function exportField(type2, value) { - if (value == "as") { - cx.marked = "keyword"; - return cont(expect("variable")); - } - if (type2 == "variable") return pass(expressionNoComma, exportField); - } - __name(exportField, "exportField"); - function afterImport(type2) { - if (type2 == "string") return cont(); - if (type2 == "(") return pass(expression); - if (type2 == ".") return pass(maybeoperatorComma); - return pass(importSpec, maybeMoreImports, maybeFrom); - } - __name(afterImport, "afterImport"); - function importSpec(type2, value) { - if (type2 == "{") return contCommasep(importSpec, "}"); - if (type2 == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); - } - __name(importSpec, "importSpec"); - function maybeMoreImports(type2) { - if (type2 == ",") return cont(importSpec, maybeMoreImports); - } - __name(maybeMoreImports, "maybeMoreImports"); - function maybeAs(_type, value) { - if (value == "as") { - cx.marked = "keyword"; - return cont(importSpec); - } - } - __name(maybeAs, "maybeAs"); - function maybeFrom(_type, value) { - if (value == "from") { - cx.marked = "keyword"; - return cont(expression); - } - } - __name(maybeFrom, "maybeFrom"); - function arrayLiteral(type2) { - if (type2 == "]") return cont(); - return pass(commasep(expressionNoComma, "]")); - } - __name(arrayLiteral, "arrayLiteral"); - function enumdef() { - return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex); - } - __name(enumdef, "enumdef"); - function enummember() { - return pass(pattern, maybeAssign); - } - __name(enummember, "enummember"); - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || isOperatorChar.test(textAfter.charAt(0)) || /[,.]/.test(textAfter.charAt(0)); - } - __name(isContinuedStatement, "isContinuedStatement"); - function expressionAllowed(stream, state, backUp) { - return state.tokenize == tokenBase && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))); - } - __name(expressionAllowed, "expressionAllowed"); - return { - startState: function (basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && new Context(null, null, false), - indented: basecolumn || 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; - return state; - }, - token: function (stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - indent: function (state, textAfter) { - if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), - lexical = state.lexical, - top; - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev;else if (c != maybeelse && c != popcontext) break; - } - while ((lexical.type == "stat" || lexical.type == "form") && (firstChar == "}" || (top = state.cc[state.cc.length - 1]) && (top == maybeoperatorComma || top == maybeoperatorNoComma) && !/^[,\.=+\-*:?[\(]/.test(textAfter))) lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") lexical = lexical.prev; - var type2 = lexical.type, - closing = firstChar == type2; - if (type2 == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);else if (type2 == "form" && firstChar == "{") return lexical.indented;else if (type2 == "form") return lexical.indented + indentUnit;else if (type2 == "stat") return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);else if (lexical.align) return lexical.column + (closing ? 0 : 1);else return lexical.indented + (closing ? 0 : indentUnit); - }, - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - blockCommentContinue: jsonMode ? null : " * ", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - helperType: jsonMode ? "json" : "javascript", - jsonldMode, - jsonMode, - expressionAllowed, - skipExpression: function (state) { - parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null)); - } - }; - }); - CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - CodeMirror.defineMIME("text/javascript", "javascript"); - CodeMirror.defineMIME("text/ecmascript", "javascript"); - CodeMirror.defineMIME("application/javascript", "javascript"); - CodeMirror.defineMIME("application/x-javascript", "javascript"); - CodeMirror.defineMIME("application/ecmascript", "javascript"); - CodeMirror.defineMIME("application/json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/x-json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/manifest+json", { - name: "javascript", - json: true - }); - CodeMirror.defineMIME("application/ld+json", { - name: "javascript", - jsonld: true - }); - CodeMirror.defineMIME("text/typescript", { - name: "javascript", - typescript: true - }); - CodeMirror.defineMIME("application/typescript", { - name: "javascript", - typescript: true - }); - }); - })(); - var javascript = javascript$2.exports; - var javascript$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": javascript - }, [javascript$2.exports]); - _exports.j = javascript$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/jump-to-line.es.js": -/*!****************************************************!*\ - !*** ../../graphiql-react/dist/jump-to-line.es.js ***! - \****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./dialog.es.js */ "../../graphiql-react/dist/dialog.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs, _dialogEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.j = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var jumpToLine$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports, _dialogEs.a.exports); - })(function (CodeMirror) { - CodeMirror.defineOption("search", { - bottom: false - }); - function dialog2(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, { - value: deflt, - selectValueOnOpen: true, - bottom: cm.options.search.bottom - });else f(prompt(shortText, deflt)); - } - __name(dialog2, "dialog"); - function getJumpDialog(cm) { - return cm.phrase("Jump to line:") + ' ' + cm.phrase("(Use line:column or scroll% syntax)") + ""; - } - __name(getJumpDialog, "getJumpDialog"); - function interpretLine(cm, string) { - var num = Number(string); - if (/^[-+]/.test(string)) return cm.getCursor().line + num;else return num - 1; - } - __name(interpretLine, "interpretLine"); - CodeMirror.commands.jumpToLine = function (cm) { - var cur = cm.getCursor(); - dialog2(cm, getJumpDialog(cm), cm.phrase("Jump to line:"), cur.line + 1 + ":" + cur.ch, function (posStr) { - if (!posStr) return; - var match; - if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) { - cm.setCursor(interpretLine(cm, match[1]), Number(match[2])); - } else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) { - var line = Math.round(cm.lineCount() * Number(match[1]) / 100); - if (/^[-+]/.test(match[1])) line = cur.line + line + 1; - cm.setCursor(line - 1, cur.ch); - } else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) { - cm.setCursor(interpretLine(cm, match[1]), cur.ch); - } - }); - }; - CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine"; - }); - })(); - var jumpToLine = jumpToLine$2.exports; - var jumpToLine$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": jumpToLine - }, [jumpToLine$2.exports]); - _exports.j = jumpToLine$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/jump.es.js": -/*!********************************************!*\ - !*** ../../graphiql-react/dist/jump.es.js ***! - \********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./SchemaReference.es.js */ "../../graphiql-react/dist/SchemaReference.es.js"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! react-dom */ "react-dom"), __webpack_require__(/*! ./forEachState.es.js */ "../../graphiql-react/dist/forEachState.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _SchemaReferenceEs, _indexEs, _react, _graphql, _reactDom, _forEachStateEs) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - _codemirrorEs.C.defineOption("jump", false, (cm, options, old) => { - if (old && old !== _codemirrorEs.C.Init) { - const oldOnMouseOver = cm.state.jump.onMouseOver; - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseover", oldOnMouseOver); - const oldOnMouseOut = cm.state.jump.onMouseOut; - _codemirrorEs.C.off(cm.getWrapperElement(), "mouseout", oldOnMouseOut); - _codemirrorEs.C.off(document, "keydown", cm.state.jump.onKeyDown); - delete cm.state.jump; - } - if (options) { - const state = cm.state.jump = { - options, - onMouseOver: onMouseOver.bind(null, cm), - onMouseOut: onMouseOut.bind(null, cm), - onKeyDown: onKeyDown.bind(null, cm) - }; - _codemirrorEs.C.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - _codemirrorEs.C.on(cm.getWrapperElement(), "mouseout", state.onMouseOut); - _codemirrorEs.C.on(document, "keydown", state.onKeyDown); - } - }); - function onMouseOver(cm, event) { - const target = event.target || event.srcElement; - if (!(target instanceof HTMLElement)) { - return; - } - if ((target === null || target === void 0 ? void 0 : target.nodeName) !== "SPAN") { - return; - } - const box = target.getBoundingClientRect(); - const cursor = { - left: (box.left + box.right) / 2, - top: (box.top + box.bottom) / 2 - }; - cm.state.jump.cursor = cursor; - if (cm.state.jump.isHoldingModifier) { - enableJumpMode(cm); - } - } - __name(onMouseOver, "onMouseOver"); - function onMouseOut(cm) { - if (!cm.state.jump.isHoldingModifier && cm.state.jump.cursor) { - cm.state.jump.cursor = null; - return; - } - if (cm.state.jump.isHoldingModifier && cm.state.jump.marker) { - disableJumpMode(cm); - } - } - __name(onMouseOut, "onMouseOut"); - function onKeyDown(cm, event) { - if (cm.state.jump.isHoldingModifier || !isJumpModifier(event.key)) { - return; - } - cm.state.jump.isHoldingModifier = true; - if (cm.state.jump.cursor) { - enableJumpMode(cm); - } - const onKeyUp = /* @__PURE__ */__name(upEvent => { - if (upEvent.code !== event.code) { - return; - } - cm.state.jump.isHoldingModifier = false; - if (cm.state.jump.marker) { - disableJumpMode(cm); - } - _codemirrorEs.C.off(document, "keyup", onKeyUp); - _codemirrorEs.C.off(document, "click", onClick); - cm.off("mousedown", onMouseDown); - }, "onKeyUp"); - const onClick = /* @__PURE__ */__name(clickEvent => { - const { - destination, - options - } = cm.state.jump; - if (destination) { - options.onClick(destination, clickEvent); - } - }, "onClick"); - const onMouseDown = /* @__PURE__ */__name((_, downEvent) => { - if (cm.state.jump.destination) { - downEvent.codemirrorIgnore = true; - } - }, "onMouseDown"); - _codemirrorEs.C.on(document, "keyup", onKeyUp); - _codemirrorEs.C.on(document, "click", onClick); - cm.on("mousedown", onMouseDown); - } - __name(onKeyDown, "onKeyDown"); - const isMac = typeof navigator !== "undefined" && navigator && navigator.appVersion.includes("Mac"); - function isJumpModifier(key) { - return key === (isMac ? "Meta" : "Control"); - } - __name(isJumpModifier, "isJumpModifier"); - function enableJumpMode(cm) { - if (cm.state.jump.marker) { - return; - } - const { - cursor, - options - } = cm.state.jump; - const pos = cm.coordsChar(cursor); - const token = cm.getTokenAt(pos, true); - const getDestination = options.getDestination || cm.getHelper(pos, "jump"); - if (getDestination) { - const destination = getDestination(token, options, cm); - if (destination) { - const marker = cm.markText({ - line: pos.line, - ch: token.start - }, { - line: pos.line, - ch: token.end - }, { - className: "CodeMirror-jump-token" - }); - cm.state.jump.marker = marker; - cm.state.jump.destination = destination; - } - } - } - __name(enableJumpMode, "enableJumpMode"); - function disableJumpMode(cm) { - const { - marker - } = cm.state.jump; - cm.state.jump.marker = null; - cm.state.jump.destination = null; - marker.clear(); - } - __name(disableJumpMode, "disableJumpMode"); - _codemirrorEs.C.registerHelper("jump", "graphql", (token, options) => { - if (!options.schema || !options.onClick || !token.state) { - return; - } - const { - state - } = token; - const { - kind, - step - } = state; - const typeInfo = (0, _SchemaReferenceEs.g)(options.schema, state); - if (kind === "Field" && step === 0 && typeInfo.fieldDef || kind === "AliasedField" && step === 2 && typeInfo.fieldDef) { - return (0, _SchemaReferenceEs.a)(typeInfo); - } - if (kind === "Directive" && step === 1 && typeInfo.directiveDef) { - return (0, _SchemaReferenceEs.b)(typeInfo); - } - if (kind === "Argument" && step === 0 && typeInfo.argDef) { - return (0, _SchemaReferenceEs.c)(typeInfo); - } - if (kind === "EnumValue" && typeInfo.enumValue) { - return (0, _SchemaReferenceEs.d)(typeInfo); - } - if (kind === "NamedType" && typeInfo.type) { - return (0, _SchemaReferenceEs.e)(typeInfo); - } - }); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.es.js": -/*!********************************************!*\ - !*** ../../graphiql-react/dist/lint.es.js ***! - \********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! ./Range.es.js */ "../../graphiql-react/dist/Range.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _indexEs, _RangeEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - const specifiedSDLRules = [_graphql.LoneSchemaDefinitionRule, _graphql.UniqueOperationTypesRule, _graphql.UniqueTypeNamesRule, _graphql.UniqueEnumValueNamesRule, _graphql.UniqueFieldDefinitionNamesRule, _graphql.UniqueDirectiveNamesRule, _graphql.KnownTypeNamesRule, _graphql.KnownDirectivesRule, _graphql.UniqueDirectivesPerLocationRule, _graphql.PossibleTypeExtensionsRule, _graphql.UniqueArgumentNamesRule, _graphql.UniqueInputFieldNamesRule]; - function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, isSchemaDocument) { - const rules = _graphql.specifiedRules.filter(rule => { - if (rule === _graphql.NoUnusedFragmentsRule || rule === _graphql.ExecutableDefinitionsRule) { - return false; - } - if (isRelayCompatMode && rule === _graphql.KnownFragmentNamesRule) { - return false; - } - return true; - }); - if (customRules) { - Array.prototype.push.apply(rules, customRules); - } - if (isSchemaDocument) { - Array.prototype.push.apply(rules, specifiedSDLRules); - } - const errors = (0, _graphql.validate)(schema, ast, rules); - return errors.filter(error => { - if (error.message.includes("Unknown directive") && error.nodes) { - const node = error.nodes[0]; - if (node && node.kind === _graphql.Kind.DIRECTIVE) { - const name = node.name.value; - if (name === "arguments" || name === "argumentDefinitions") { - return false; - } - } - } - return true; - }); - } - __name(validateWithCustomRules, "validateWithCustomRules"); - const SEVERITY$1 = { - Error: "Error", - Warning: "Warning", - Information: "Information", - Hint: "Hint" - }; - const DIAGNOSTIC_SEVERITY = { - [SEVERITY$1.Error]: 1, - [SEVERITY$1.Warning]: 2, - [SEVERITY$1.Information]: 3, - [SEVERITY$1.Hint]: 4 - }; - const invariant = /* @__PURE__ */__name((condition, message) => { - if (!condition) { - throw new Error(message); - } - }, "invariant"); - function getDiagnostics(query) { - let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - let customRules = arguments.length > 2 ? arguments[2] : undefined; - let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; - let externalFragments = arguments.length > 4 ? arguments[4] : undefined; - var _a, _b; - let ast = null; - let fragments = ""; - if (externalFragments) { - fragments = typeof externalFragments === "string" ? externalFragments : externalFragments.reduce((acc, node) => acc + (0, _graphql.print)(node) + "\n\n", ""); - } - const enhancedQuery = fragments ? `${query} - -${fragments}` : query; - try { - ast = (0, _graphql.parse)(enhancedQuery); - } catch (error) { - if (error instanceof _graphql.GraphQLError) { - const range = getRange((_b = (_a = error.locations) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : { - line: 0, - column: 0 - }, enhancedQuery); - return [{ - severity: DIAGNOSTIC_SEVERITY.Error, - message: error.message, - source: "GraphQL: Syntax", - range - }]; - } - throw error; - } - return validateQuery(ast, schema, customRules, isRelayCompatMode); - } - __name(getDiagnostics, "getDiagnostics"); - function validateQuery(ast) { - let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - let customRules = arguments.length > 2 ? arguments[2] : undefined; - let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; - if (!schema) { - return []; - } - const validationErrorAnnotations = validateWithCustomRules(schema, ast, customRules, isRelayCompatMode).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Error, "Validation")); - const deprecationWarningAnnotations = (0, _graphql.validate)(schema, ast, [_graphql.NoDeprecatedCustomRule]).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Warning, "Deprecation")); - return validationErrorAnnotations.concat(deprecationWarningAnnotations); - } - __name(validateQuery, "validateQuery"); - function annotations(error, severity, type) { - if (!error.nodes) { - return []; - } - const highlightedNodes = []; - error.nodes.forEach((node, i) => { - const highlightNode = node.kind !== "Variable" && "name" in node && node.name !== void 0 ? node.name : "variable" in node && node.variable !== void 0 ? node.variable : node; - if (highlightNode) { - invariant(error.locations, "GraphQL validation error requires locations."); - const loc = error.locations[i]; - const highlightLoc = getLocation(highlightNode); - const end = loc.column + (highlightLoc.end - highlightLoc.start); - highlightedNodes.push({ - source: `GraphQL: ${type}`, - message: error.message, - severity, - range: new _RangeEs.R(new _RangeEs.P(loc.line - 1, loc.column - 1), new _RangeEs.P(loc.line - 1, end)) - }); - } - }); - return highlightedNodes; - } - __name(annotations, "annotations"); - function getRange(location, queryText) { - const parser = (0, _indexEs.o)(); - const state = parser.startState(); - const lines = queryText.split("\n"); - invariant(lines.length >= location.line, "Query text must have more lines than where the error happened"); - let stream = null; - for (let i = 0; i < location.line; i++) { - stream = new _indexEs.C(lines[i]); - while (!stream.eol()) { - const style = parser.token(stream, state); - if (style === "invalidchar") { - break; - } - } - } - invariant(stream, "Expected Parser stream to be available."); - const line = location.line - 1; - const start = stream.getStartOfToken(); - const end = stream.getCurrentPosition(); - return new _RangeEs.R(new _RangeEs.P(line, start), new _RangeEs.P(line, end)); - } - __name(getRange, "getRange"); - function getLocation(node) { - const typeCastedNode = node; - const location = typeCastedNode.loc; - invariant(location, "Expected ASTNode to have a location."); - return location; - } - __name(getLocation, "getLocation"); - const SEVERITY = ["error", "warning", "information", "hint"]; - const TYPE = { - "GraphQL: Validation": "validation", - "GraphQL: Deprecation": "deprecation", - "GraphQL: Syntax": "syntax" - }; - _codemirrorEs.C.registerHelper("lint", "graphql", (text, options) => { - const { - schema, - validationRules, - externalFragments - } = options; - const rawResults = getDiagnostics(text, schema, validationRules, void 0, externalFragments); - const results = rawResults.map(error => ({ - message: error.message, - severity: error.severity ? SEVERITY[error.severity - 1] : SEVERITY[0], - type: error.source ? TYPE[error.source] : void 0, - from: _codemirrorEs.C.Pos(error.range.start.line, error.range.start.character), - to: _codemirrorEs.C.Pos(error.range.end.line, error.range.end.character) - })); - return results; - }); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.es2.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/lint.es2.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _indexEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function jsonParse(str) { - string = str; - strLen = str.length; - start = end = lastEnd = -1; - ch(); - lex(); - const ast = parseObj(); - expect("EOF"); - return ast; - } - __name(jsonParse, "jsonParse"); - let string; - let strLen; - let start; - let end; - let lastEnd; - let code; - let kind; - function parseObj() { - const nodeStart = start; - const members = []; - expect("{"); - if (!skip("}")) { - do { - members.push(parseMember()); - } while (skip(",")); - expect("}"); - } - return { - kind: "Object", - start: nodeStart, - end: lastEnd, - members - }; - } - __name(parseObj, "parseObj"); - function parseMember() { - const nodeStart = start; - const key = kind === "String" ? curToken() : null; - expect("String"); - expect(":"); - const value = parseVal(); - return { - kind: "Member", - start: nodeStart, - end: lastEnd, - key, - value - }; - } - __name(parseMember, "parseMember"); - function parseArr() { - const nodeStart = start; - const values = []; - expect("["); - if (!skip("]")) { - do { - values.push(parseVal()); - } while (skip(",")); - expect("]"); - } - return { - kind: "Array", - start: nodeStart, - end: lastEnd, - values - }; - } - __name(parseArr, "parseArr"); - function parseVal() { - switch (kind) { - case "[": - return parseArr(); - case "{": - return parseObj(); - case "String": - case "Number": - case "Boolean": - case "Null": - const token = curToken(); - lex(); - return token; - } - expect("Value"); - } - __name(parseVal, "parseVal"); - function curToken() { - return { - kind, - start, - end, - value: JSON.parse(string.slice(start, end)) - }; - } - __name(curToken, "curToken"); - function expect(str) { - if (kind === str) { - lex(); - return; - } - let found; - if (kind === "EOF") { - found = "[end of file]"; - } else if (end - start > 1) { - found = "`" + string.slice(start, end) + "`"; - } else { - const match = string.slice(start).match(/^.+?\b/); - found = "`" + (match ? match[0] : string[start]) + "`"; - } - throw syntaxError(`Expected ${str} but found ${found}.`); - } - __name(expect, "expect"); - class JSONSyntaxError extends Error { - constructor(message, position) { - super(message); - this.position = position; - } - } - __name(JSONSyntaxError, "JSONSyntaxError"); - function syntaxError(message) { - return new JSONSyntaxError(message, { - start, - end - }); - } - __name(syntaxError, "syntaxError"); - function skip(k) { - if (kind === k) { - lex(); - return true; - } - } - __name(skip, "skip"); - function ch() { - if (end < strLen) { - end++; - code = end === strLen ? 0 : string.charCodeAt(end); - } - return code; - } - __name(ch, "ch"); - function lex() { - lastEnd = end; - while (code === 9 || code === 10 || code === 13 || code === 32) { - ch(); - } - if (code === 0) { - kind = "EOF"; - return; - } - start = end; - switch (code) { - case 34: - kind = "String"; - return readString(); - case 45: - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - kind = "Number"; - return readNumber(); - case 102: - if (string.slice(start, start + 5) !== "false") { - break; - } - end += 4; - ch(); - kind = "Boolean"; - return; - case 110: - if (string.slice(start, start + 4) !== "null") { - break; - } - end += 3; - ch(); - kind = "Null"; - return; - case 116: - if (string.slice(start, start + 4) !== "true") { - break; - } - end += 3; - ch(); - kind = "Boolean"; - return; - } - kind = string[start]; - ch(); - } - __name(lex, "lex"); - function readString() { - ch(); - while (code !== 34 && code > 31) { - if (code === 92) { - code = ch(); - switch (code) { - case 34: - case 47: - case 92: - case 98: - case 102: - case 110: - case 114: - case 116: - ch(); - break; - case 117: - ch(); - readHex(); - readHex(); - readHex(); - readHex(); - break; - default: - throw syntaxError("Bad character escape sequence."); - } - } else if (end === strLen) { - throw syntaxError("Unterminated string."); - } else { - ch(); - } - } - if (code === 34) { - ch(); - return; - } - throw syntaxError("Unterminated string."); - } - __name(readString, "readString"); - function readHex() { - if (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102) { - return ch(); - } - throw syntaxError("Expected hexadecimal digit."); - } - __name(readHex, "readHex"); - function readNumber() { - if (code === 45) { - ch(); - } - if (code === 48) { - ch(); - } else { - readDigits(); - } - if (code === 46) { - ch(); - readDigits(); - } - if (code === 69 || code === 101) { - code = ch(); - if (code === 43 || code === 45) { - ch(); - } - readDigits(); - } - } - __name(readNumber, "readNumber"); - function readDigits() { - if (code < 48 || code > 57) { - throw syntaxError("Expected decimal digit."); - } - do { - ch(); - } while (code >= 48 && code <= 57); - } - __name(readDigits, "readDigits"); - _codemirrorEs.C.registerHelper("lint", "graphql-variables", (text, options, editor) => { - if (!text) { - return []; - } - let ast; - try { - ast = jsonParse(text); - } catch (error) { - if (error instanceof JSONSyntaxError) { - return [lintError(editor, error.position, error.message)]; - } - throw error; - } - const { - variableToType - } = options; - if (!variableToType) { - return []; - } - return validateVariables(editor, variableToType, ast); - }); - function validateVariables(editor, variableToType, variablesAST) { - const errors = []; - variablesAST.members.forEach(member => { - var _a; - if (member) { - const variableName = (_a = member.key) === null || _a === void 0 ? void 0 : _a.value; - const type = variableToType[variableName]; - if (type) { - validateValue(type, member.value).forEach(_ref => { - let [node, message] = _ref; - errors.push(lintError(editor, node, message)); - }); - } else { - errors.push(lintError(editor, member.key, `Variable "$${variableName}" does not appear in any GraphQL query.`)); - } - } - }); - return errors; - } - __name(validateVariables, "validateVariables"); - function validateValue(type, valueAST) { - if (!type || !valueAST) { - return []; - } - if (type instanceof _graphql.GraphQLNonNull) { - if (valueAST.kind === "Null") { - return [[valueAST, `Type "${type}" is non-nullable and cannot be null.`]]; - } - return validateValue(type.ofType, valueAST); - } - if (valueAST.kind === "Null") { - return []; - } - if (type instanceof _graphql.GraphQLList) { - const itemType = type.ofType; - if (valueAST.kind === "Array") { - const values = valueAST.values || []; - return mapCat(values, item => validateValue(itemType, item)); - } - return validateValue(itemType, valueAST); - } - if (type instanceof _graphql.GraphQLInputObjectType) { - if (valueAST.kind !== "Object") { - return [[valueAST, `Type "${type}" must be an Object.`]]; - } - const providedFields = /* @__PURE__ */Object.create(null); - const fieldErrors = mapCat(valueAST.members, member => { - var _a; - const fieldName = (_a = member === null || member === void 0 ? void 0 : member.key) === null || _a === void 0 ? void 0 : _a.value; - providedFields[fieldName] = true; - const inputField = type.getFields()[fieldName]; - if (!inputField) { - return [[member.key, `Type "${type}" does not have a field "${fieldName}".`]]; - } - const fieldType = inputField ? inputField.type : void 0; - return validateValue(fieldType, member.value); - }); - Object.keys(type.getFields()).forEach(fieldName => { - const field = type.getFields()[fieldName]; - if (!providedFields[fieldName] && field.type instanceof _graphql.GraphQLNonNull && !field.defaultValue) { - fieldErrors.push([valueAST, `Object of type "${type}" is missing required field "${fieldName}".`]); - } - }); - return fieldErrors; - } - if (type.name === "Boolean" && valueAST.kind !== "Boolean" || type.name === "String" && valueAST.kind !== "String" || type.name === "ID" && valueAST.kind !== "Number" && valueAST.kind !== "String" || type.name === "Float" && valueAST.kind !== "Number" || type.name === "Int" && (valueAST.kind !== "Number" || (valueAST.value | 0) !== valueAST.value)) { - return [[valueAST, `Expected value of type "${type}".`]]; - } - if ((type instanceof _graphql.GraphQLEnumType || type instanceof _graphql.GraphQLScalarType) && (valueAST.kind !== "String" && valueAST.kind !== "Number" && valueAST.kind !== "Boolean" && valueAST.kind !== "Null" || isNullish(type.parseValue(valueAST.value)))) { - return [[valueAST, `Expected value of type "${type}".`]]; - } - return []; - } - __name(validateValue, "validateValue"); - function lintError(editor, node, message) { - return { - message, - severity: "error", - type: "validation", - from: editor.posFromIndex(node.start), - to: editor.posFromIndex(node.end) - }; - } - __name(lintError, "lintError"); - function isNullish(value) { - return value === null || value === void 0 || value !== value; - } - __name(isNullish, "isNullish"); - function mapCat(array, mapper) { - return Array.prototype.concat.apply([], array.map(mapper)); - } - __name(mapCat, "mapCat"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/lint.es3.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/lint.es3.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.l = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var lint$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var GUTTER_ID = "CodeMirror-lint-markers"; - var LINT_LINE_ID = "CodeMirror-lint-line-"; - function showTooltip(cm, e, content) { - var tt = document.createElement("div"); - tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme; - tt.appendChild(content.cloneNode(true)); - if (cm.state.lint.options.selfContain) cm.getWrapperElement().appendChild(tt);else document.body.appendChild(tt); - function position(e2) { - if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); - tt.style.top = Math.max(0, e2.clientY - tt.offsetHeight - 5) + "px"; - tt.style.left = e2.clientX + 5 + "px"; - } - __name(position, "position"); - CodeMirror.on(document, "mousemove", position); - position(e); - if (tt.style.opacity != null) tt.style.opacity = 1; - return tt; - } - __name(showTooltip, "showTooltip"); - function rm(elt) { - if (elt.parentNode) elt.parentNode.removeChild(elt); - } - __name(rm, "rm"); - function hideTooltip(tt) { - if (!tt.parentNode) return; - if (tt.style.opacity == null) rm(tt); - tt.style.opacity = 0; - setTimeout(function () { - rm(tt); - }, 600); - } - __name(hideTooltip, "hideTooltip"); - function showTooltipFor(cm, e, content, node) { - var tooltip = showTooltip(cm, e, content); - function hide() { - CodeMirror.off(node, "mouseout", hide); - if (tooltip) { - hideTooltip(tooltip); - tooltip = null; - } - } - __name(hide, "hide"); - var poll = setInterval(function () { - if (tooltip) for (var n = node;; n = n.parentNode) { - if (n && n.nodeType == 11) n = n.host; - if (n == document.body) return; - if (!n) { - hide(); - break; - } - } - if (!tooltip) return clearInterval(poll); - }, 400); - CodeMirror.on(node, "mouseout", hide); - } - __name(showTooltipFor, "showTooltipFor"); - function LintState(cm, conf, hasGutter) { - this.marked = []; - if (conf instanceof Function) conf = { - getAnnotations: conf - }; - if (!conf || conf === true) conf = {}; - this.options = {}; - this.linterOptions = conf.options || {}; - for (var prop in defaults) this.options[prop] = defaults[prop]; - for (var prop in conf) { - if (defaults.hasOwnProperty(prop)) { - if (conf[prop] != null) this.options[prop] = conf[prop]; - } else if (!conf.options) { - this.linterOptions[prop] = conf[prop]; - } - } - this.timeout = null; - this.hasGutter = hasGutter; - this.onMouseOver = function (e) { - onMouseOver(cm, e); - }; - this.waitingFor = 0; - } - __name(LintState, "LintState"); - var defaults = { - highlightLines: false, - tooltips: true, - delay: 500, - lintOnChange: true, - getAnnotations: null, - async: false, - selfContain: null, - formatAnnotation: null, - onUpdateLinting: null - }; - function clearMarks(cm) { - var state = cm.state.lint; - if (state.hasGutter) cm.clearGutter(GUTTER_ID); - if (state.options.highlightLines) clearErrorLines(cm); - for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); - state.marked.length = 0; - } - __name(clearMarks, "clearMarks"); - function clearErrorLines(cm) { - cm.eachLine(function (line) { - var has = line.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(line.wrapClass); - if (has) cm.removeLineClass(line, "wrap", has[0]); - }); - } - __name(clearErrorLines, "clearErrorLines"); - function makeMarker(cm, labels, severity, multiple, tooltips) { - var marker = document.createElement("div"), - inner = marker; - marker.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + severity; - if (multiple) { - inner = marker.appendChild(document.createElement("div")); - inner.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"; - } - if (tooltips != false) CodeMirror.on(inner, "mouseover", function (e) { - showTooltipFor(cm, e, labels, inner); - }); - return marker; - } - __name(makeMarker, "makeMarker"); - function getMaxSeverity(a, b) { - if (a == "error") return a;else return b; - } - __name(getMaxSeverity, "getMaxSeverity"); - function groupByLine(annotations) { - var lines = []; - for (var i = 0; i < annotations.length; ++i) { - var ann = annotations[i], - line = ann.from.line; - (lines[line] || (lines[line] = [])).push(ann); - } - return lines; - } - __name(groupByLine, "groupByLine"); - function annotationTooltip(ann) { - var severity = ann.severity; - if (!severity) severity = "error"; - var tip = document.createElement("div"); - tip.className = "CodeMirror-lint-message CodeMirror-lint-message-" + severity; - if (typeof ann.messageHTML != "undefined") { - tip.innerHTML = ann.messageHTML; - } else { - tip.appendChild(document.createTextNode(ann.message)); - } - return tip; - } - __name(annotationTooltip, "annotationTooltip"); - function lintAsync(cm, getAnnotations) { - var state = cm.state.lint; - var id = ++state.waitingFor; - function abort() { - id = -1; - cm.off("change", abort); - } - __name(abort, "abort"); - cm.on("change", abort); - getAnnotations(cm.getValue(), function (annotations, arg2) { - cm.off("change", abort); - if (state.waitingFor != id) return; - if (arg2 && annotations instanceof CodeMirror) annotations = arg2; - cm.operation(function () { - updateLinting(cm, annotations); - }); - }, state.linterOptions, cm); - } - __name(lintAsync, "lintAsync"); - function startLinting(cm) { - var state = cm.state.lint; - if (!state) return; - var options = state.options; - var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); - if (!getAnnotations) return; - if (options.async || getAnnotations.async) { - lintAsync(cm, getAnnotations); - } else { - var annotations = getAnnotations(cm.getValue(), state.linterOptions, cm); - if (!annotations) return; - if (annotations.then) annotations.then(function (issues) { - cm.operation(function () { - updateLinting(cm, issues); - }); - });else cm.operation(function () { - updateLinting(cm, annotations); - }); - } - } - __name(startLinting, "startLinting"); - function updateLinting(cm, annotationsNotSorted) { - var state = cm.state.lint; - if (!state) return; - var options = state.options; - clearMarks(cm); - var annotations = groupByLine(annotationsNotSorted); - for (var line = 0; line < annotations.length; ++line) { - var anns = annotations[line]; - if (!anns) continue; - var message = []; - anns = anns.filter(function (item) { - return message.indexOf(item.message) > -1 ? false : message.push(item.message); - }); - var maxSeverity = null; - var tipLabel = state.hasGutter && document.createDocumentFragment(); - for (var i = 0; i < anns.length; ++i) { - var ann = anns[i]; - var severity = ann.severity; - if (!severity) severity = "error"; - maxSeverity = getMaxSeverity(maxSeverity, severity); - if (options.formatAnnotation) ann = options.formatAnnotation(ann); - if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); - if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { - className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + severity, - __annotation: ann - })); - } - if (state.hasGutter) cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1, options.tooltips)); - if (options.highlightLines) cm.addLineClass(line, "wrap", LINT_LINE_ID + maxSeverity); - } - if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); - } - __name(updateLinting, "updateLinting"); - function onChange(cm) { - var state = cm.state.lint; - if (!state) return; - clearTimeout(state.timeout); - state.timeout = setTimeout(function () { - startLinting(cm); - }, state.options.delay); - } - __name(onChange, "onChange"); - function popupTooltips(cm, annotations, e) { - var target = e.target || e.srcElement; - var tooltip = document.createDocumentFragment(); - for (var i = 0; i < annotations.length; i++) { - var ann = annotations[i]; - tooltip.appendChild(annotationTooltip(ann)); - } - showTooltipFor(cm, e, tooltip, target); - } - __name(popupTooltips, "popupTooltips"); - function onMouseOver(cm, e) { - var target = e.target || e.srcElement; - if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; - var box = target.getBoundingClientRect(), - x = (box.left + box.right) / 2, - y = (box.top + box.bottom) / 2; - var spans = cm.findMarksAt(cm.coordsChar({ - left: x, - top: y - }, "client")); - var annotations = []; - for (var i = 0; i < spans.length; ++i) { - var ann = spans[i].__annotation; - if (ann) annotations.push(ann); - } - if (annotations.length) popupTooltips(cm, annotations, e); - } - __name(onMouseOver, "onMouseOver"); - CodeMirror.defineOption("lint", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - clearMarks(cm); - if (cm.state.lint.options.lintOnChange !== false) cm.off("change", onChange); - CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); - clearTimeout(cm.state.lint.timeout); - delete cm.state.lint; - } - if (val) { - var gutters = cm.getOption("gutters"), - hasLintGutter = false; - for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; - var state = cm.state.lint = new LintState(cm, val, hasLintGutter); - if (state.options.lintOnChange) cm.on("change", onChange); - if (state.options.tooltips != false && state.options.tooltips != "gutter") CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - startLinting(cm); - } - }); - CodeMirror.defineExtension("performLint", function () { - startLinting(this); - }); - }); - })(); - var lint = lint$2.exports; - var lint$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": lint - }, [lint$2.exports]); - _exports.l = lint$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/matchbrackets.es.js": -/*!*****************************************************!*\ - !*** ../../graphiql-react/dist/matchbrackets.es.js ***! - \*****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.m = _exports.a = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var matchbrackets$2 = { - exports: {} - }; - _exports.a = matchbrackets$2; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8); - var Pos = CodeMirror.Pos; - var matching = { - "(": ")>", - ")": "(<", - "[": "]>", - "]": "[<", - "{": "}>", - "}": "{<", - "<": ">>", - ">": "<<" - }; - function bracketRegex(config) { - return config && config.bracketRegex || /[(){}[\]]/; - } - __name(bracketRegex, "bracketRegex"); - function findMatchingBracket(cm, where, config) { - var line = cm.getLineHandle(where.line), - pos = where.ch - 1; - var afterCursor = config && config.afterCursor; - if (afterCursor == null) afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className); - var re = bracketRegex(config); - var match = !afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)] || re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)]; - if (!match) return null; - var dir = match.charAt(1) == ">" ? 1 : -1; - if (config && config.strict && dir > 0 != (pos == where.ch)) return null; - var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config); - if (found == null) return null; - return { - from: Pos(where.line, pos), - to: found && found.pos, - match: found && found.ch == match.charAt(0), - forward: dir > 0 - }; - } - __name(findMatchingBracket, "findMatchingBracket"); - function scanForBracket(cm, where, dir, style, config) { - var maxScanLen = config && config.maxScanLineLength || 1e4; - var maxScanLines = config && config.maxScanLines || 1e3; - var stack = []; - var re = bracketRegex(config); - var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) : Math.max(cm.firstLine() - 1, where.line - maxScanLines); - for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { - var line = cm.getLine(lineNo); - if (!line) continue; - var pos = dir > 0 ? 0 : line.length - 1, - end = dir > 0 ? line.length : -1; - if (line.length > maxScanLen) continue; - if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); - for (; pos != end; pos += dir) { - var ch = line.charAt(pos); - if (re.test(ch) && (style === void 0 || (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) { - var match = matching[ch]; - if (match && match.charAt(1) == ">" == dir > 0) stack.push(ch);else if (!stack.length) return { - pos: Pos(lineNo, pos), - ch - };else stack.pop(); - } - } - } - return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; - } - __name(scanForBracket, "scanForBracket"); - function matchBrackets(cm, autoclear, config) { - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1e3, - highlightNonMatching = config && config.highlightNonMatching; - var marks = [], - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config); - if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) { - var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), { - className: style - })); - if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), { - className: style - })); - } - } - if (marks.length) { - if (ie_lt8 && cm.state.focused) cm.focus(); - var clear = /* @__PURE__ */__name(function () { - cm.operation(function () { - for (var i2 = 0; i2 < marks.length; i2++) marks[i2].clear(); - }); - }, "clear"); - if (autoclear) setTimeout(clear, 800);else return clear; - } - } - __name(matchBrackets, "matchBrackets"); - function doMatchBrackets(cm) { - cm.operation(function () { - if (cm.state.matchBrackets.currentlyHighlighted) { - cm.state.matchBrackets.currentlyHighlighted(); - cm.state.matchBrackets.currentlyHighlighted = null; - } - cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); - }); - } - __name(doMatchBrackets, "doMatchBrackets"); - function clearHighlighted(cm) { - if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) { - cm.state.matchBrackets.currentlyHighlighted(); - cm.state.matchBrackets.currentlyHighlighted = null; - } - } - __name(clearHighlighted, "clearHighlighted"); - CodeMirror.defineOption("matchBrackets", false, function (cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("cursorActivity", doMatchBrackets); - cm.off("focus", doMatchBrackets); - cm.off("blur", clearHighlighted); - clearHighlighted(cm); - } - if (val) { - cm.state.matchBrackets = typeof val == "object" ? val : {}; - cm.on("cursorActivity", doMatchBrackets); - cm.on("focus", doMatchBrackets); - cm.on("blur", clearHighlighted); - } - }); - CodeMirror.defineExtension("matchBrackets", function () { - matchBrackets(this, true); - }); - CodeMirror.defineExtension("findMatchingBracket", function (pos, config, oldConfig) { - if (oldConfig || typeof config == "boolean") { - if (!oldConfig) { - config = config ? { - strict: true - } : null; - } else { - oldConfig.strict = config; - config = oldConfig; - } - } - return findMatchingBracket(this, pos, config); - }); - CodeMirror.defineExtension("scanForBracket", function (pos, dir, style, config) { - return scanForBracket(this, pos, dir, style, config); - }); - }); - })(); - var matchbrackets = matchbrackets$2.exports; - var matchbrackets$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": matchbrackets - }, [matchbrackets$2.exports]); - _exports.m = matchbrackets$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.es.js": -/*!********************************************!*\ - !*** ../../graphiql-react/dist/mode.es.js ***! - \********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _indexEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function indent(state, textAfter) { - var _a, _b; - const { - levels, - indentLevel - } = state; - const level = !levels || levels.length === 0 ? indentLevel : levels[levels.length - 1] - (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0); - return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0); - } - __name(indent, "indent"); - const graphqlModeFactory = /* @__PURE__ */__name(config => { - const parser = (0, _indexEs.o)({ - eatWhitespace: stream => stream.eatWhile(_indexEs.i), - lexRules: _indexEs.L, - parseRules: _indexEs.P, - editorConfig: { - tabSize: config.tabSize - } - }); - return { - config, - startState: parser.startState, - token: parser.token, - indent, - electricInput: /^\s*[})\]]/, - fold: "brace", - lineComment: "#", - closeBrackets: { - pairs: '()[]{}""', - explode: "()[]{}" - } - }; - }, "graphqlModeFactory"); - _codemirrorEs.C.defineMode("graphql", graphqlModeFactory); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.es2.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/mode.es2.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _indexEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - _codemirrorEs.C.defineMode("graphql-results", config => { - const parser = (0, _indexEs.o)({ - eatWhitespace: stream => stream.eatSpace(), - lexRules: LexRules, - parseRules: ParseRules, - editorConfig: { - tabSize: config.tabSize - } - }); - return { - config, - startState: parser.startState, - token: parser.token, - indent, - electricInput: /^\s*[}\]]/, - fold: "brace", - closeBrackets: { - pairs: '[]{}""', - explode: "[]{}" - } - }; - }); - function indent(state, textAfter) { - var _a, _b; - const { - levels, - indentLevel - } = state; - const level = !levels || levels.length === 0 ? indentLevel : levels[levels.length - 1] - (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0); - return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0); - } - __name(indent, "indent"); - const LexRules = { - Punctuation: /^\[|]|\{|\}|:|,/, - Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, - String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, - Keyword: /^true|false|null/ - }; - const ParseRules = { - Document: [(0, _indexEs.p)("{"), (0, _indexEs.l)("Entry", (0, _indexEs.p)(",")), (0, _indexEs.p)("}")], - Entry: [(0, _indexEs.t)("String", "def"), (0, _indexEs.p)(":"), "Value"], - Value(token) { - switch (token.kind) { - case "Number": - return "NumberValue"; - case "String": - return "StringValue"; - case "Punctuation": - switch (token.value) { - case "[": - return "ListValue"; - case "{": - return "ObjectValue"; - } - return null; - case "Keyword": - switch (token.value) { - case "true": - case "false": - return "BooleanValue"; - case "null": - return "NullValue"; - } - return null; - } - }, - NumberValue: [(0, _indexEs.t)("Number", "number")], - StringValue: [(0, _indexEs.t)("String", "string")], - BooleanValue: [(0, _indexEs.t)("Keyword", "builtin")], - NullValue: [(0, _indexEs.t)("Keyword", "keyword")], - ListValue: [(0, _indexEs.p)("["), (0, _indexEs.l)("Value", (0, _indexEs.p)(",")), (0, _indexEs.p)("]")], - ObjectValue: [(0, _indexEs.p)("{"), (0, _indexEs.l)("ObjectField", (0, _indexEs.p)(",")), (0, _indexEs.p)("}")], - ObjectField: [(0, _indexEs.t)("String", "property"), (0, _indexEs.p)(":"), "Value"] - }; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/mode.es3.js": -/*!*********************************************!*\ - !*** ../../graphiql-react/dist/mode.es3.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./index.es.js */ "../../graphiql-react/dist/index.es.js"), __webpack_require__(/*! react */ "react"), __webpack_require__(/*! react-dom */ "react-dom")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_codemirrorEs, _graphql, _indexEs, _react, _reactDom) { - "use strict"; - - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - _codemirrorEs.C.defineMode("graphql-variables", config => { - const parser = (0, _indexEs.o)({ - eatWhitespace: stream => stream.eatSpace(), - lexRules: LexRules, - parseRules: ParseRules, - editorConfig: { - tabSize: config.tabSize - } - }); - return { - config, - startState: parser.startState, - token: parser.token, - indent, - electricInput: /^\s*[}\]]/, - fold: "brace", - closeBrackets: { - pairs: '[]{}""', - explode: "[]{}" - } - }; - }); - function indent(state, textAfter) { - var _a, _b; - const { - levels, - indentLevel - } = state; - const level = !levels || levels.length === 0 ? indentLevel : levels[levels.length - 1] - (((_a = this.electricInput) === null || _a === void 0 ? void 0 : _a.test(textAfter)) ? 1 : 0); - return (level || 0) * (((_b = this.config) === null || _b === void 0 ? void 0 : _b.indentUnit) || 0); - } - __name(indent, "indent"); - const LexRules = { - Punctuation: /^\[|]|\{|\}|:|,/, - Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, - String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, - Keyword: /^true|false|null/ - }; - const ParseRules = { - Document: [(0, _indexEs.p)("{"), (0, _indexEs.l)("Variable", (0, _indexEs.b)((0, _indexEs.p)(","))), (0, _indexEs.p)("}")], - Variable: [namedKey("variable"), (0, _indexEs.p)(":"), "Value"], - Value(token) { - switch (token.kind) { - case "Number": - return "NumberValue"; - case "String": - return "StringValue"; - case "Punctuation": - switch (token.value) { - case "[": - return "ListValue"; - case "{": - return "ObjectValue"; - } - return null; - case "Keyword": - switch (token.value) { - case "true": - case "false": - return "BooleanValue"; - case "null": - return "NullValue"; - } - return null; - } - }, - NumberValue: [(0, _indexEs.t)("Number", "number")], - StringValue: [(0, _indexEs.t)("String", "string")], - BooleanValue: [(0, _indexEs.t)("Keyword", "builtin")], - NullValue: [(0, _indexEs.t)("Keyword", "keyword")], - ListValue: [(0, _indexEs.p)("["), (0, _indexEs.l)("Value", (0, _indexEs.b)((0, _indexEs.p)(","))), (0, _indexEs.p)("]")], - ObjectValue: [(0, _indexEs.p)("{"), (0, _indexEs.l)("ObjectField", (0, _indexEs.b)((0, _indexEs.p)(","))), (0, _indexEs.p)("}")], - ObjectField: [namedKey("attribute"), (0, _indexEs.p)(":"), "Value"] - }; - function namedKey(style) { - return { - style, - match: token => token.kind === "String", - update(state, token) { - state.name = token.value.slice(1, -1); - } - }; - } - __name(namedKey, "namedKey"); -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/search.es.js": -/*!**********************************************!*\ - !*** ../../graphiql-react/dist/search.es.js ***! - \**********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./searchcursor.es.js */ "../../graphiql-react/dist/searchcursor.es.js"), __webpack_require__(/*! ./dialog.es.js */ "../../graphiql-react/dist/dialog.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs, _searchcursorEs, _dialogEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.s = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var search$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports, _searchcursorEs.a.exports, _dialogEs.a.exports); - })(function (CodeMirror) { - CodeMirror.defineOption("search", { - bottom: false - }); - function searchOverlay(query, caseInsensitive) { - if (typeof query == "string") query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");else if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); - return { - token: function (stream) { - query.lastIndex = stream.pos; - var match = query.exec(stream.string); - if (match && match.index == stream.pos) { - stream.pos += match[0].length || 1; - return "searching"; - } else if (match) { - stream.pos = match.index; - } else { - stream.skipToEnd(); - } - } - }; - } - __name(searchOverlay, "searchOverlay"); - function SearchState() { - this.posFrom = this.posTo = this.lastQuery = this.query = null; - this.overlay = null; - } - __name(SearchState, "SearchState"); - function getSearchState(cm) { - return cm.state.search || (cm.state.search = new SearchState()); - } - __name(getSearchState, "getSearchState"); - function queryCaseInsensitive(query) { - return typeof query == "string" && query == query.toLowerCase(); - } - __name(queryCaseInsensitive, "queryCaseInsensitive"); - function getSearchCursor(cm, query, pos) { - return cm.getSearchCursor(query, pos, { - caseFold: queryCaseInsensitive(query), - multiline: true - }); - } - __name(getSearchCursor, "getSearchCursor"); - function persistentDialog(cm, text, deflt, onEnter, onKeyDown) { - cm.openDialog(text, onEnter, { - value: deflt, - selectValueOnOpen: true, - closeOnEnter: false, - onClose: function () { - clearSearch(cm); - }, - onKeyDown, - bottom: cm.options.search.bottom - }); - } - __name(persistentDialog, "persistentDialog"); - function dialog2(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, { - value: deflt, - selectValueOnOpen: true, - bottom: cm.options.search.bottom - });else f(prompt(shortText, deflt)); - } - __name(dialog2, "dialog"); - function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs);else if (confirm(shortText)) fs[0](); - } - __name(confirmDialog, "confirmDialog"); - function parseString(string) { - return string.replace(/\\([nrt\\])/g, function (match, ch) { - if (ch == "n") return "\n"; - if (ch == "r") return "\r"; - if (ch == "t") return " "; - if (ch == "\\") return "\\"; - return match; - }); - } - __name(parseString, "parseString"); - function parseQuery(query) { - var isRE = query.match(/^\/(.*)\/([a-z]*)$/); - if (isRE) { - try { - query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); - } catch (e) {} - } else { - query = parseString(query); - } - if (typeof query == "string" ? query == "" : query.test("")) query = /x^/; - return query; - } - __name(parseQuery, "parseQuery"); - function startSearch(cm, state, query) { - state.queryText = query; - state.query = parseQuery(query); - cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); - state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); - cm.addOverlay(state.overlay); - if (cm.showMatchesOnScrollbar) { - if (state.annotate) { - state.annotate.clear(); - state.annotate = null; - } - state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); - } - } - __name(startSearch, "startSearch"); - function doSearch(cm, rev, persistent, immediate) { - var state = getSearchState(cm); - if (state.query) return findNext(cm, rev); - var q = cm.getSelection() || state.lastQuery; - if (q instanceof RegExp && q.source == "x^") q = null; - if (persistent && cm.openDialog) { - var hiding = null; - var searchNext = /* @__PURE__ */__name(function (query, event) { - CodeMirror.e_stop(event); - if (!query) return; - if (query != state.queryText) { - startSearch(cm, state, query); - state.posFrom = state.posTo = cm.getCursor(); - } - if (hiding) hiding.style.opacity = 1; - findNext(cm, event.shiftKey, function (_, to) { - var dialog3; - if (to.line < 3 && document.querySelector && (dialog3 = cm.display.wrapper.querySelector(".CodeMirror-dialog")) && dialog3.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) (hiding = dialog3).style.opacity = 0.4; - }); - }, "searchNext"); - persistentDialog(cm, getQueryDialog(cm), q, searchNext, function (event, query) { - var keyName = CodeMirror.keyName(event); - var extra = cm.getOption("extraKeys"), - cmd = extra && extra[keyName] || CodeMirror.keyMap[cm.getOption("keyMap")][keyName]; - if (cmd == "findNext" || cmd == "findPrev" || cmd == "findPersistentNext" || cmd == "findPersistentPrev") { - CodeMirror.e_stop(event); - startSearch(cm, getSearchState(cm), query); - cm.execCommand(cmd); - } else if (cmd == "find" || cmd == "findPersistent") { - CodeMirror.e_stop(event); - searchNext(query, event); - } - }); - if (immediate && q) { - startSearch(cm, state, q); - findNext(cm, rev); - } - } else { - dialog2(cm, getQueryDialog(cm), "Search for:", q, function (query) { - if (query && !state.query) cm.operation(function () { - startSearch(cm, state, query); - state.posFrom = state.posTo = cm.getCursor(); - findNext(cm, rev); - }); - }); - } - } - __name(doSearch, "doSearch"); - function findNext(cm, rev, callback) { - cm.operation(function () { - var state = getSearchState(cm); - var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); - if (!cursor.find(rev)) { - cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); - if (!cursor.find(rev)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({ - from: cursor.from(), - to: cursor.to() - }, 20); - state.posFrom = cursor.from(); - state.posTo = cursor.to(); - if (callback) callback(cursor.from(), cursor.to()); - }); - } - __name(findNext, "findNext"); - function clearSearch(cm) { - cm.operation(function () { - var state = getSearchState(cm); - state.lastQuery = state.query; - if (!state.query) return; - state.query = state.queryText = null; - cm.removeOverlay(state.overlay); - if (state.annotate) { - state.annotate.clear(); - state.annotate = null; - } - }); - } - __name(clearSearch, "clearSearch"); - function el(tag, attrs) { - var element = tag ? document.createElement(tag) : document.createDocumentFragment(); - for (var key in attrs) { - element[key] = attrs[key]; - } - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - element.appendChild(typeof child == "string" ? document.createTextNode(child) : child); - } - return element; - } - __name(el, "el"); - function getQueryDialog(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("Search:")), " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - }), " ", el("span", { - style: "color: #888", - className: "CodeMirror-search-hint" - }, cm.phrase("(Use /re/ syntax for regexp search)"))); - } - __name(getQueryDialog, "getQueryDialog"); - function getReplaceQueryDialog(cm) { - return el("", null, " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - }), " ", el("span", { - style: "color: #888", - className: "CodeMirror-search-hint" - }, cm.phrase("(Use /re/ syntax for regexp search)"))); - } - __name(getReplaceQueryDialog, "getReplaceQueryDialog"); - function getReplacementQueryDialog(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("With:")), " ", el("input", { - type: "text", - "style": "width: 10em", - className: "CodeMirror-search-field" - })); - } - __name(getReplacementQueryDialog, "getReplacementQueryDialog"); - function getDoReplaceConfirm(cm) { - return el("", null, el("span", { - className: "CodeMirror-search-label" - }, cm.phrase("Replace?")), " ", el("button", {}, cm.phrase("Yes")), " ", el("button", {}, cm.phrase("No")), " ", el("button", {}, cm.phrase("All")), " ", el("button", {}, cm.phrase("Stop"))); - } - __name(getDoReplaceConfirm, "getDoReplaceConfirm"); - function replaceAll(cm, query, text) { - cm.operation(function () { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/g, function (_, i) { - return match[i]; - })); - } else cursor.replace(text); - } - }); - } - __name(replaceAll, "replaceAll"); - function replace(cm, all) { - if (cm.getOption("readOnly")) return; - var query = cm.getSelection() || getSearchState(cm).lastQuery; - var dialogText = all ? cm.phrase("Replace all:") : cm.phrase("Replace:"); - var fragment = el("", null, el("span", { - className: "CodeMirror-search-label" - }, dialogText), getReplaceQueryDialog(cm)); - dialog2(cm, fragment, dialogText, query, function (query2) { - if (!query2) return; - query2 = parseQuery(query2); - dialog2(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function (text) { - text = parseString(text); - if (all) { - replaceAll(cm, query2, text); - } else { - clearSearch(cm); - var cursor = getSearchCursor(cm, query2, cm.getCursor("from")); - var advance = /* @__PURE__ */__name(function () { - var start = cursor.from(), - match; - if (!(match = cursor.findNext())) { - cursor = getSearchCursor(cm, query2); - if (!(match = cursor.findNext()) || start && cursor.from().line == start.line && cursor.from().ch == start.ch) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({ - from: cursor.from(), - to: cursor.to() - }); - confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase("Replace?"), [function () { - doReplace(match); - }, advance, function () { - replaceAll(cm, query2, text); - }]); - }, "advance"); - var doReplace = /* @__PURE__ */__name(function (match) { - cursor.replace(typeof query2 == "string" ? text : text.replace(/\$(\d)/g, function (_, i) { - return match[i]; - })); - advance(); - }, "doReplace"); - advance(); - } - }); - }); - } - __name(replace, "replace"); - CodeMirror.commands.find = function (cm) { - clearSearch(cm); - doSearch(cm); - }; - CodeMirror.commands.findPersistent = function (cm) { - clearSearch(cm); - doSearch(cm, false, true); - }; - CodeMirror.commands.findPersistentNext = function (cm) { - doSearch(cm, false, true, true); - }; - CodeMirror.commands.findPersistentPrev = function (cm) { - doSearch(cm, true, true, true); - }; - CodeMirror.commands.findNext = doSearch; - CodeMirror.commands.findPrev = function (cm) { - doSearch(cm, true); - }; - CodeMirror.commands.clearSearch = clearSearch; - CodeMirror.commands.replace = replace; - CodeMirror.commands.replaceAll = function (cm) { - replace(cm, true); - }; - }); - })(); - var search = search$2.exports; - var search$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": search - }, [search$2.exports]); - _exports.s = search$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/searchcursor.es.js": -/*!****************************************************!*\ - !*** ../../graphiql-react/dist/searchcursor.es.js ***! - \****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.s = _exports.a = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var searchcursor$2 = { - exports: {} - }; - _exports.a = searchcursor$2; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var Pos = CodeMirror.Pos; - function regexpFlags(regexp) { - var flags = regexp.flags; - return flags != null ? flags : (regexp.ignoreCase ? "i" : "") + (regexp.global ? "g" : "") + (regexp.multiline ? "m" : ""); - } - __name(regexpFlags, "regexpFlags"); - function ensureFlags(regexp, flags) { - var current = regexpFlags(regexp), - target = current; - for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1) target += flags.charAt(i); - return current == target ? regexp : new RegExp(regexp.source, target); - } - __name(ensureFlags, "ensureFlags"); - function maybeMultiline(regexp) { - return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source); - } - __name(maybeMultiline, "maybeMultiline"); - function searchRegexpForward(doc, regexp, start) { - regexp = ensureFlags(regexp, "g"); - for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) { - regexp.lastIndex = ch; - var string = doc.getLine(line), - match = regexp.exec(string); - if (match) return { - from: Pos(line, match.index), - to: Pos(line, match.index + match[0].length), - match - }; - } - } - __name(searchRegexpForward, "searchRegexpForward"); - function searchRegexpForwardMultiline(doc, regexp, start) { - if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start); - regexp = ensureFlags(regexp, "gm"); - var string, - chunk = 1; - for (var line = start.line, last = doc.lastLine(); line <= last;) { - for (var i = 0; i < chunk; i++) { - if (line > last) break; - var curLine = doc.getLine(line++); - string = string == null ? curLine : string + "\n" + curLine; - } - chunk = chunk * 2; - regexp.lastIndex = start.ch; - var match = regexp.exec(string); - if (match) { - var before = string.slice(0, match.index).split("\n"), - inside = match[0].split("\n"); - var startLine = start.line + before.length - 1, - startCh = before[before.length - 1].length; - return { - from: Pos(startLine, startCh), - to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), - match - }; - } - } - } - __name(searchRegexpForwardMultiline, "searchRegexpForwardMultiline"); - function lastMatchIn(string, regexp, endMargin) { - var match, - from = 0; - while (from <= string.length) { - regexp.lastIndex = from; - var newMatch = regexp.exec(string); - if (!newMatch) break; - var end = newMatch.index + newMatch[0].length; - if (end > string.length - endMargin) break; - if (!match || end > match.index + match[0].length) match = newMatch; - from = newMatch.index + 1; - } - return match; - } - __name(lastMatchIn, "lastMatchIn"); - function searchRegexpBackward(doc, regexp, start) { - regexp = ensureFlags(regexp, "g"); - for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) { - var string = doc.getLine(line); - var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch); - if (match) return { - from: Pos(line, match.index), - to: Pos(line, match.index + match[0].length), - match - }; - } - } - __name(searchRegexpBackward, "searchRegexpBackward"); - function searchRegexpBackwardMultiline(doc, regexp, start) { - if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start); - regexp = ensureFlags(regexp, "gm"); - var string, - chunkSize = 1, - endMargin = doc.getLine(start.line).length - start.ch; - for (var line = start.line, first = doc.firstLine(); line >= first;) { - for (var i = 0; i < chunkSize && line >= first; i++) { - var curLine = doc.getLine(line--); - string = string == null ? curLine : curLine + "\n" + string; - } - chunkSize *= 2; - var match = lastMatchIn(string, regexp, endMargin); - if (match) { - var before = string.slice(0, match.index).split("\n"), - inside = match[0].split("\n"); - var startLine = line + before.length, - startCh = before[before.length - 1].length; - return { - from: Pos(startLine, startCh), - to: Pos(startLine + inside.length - 1, inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length), - match - }; - } - } - } - __name(searchRegexpBackwardMultiline, "searchRegexpBackwardMultiline"); - var doFold, noFold; - if (String.prototype.normalize) { - doFold = /* @__PURE__ */__name(function (str) { - return str.normalize("NFD").toLowerCase(); - }, "doFold"); - noFold = /* @__PURE__ */__name(function (str) { - return str.normalize("NFD"); - }, "noFold"); - } else { - doFold = /* @__PURE__ */__name(function (str) { - return str.toLowerCase(); - }, "doFold"); - noFold = /* @__PURE__ */__name(function (str) { - return str; - }, "noFold"); - } - function adjustPos(orig, folded, pos, foldFunc) { - if (orig.length == folded.length) return pos; - for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) { - if (min == max) return min; - var mid = min + max >> 1; - var len = foldFunc(orig.slice(0, mid)).length; - if (len == pos) return mid;else if (len > pos) max = mid;else min = mid + 1; - } - } - __name(adjustPos, "adjustPos"); - function searchStringForward(doc, query, start, caseFold) { - if (!query.length) return null; - var fold = caseFold ? doFold : noFold; - var lines = fold(query).split(/\r|\n\r?/); - search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) { - var orig = doc.getLine(line).slice(ch), - string = fold(orig); - if (lines.length == 1) { - var found = string.indexOf(lines[0]); - if (found == -1) continue search; - var start = adjustPos(orig, string, found, fold) + ch; - return { - from: Pos(line, adjustPos(orig, string, found, fold) + ch), - to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch) - }; - } else { - var cutFrom = string.length - lines[0].length; - if (string.slice(cutFrom) != lines[0]) continue search; - for (var i = 1; i < lines.length - 1; i++) if (fold(doc.getLine(line + i)) != lines[i]) continue search; - var end = doc.getLine(line + lines.length - 1), - endString = fold(end), - lastLine = lines[lines.length - 1]; - if (endString.slice(0, lastLine.length) != lastLine) continue search; - return { - from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch), - to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold)) - }; - } - } - } - __name(searchStringForward, "searchStringForward"); - function searchStringBackward(doc, query, start, caseFold) { - if (!query.length) return null; - var fold = caseFold ? doFold : noFold; - var lines = fold(query).split(/\r|\n\r?/); - search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) { - var orig = doc.getLine(line); - if (ch > -1) orig = orig.slice(0, ch); - var string = fold(orig); - if (lines.length == 1) { - var found = string.lastIndexOf(lines[0]); - if (found == -1) continue search; - return { - from: Pos(line, adjustPos(orig, string, found, fold)), - to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold)) - }; - } else { - var lastLine = lines[lines.length - 1]; - if (string.slice(0, lastLine.length) != lastLine) continue search; - for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++) if (fold(doc.getLine(start + i)) != lines[i]) continue search; - var top = doc.getLine(line + 1 - lines.length), - topString = fold(top); - if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search; - return { - from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)), - to: Pos(line, adjustPos(orig, string, lastLine.length, fold)) - }; - } - } - } - __name(searchStringBackward, "searchStringBackward"); - function SearchCursor(doc, query, pos, options) { - this.atOccurrence = false; - this.afterEmptyMatch = false; - this.doc = doc; - pos = pos ? doc.clipPos(pos) : Pos(0, 0); - this.pos = { - from: pos, - to: pos - }; - var caseFold; - if (typeof options == "object") { - caseFold = options.caseFold; - } else { - caseFold = options; - options = null; - } - if (typeof query == "string") { - if (caseFold == null) caseFold = false; - this.matches = function (reverse, pos2) { - return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos2, caseFold); - }; - } else { - query = ensureFlags(query, "gm"); - if (!options || options.multiline !== false) this.matches = function (reverse, pos2) { - return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos2); - };else this.matches = function (reverse, pos2) { - return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos2); - }; - } - } - __name(SearchCursor, "SearchCursor"); - SearchCursor.prototype = { - findNext: function () { - return this.find(false); - }, - findPrevious: function () { - return this.find(true); - }, - find: function (reverse) { - var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); - if (this.afterEmptyMatch && this.atOccurrence) { - head = Pos(head.line, head.ch); - if (reverse) { - head.ch--; - if (head.ch < 0) { - head.line--; - head.ch = (this.doc.getLine(head.line) || "").length; - } - } else { - head.ch++; - if (head.ch > (this.doc.getLine(head.line) || "").length) { - head.ch = 0; - head.line++; - } - } - if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) { - return this.atOccurrence = false; - } - } - var result = this.matches(reverse, head); - this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0; - if (result) { - this.pos = result; - this.atOccurrence = true; - return this.pos.match || true; - } else { - var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0); - this.pos = { - from: end, - to: end - }; - return this.atOccurrence = false; - } - }, - from: function () { - if (this.atOccurrence) return this.pos.from; - }, - to: function () { - if (this.atOccurrence) return this.pos.to; - }, - replace: function (newText, origin) { - if (!this.atOccurrence) return; - var lines = CodeMirror.splitLines(newText); - this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin); - this.pos.to = Pos(this.pos.from.line + lines.length - 1, lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); - } - }; - CodeMirror.defineExtension("getSearchCursor", function (query, pos, caseFold) { - return new SearchCursor(this.doc, query, pos, caseFold); - }); - CodeMirror.defineDocExtension("getSearchCursor", function (query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); - }); - CodeMirror.defineExtension("selectMatches", function (query, caseFold) { - var ranges = []; - var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); - while (cur.findNext()) { - if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; - ranges.push({ - anchor: cur.from(), - head: cur.to() - }); - } - if (ranges.length) this.setSelections(ranges, 0); - }); - }); - })(); - var searchcursor = searchcursor$2.exports; - var searchcursor$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": searchcursor - }, [searchcursor$2.exports]); - _exports.s = searchcursor$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/show-hint.es.js": -/*!*************************************************!*\ - !*** ../../graphiql-react/dist/show-hint.es.js ***! - \*************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.s = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var showHint$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports); - })(function (CodeMirror) { - var HINT_ELEMENT_CLASS = "CodeMirror-hint"; - var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; - CodeMirror.showHint = function (cm, getHints, options) { - if (!getHints) return cm.showHint(options); - if (options && options.async) getHints.async = true; - var newOpts = { - hint: getHints - }; - if (options) for (var prop in options) newOpts[prop] = options[prop]; - return cm.showHint(newOpts); - }; - CodeMirror.defineExtension("showHint", function (options) { - options = parseOptions(this, this.getCursor("start"), options); - var selections = this.listSelections(); - if (selections.length > 1) return; - if (this.somethingSelected()) { - if (!options.hint.supportsSelection) return; - for (var i = 0; i < selections.length; i++) if (selections[i].head.line != selections[i].anchor.line) return; - } - if (this.state.completionActive) this.state.completionActive.close(); - var completion = this.state.completionActive = new Completion(this, options); - if (!completion.options.hint) return; - CodeMirror.signal(this, "startCompletion", this); - completion.update(true); - }); - CodeMirror.defineExtension("closeHint", function () { - if (this.state.completionActive) this.state.completionActive.close(); - }); - function Completion(cm, options) { - this.cm = cm; - this.options = options; - this.widget = null; - this.debounce = 0; - this.tick = 0; - this.startPos = this.cm.getCursor("start"); - this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; - if (this.options.updateOnCursorActivity) { - var self = this; - cm.on("cursorActivity", this.activityFunc = function () { - self.cursorActivity(); - }); - } - } - __name(Completion, "Completion"); - var requestAnimationFrame = window.requestAnimationFrame || function (fn) { - return setTimeout(fn, 1e3 / 60); - }; - var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - Completion.prototype = { - close: function () { - if (!this.active()) return; - this.cm.state.completionActive = null; - this.tick = null; - if (this.options.updateOnCursorActivity) { - this.cm.off("cursorActivity", this.activityFunc); - } - if (this.widget && this.data) CodeMirror.signal(this.data, "close"); - if (this.widget) this.widget.close(); - CodeMirror.signal(this.cm, "endCompletion", this.cm); - }, - active: function () { - return this.cm.state.completionActive == this; - }, - pick: function (data, i) { - var completion = data.list[i], - self = this; - this.cm.operation(function () { - if (completion.hint) completion.hint(self.cm, data, completion);else self.cm.replaceRange(getText(completion), completion.from || data.from, completion.to || data.to, "complete"); - CodeMirror.signal(data, "pick", completion); - self.cm.scrollIntoView(); - }); - if (this.options.closeOnPick) { - this.close(); - } - }, - cursorActivity: function () { - if (this.debounce) { - cancelAnimationFrame(this.debounce); - this.debounce = 0; - } - var identStart = this.startPos; - if (this.data) { - identStart = this.data.from; - } - var pos = this.cm.getCursor(), - line = this.cm.getLine(pos.line); - if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || pos.ch < identStart.ch || this.cm.somethingSelected() || !pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1))) { - this.close(); - } else { - var self = this; - this.debounce = requestAnimationFrame(function () { - self.update(); - }); - if (this.widget) this.widget.disable(); - } - }, - update: function (first) { - if (this.tick == null) return; - var self = this, - myTick = ++this.tick; - fetchHints(this.options.hint, this.cm, this.options, function (data) { - if (self.tick == myTick) self.finishUpdate(data, first); - }); - }, - finishUpdate: function (data, first) { - if (this.data) CodeMirror.signal(this.data, "update"); - var picked = this.widget && this.widget.picked || first && this.options.completeSingle; - if (this.widget) this.widget.close(); - this.data = data; - if (data && data.list.length) { - if (picked && data.list.length == 1) { - this.pick(data, 0); - } else { - this.widget = new Widget(this, data); - CodeMirror.signal(data, "shown"); - } - } - } - }; - function parseOptions(cm, pos, options) { - var editor = cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) { - for (var prop in editor) if (editor[prop] !== void 0) out[prop] = editor[prop]; - } - if (options) { - for (var prop in options) if (options[prop] !== void 0) out[prop] = options[prop]; - } - if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos); - return out; - } - __name(parseOptions, "parseOptions"); - function getText(completion) { - if (typeof completion == "string") return completion;else return completion.text; - } - __name(getText, "getText"); - function buildKeyMap(completion, handle) { - var baseMap = { - Up: function () { - handle.moveFocus(-1); - }, - Down: function () { - handle.moveFocus(1); - }, - PageUp: function () { - handle.moveFocus(-handle.menuSize() + 1, true); - }, - PageDown: function () { - handle.moveFocus(handle.menuSize() - 1, true); - }, - Home: function () { - handle.setFocus(0); - }, - End: function () { - handle.setFocus(handle.length - 1); - }, - Enter: handle.pick, - Tab: handle.pick, - Esc: handle.close - }; - var mac = /Mac/.test(navigator.platform); - if (mac) { - baseMap["Ctrl-P"] = function () { - handle.moveFocus(-1); - }; - baseMap["Ctrl-N"] = function () { - handle.moveFocus(1); - }; - } - var custom = completion.options.customKeys; - var ourMap = custom ? {} : baseMap; - function addBinding(key2, val) { - var bound; - if (typeof val != "string") bound = /* @__PURE__ */__name(function (cm) { - return val(cm, handle); - }, "bound");else if (baseMap.hasOwnProperty(val)) bound = baseMap[val];else bound = val; - ourMap[key2] = bound; - } - __name(addBinding, "addBinding"); - if (custom) { - for (var key in custom) if (custom.hasOwnProperty(key)) addBinding(key, custom[key]); - } - var extra = completion.options.extraKeys; - if (extra) { - for (var key in extra) if (extra.hasOwnProperty(key)) addBinding(key, extra[key]); - } - return ourMap; - } - __name(buildKeyMap, "buildKeyMap"); - function getHintElement(hintsElement, el) { - while (el && el != hintsElement) { - if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; - el = el.parentNode; - } - } - __name(getHintElement, "getHintElement"); - function Widget(completion, data) { - this.id = "cm-complete-" + Math.floor(Math.random(1e6)); - this.completion = completion; - this.data = data; - this.picked = false; - var widget = this, - cm = completion.cm; - var ownerDocument = cm.getInputField().ownerDocument; - var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow; - var hints = this.hints = ownerDocument.createElement("ul"); - hints.setAttribute("role", "listbox"); - hints.setAttribute("aria-expanded", "true"); - hints.id = this.id; - var theme = completion.cm.options.theme; - hints.className = "CodeMirror-hints " + theme; - this.selectedHint = data.selectedHint || 0; - var completions = data.list; - for (var i = 0; i < completions.length; ++i) { - var elt = hints.appendChild(ownerDocument.createElement("li")), - cur = completions[i]; - var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); - if (cur.className != null) className = cur.className + " " + className; - elt.className = className; - if (i == this.selectedHint) elt.setAttribute("aria-selected", "true"); - elt.id = this.id + "-" + i; - elt.setAttribute("role", "option"); - if (cur.render) cur.render(elt, data, cur);else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur))); - elt.hintId = i; - } - var container = completion.options.container || ownerDocument.body; - var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); - var left = pos.left, - top = pos.bottom, - below = true; - var offsetLeft = 0, - offsetTop = 0; - if (container !== ownerDocument.body) { - var isContainerPositioned = ["absolute", "relative", "fixed"].indexOf(parentWindow.getComputedStyle(container).position) !== -1; - var offsetParent = isContainerPositioned ? container : container.offsetParent; - var offsetParentPosition = offsetParent.getBoundingClientRect(); - var bodyPosition = ownerDocument.body.getBoundingClientRect(); - offsetLeft = offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft; - offsetTop = offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop; - } - hints.style.left = left - offsetLeft + "px"; - hints.style.top = top - offsetTop + "px"; - var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth); - var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight); - container.appendChild(hints); - cm.getInputField().setAttribute("aria-autocomplete", "list"); - cm.getInputField().setAttribute("aria-owns", this.id); - cm.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint); - var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect(); - var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false; - var startScroll; - setTimeout(function () { - startScroll = cm.getScrollInfo(); - }); - var overlapY = box.bottom - winH; - if (overlapY > 0) { - var height = box.bottom - box.top, - curTop = pos.top - (pos.bottom - box.top); - if (curTop - height > 0) { - hints.style.top = (top = pos.top - height - offsetTop) + "px"; - below = false; - } else if (height > winH) { - hints.style.height = winH - 5 + "px"; - hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px"; - var cursor = cm.getCursor(); - if (data.from.ch != cursor.ch) { - pos = cm.cursorCoords(cursor); - hints.style.left = (left = pos.left - offsetLeft) + "px"; - box = hints.getBoundingClientRect(); - } - } - } - var overlapX = box.right - winW; - if (scrolls) overlapX += cm.display.nativeBarWidth; - if (overlapX > 0) { - if (box.right - box.left > winW) { - hints.style.width = winW - 5 + "px"; - overlapX -= box.right - box.left - winW; - } - hints.style.left = (left = pos.left - overlapX - offsetLeft) + "px"; - } - if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) node.style.paddingRight = cm.display.nativeBarWidth + "px"; - cm.addKeyMap(this.keyMap = buildKeyMap(completion, { - moveFocus: function (n, avoidWrap) { - widget.changeActive(widget.selectedHint + n, avoidWrap); - }, - setFocus: function (n) { - widget.changeActive(n); - }, - menuSize: function () { - return widget.screenAmount(); - }, - length: completions.length, - close: function () { - completion.close(); - }, - pick: function () { - widget.pick(); - }, - data - })); - if (completion.options.closeOnUnfocus) { - var closingOnBlur; - cm.on("blur", this.onBlur = function () { - closingOnBlur = setTimeout(function () { - completion.close(); - }, 100); - }); - cm.on("focus", this.onFocus = function () { - clearTimeout(closingOnBlur); - }); - } - cm.on("scroll", this.onScroll = function () { - var curScroll = cm.getScrollInfo(), - editor = cm.getWrapperElement().getBoundingClientRect(); - if (!startScroll) startScroll = cm.getScrollInfo(); - var newTop = top + startScroll.top - curScroll.top; - var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop); - if (!below) point += hints.offsetHeight; - if (point <= editor.top || point >= editor.bottom) return completion.close(); - hints.style.top = newTop + "px"; - hints.style.left = left + startScroll.left - curScroll.left + "px"; - }); - CodeMirror.on(hints, "dblclick", function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - widget.pick(); - } - }); - CodeMirror.on(hints, "click", function (e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - if (completion.options.completeOnSingleClick) widget.pick(); - } - }); - CodeMirror.on(hints, "mousedown", function () { - setTimeout(function () { - cm.focus(); - }, 20); - }); - var selectedHintRange = this.getSelectedHintRange(); - if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) { - this.scrollToActive(); - } - CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); - return true; - } - __name(Widget, "Widget"); - Widget.prototype = { - close: function () { - if (this.completion.widget != this) return; - this.completion.widget = null; - if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints); - this.completion.cm.removeKeyMap(this.keyMap); - var input = this.completion.cm.getInputField(); - input.removeAttribute("aria-activedescendant"); - input.removeAttribute("aria-owns"); - var cm = this.completion.cm; - if (this.completion.options.closeOnUnfocus) { - cm.off("blur", this.onBlur); - cm.off("focus", this.onFocus); - } - cm.off("scroll", this.onScroll); - }, - disable: function () { - this.completion.cm.removeKeyMap(this.keyMap); - var widget = this; - this.keyMap = { - Enter: function () { - widget.picked = true; - } - }; - this.completion.cm.addKeyMap(this.keyMap); - }, - pick: function () { - this.completion.pick(this.data, this.selectedHint); - }, - changeActive: function (i, avoidWrap) { - if (i >= this.data.list.length) i = avoidWrap ? this.data.list.length - 1 : 0;else if (i < 0) i = avoidWrap ? 0 : this.data.list.length - 1; - if (this.selectedHint == i) return; - var node = this.hints.childNodes[this.selectedHint]; - if (node) { - node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); - node.removeAttribute("aria-selected"); - } - node = this.hints.childNodes[this.selectedHint = i]; - node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; - node.setAttribute("aria-selected", "true"); - this.completion.cm.getInputField().setAttribute("aria-activedescendant", node.id); - this.scrollToActive(); - CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); - }, - scrollToActive: function () { - var selectedHintRange = this.getSelectedHintRange(); - var node1 = this.hints.childNodes[selectedHintRange.from]; - var node2 = this.hints.childNodes[selectedHintRange.to]; - var firstNode = this.hints.firstChild; - if (node1.offsetTop < this.hints.scrollTop) this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop; - }, - screenAmount: function () { - return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; - }, - getSelectedHintRange: function () { - var margin = this.completion.options.scrollMargin || 0; - return { - from: Math.max(0, this.selectedHint - margin), - to: Math.min(this.data.list.length - 1, this.selectedHint + margin) - }; - } - }; - function applicableHelpers(cm, helpers) { - if (!cm.somethingSelected()) return helpers; - var result = []; - for (var i = 0; i < helpers.length; i++) if (helpers[i].supportsSelection) result.push(helpers[i]); - return result; - } - __name(applicableHelpers, "applicableHelpers"); - function fetchHints(hint, cm, options, callback) { - if (hint.async) { - hint(cm, callback, options); - } else { - var result = hint(cm, options); - if (result && result.then) result.then(callback);else callback(result); - } - } - __name(fetchHints, "fetchHints"); - function resolveAutoHints(cm, pos) { - var helpers = cm.getHelpers(pos, "hint"), - words; - if (helpers.length) { - var resolved = /* @__PURE__ */__name(function (cm2, callback, options) { - var app = applicableHelpers(cm2, helpers); - function run(i) { - if (i == app.length) return callback(null); - fetchHints(app[i], cm2, options, function (result) { - if (result && result.list.length > 0) callback(result);else run(i + 1); - }); - } - __name(run, "run"); - run(0); - }, "resolved"); - resolved.async = true; - resolved.supportsSelection = true; - return resolved; - } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { - return function (cm2) { - return CodeMirror.hint.fromList(cm2, { - words - }); - }; - } else if (CodeMirror.hint.anyword) { - return function (cm2, options) { - return CodeMirror.hint.anyword(cm2, options); - }; - } else { - return function () {}; - } - } - __name(resolveAutoHints, "resolveAutoHints"); - CodeMirror.registerHelper("hint", "auto", { - resolve: resolveAutoHints - }); - CodeMirror.registerHelper("hint", "fromList", function (cm, options) { - var cur = cm.getCursor(), - token = cm.getTokenAt(cur); - var term, - from = CodeMirror.Pos(cur.line, token.start), - to = cur; - if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) { - term = token.string.substr(0, cur.ch - token.start); - } else { - term = ""; - from = cur; - } - var found = []; - for (var i = 0; i < options.words.length; i++) { - var word = options.words[i]; - if (word.slice(0, term.length) == term) found.push(word); - } - if (found.length) return { - list: found, - from, - to - }; - }); - CodeMirror.commands.autocomplete = CodeMirror.showHint; - var defaultOptions = { - hint: CodeMirror.hint.auto, - completeSingle: true, - alignWithWord: true, - closeCharacters: /[\s()\[\]{};:>,]/, - closeOnPick: true, - closeOnUnfocus: true, - updateOnCursorActivity: true, - completeOnSingleClick: true, - container: null, - customKeys: null, - extraKeys: null, - paddingForScrollbar: true, - moveOnOverlap: true - }; - CodeMirror.defineOption("hintOptions", null); - }); - })(); - var showHint = showHint$2.exports; - var showHint$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": showHint - }, [showHint$2.exports]); - _exports.s = showHint$1; -}); - -/***/ }), - -/***/ "../../graphiql-react/dist/sublime.es.js": -/*!***********************************************!*\ - !*** ../../graphiql-react/dist/sublime.es.js ***! - \***********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./codemirror.es.js */ "../../graphiql-react/dist/codemirror.es.js"), __webpack_require__(/*! ./searchcursor.es.js */ "../../graphiql-react/dist/searchcursor.es.js"), __webpack_require__(/*! ./matchbrackets.es.js */ "../../graphiql-react/dist/matchbrackets.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _codemirrorEs, _searchcursorEs, _matchbracketsEs) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.s = void 0; - var __defProp = Object.defineProperty; - var __name = (target, value) => __defProp(target, "name", { - value, - configurable: true - }); - function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function (k) { - if (k !== "default" && !(k in n)) { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { - return e[k]; - } - }); - } - }); - }); - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { - value: "Module" - })); - } - __name(_mergeNamespaces, "_mergeNamespaces"); - var sublime$2 = { - exports: {} - }; - (function (module, exports) { - (function (mod) { - mod(_codemirrorEs.a.exports, _searchcursorEs.a.exports, _matchbracketsEs.a.exports); - })(function (CodeMirror) { - var cmds = CodeMirror.commands; - var Pos = CodeMirror.Pos; - function findPosSubword(doc, start, dir) { - if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1)); - var line = doc.getLine(start.line); - if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0)); - var state = "start", - type, - startPos = start.ch; - for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) { - var next = line.charAt(dir < 0 ? pos - 1 : pos); - var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o"; - if (cat == "w" && next.toUpperCase() == next) cat = "W"; - if (state == "start") { - if (cat != "o") { - state = "in"; - type = cat; - } else startPos = pos + dir; - } else if (state == "in") { - if (type != cat) { - if (type == "w" && cat == "W" && dir < 0) pos--; - if (type == "W" && cat == "w" && dir > 0) { - if (pos == startPos + 1) { - type = "w"; - continue; - } else pos--; - } - break; - } - } - } - return Pos(start.line, pos); - } - __name(findPosSubword, "findPosSubword"); - function moveSubword(cm, dir) { - cm.extendSelectionsBy(function (range) { - if (cm.display.shift || cm.doc.extend || range.empty()) return findPosSubword(cm.doc, range.head, dir);else return dir < 0 ? range.from() : range.to(); - }); - } - __name(moveSubword, "moveSubword"); - cmds.goSubwordLeft = function (cm) { - moveSubword(cm, -1); - }; - cmds.goSubwordRight = function (cm) { - moveSubword(cm, 1); - }; - cmds.scrollLineUp = function (cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); - if (cm.getCursor().line >= visibleBottomLine) cm.execCommand("goLineUp"); - } - cm.scrollTo(null, info.top - cm.defaultTextHeight()); - }; - cmds.scrollLineDown = function (cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleTopLine = cm.lineAtHeight(info.top, "local") + 1; - if (cm.getCursor().line <= visibleTopLine) cm.execCommand("goLineDown"); - } - cm.scrollTo(null, info.top + cm.defaultTextHeight()); - }; - cmds.splitSelectionByLine = function (cm) { - var ranges = cm.listSelections(), - lineRanges = []; - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), - to = ranges[i].to(); - for (var line = from.line; line <= to.line; ++line) if (!(to.line > from.line && line == to.line && to.ch == 0)) lineRanges.push({ - anchor: line == from.line ? from : Pos(line, 0), - head: line == to.line ? to : Pos(line) - }); - } - cm.setSelections(lineRanges, 0); - }; - cmds.singleSelectionTop = function (cm) { - var range = cm.listSelections()[0]; - cm.setSelection(range.anchor, range.head, { - scroll: false - }); - }; - cmds.selectLine = function (cm) { - var ranges = cm.listSelections(), - extended = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - extended.push({ - anchor: Pos(range.from().line, 0), - head: Pos(range.to().line + 1, 0) - }); - } - cm.setSelections(extended); - }; - function insertLine(cm, above) { - if (cm.isReadOnly()) return CodeMirror.Pass; - cm.operation(function () { - var len = cm.listSelections().length, - newSelection = [], - last = -1; - for (var i = 0; i < len; i++) { - var head = cm.listSelections()[i].head; - if (head.line <= last) continue; - var at = Pos(head.line + (above ? 0 : 1), 0); - cm.replaceRange("\n", at, null, "+insertLine"); - cm.indentLine(at.line, null, true); - newSelection.push({ - head: at, - anchor: at - }); - last = head.line + 1; - } - cm.setSelections(newSelection); - }); - cm.execCommand("indentAuto"); - } - __name(insertLine, "insertLine"); - cmds.insertLineAfter = function (cm) { - return insertLine(cm, false); - }; - cmds.insertLineBefore = function (cm) { - return insertLine(cm, true); - }; - function wordAt(cm, pos) { - var start = pos.ch, - end = start, - line = cm.getLine(pos.line); - while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start; - while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end; - return { - from: Pos(pos.line, start), - to: Pos(pos.line, end), - word: line.slice(start, end) - }; - } - __name(wordAt, "wordAt"); - cmds.selectNextOccurrence = function (cm) { - var from = cm.getCursor("from"), - to = cm.getCursor("to"); - var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - cm.setSelection(word.from, word.to); - fullWord = true; - } else { - var text = cm.getRange(from, to); - var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; - var cur = cm.getSearchCursor(query, to); - var found = cur.findNext(); - if (!found) { - cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); - found = cur.findNext(); - } - if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) return; - cm.addSelection(cur.from(), cur.to()); - } - if (fullWord) cm.state.sublimeFindFullWord = cm.doc.sel; - }; - cmds.skipAndSelectNextOccurrence = function (cm) { - var prevAnchor = cm.getCursor("anchor"), - prevHead = cm.getCursor("head"); - cmds.selectNextOccurrence(cm); - if (CodeMirror.cmpPos(prevAnchor, prevHead) != 0) { - cm.doc.setSelections(cm.doc.listSelections().filter(function (sel) { - return sel.anchor != prevAnchor || sel.head != prevHead; - })); - } - }; - function addCursorToSelection(cm, dir) { - var ranges = cm.listSelections(), - newRanges = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - var newAnchor = cm.findPosV(range.anchor, dir, "line", range.anchor.goalColumn); - var newHead = cm.findPosV(range.head, dir, "line", range.head.goalColumn); - newAnchor.goalColumn = range.anchor.goalColumn != null ? range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left; - newHead.goalColumn = range.head.goalColumn != null ? range.head.goalColumn : cm.cursorCoords(range.head, "div").left; - var newRange = { - anchor: newAnchor, - head: newHead - }; - newRanges.push(range); - newRanges.push(newRange); - } - cm.setSelections(newRanges); - } - __name(addCursorToSelection, "addCursorToSelection"); - cmds.addCursorToPrevLine = function (cm) { - addCursorToSelection(cm, -1); - }; - cmds.addCursorToNextLine = function (cm) { - addCursorToSelection(cm, 1); - }; - function isSelectedRange(ranges, from, to) { - for (var i = 0; i < ranges.length; i++) if (CodeMirror.cmpPos(ranges[i].from(), from) == 0 && CodeMirror.cmpPos(ranges[i].to(), to) == 0) return true; - return false; - } - __name(isSelectedRange, "isSelectedRange"); - var mirror = "(){}[]"; - function selectBetweenBrackets(cm) { - var ranges = cm.listSelections(), - newRanges = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - pos = range.head, - opening = cm.scanForBracket(pos, -1); - if (!opening) return false; - for (;;) { - var closing = cm.scanForBracket(pos, 1); - if (!closing) return false; - if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { - var startPos = Pos(opening.pos.line, opening.pos.ch + 1); - if (CodeMirror.cmpPos(startPos, range.from()) == 0 && CodeMirror.cmpPos(closing.pos, range.to()) == 0) { - opening = cm.scanForBracket(opening.pos, -1); - if (!opening) return false; - } else { - newRanges.push({ - anchor: startPos, - head: closing.pos - }); - break; - } - } - pos = Pos(closing.pos.line, closing.pos.ch + 1); - } - } - cm.setSelections(newRanges); - return true; - } - __name(selectBetweenBrackets, "selectBetweenBrackets"); - cmds.selectScope = function (cm) { - selectBetweenBrackets(cm) || cm.execCommand("selectAll"); - }; - cmds.selectBetweenBrackets = function (cm) { - if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; - }; - function puncType(type) { - return !type ? null : /\bpunctuation\b/.test(type) ? type : void 0; - } - __name(puncType, "puncType"); - cmds.goToBracket = function (cm) { - cm.extendSelectionsBy(function (range) { - var next = cm.scanForBracket(range.head, 1, puncType(cm.getTokenTypeAt(range.head))); - if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; - var prev = cm.scanForBracket(range.head, -1, puncType(cm.getTokenTypeAt(Pos(range.head.line, range.head.ch + 1)))); - return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head; - }); - }; - cmds.swapLineUp = function (cm) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - linesToMove = [], - at = cm.firstLine() - 1, - newSels = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - from = range.from().line - 1, - to = range.to().line; - newSels.push({ - anchor: Pos(range.anchor.line - 1, range.anchor.ch), - head: Pos(range.head.line - 1, range.head.ch) - }); - if (range.to().ch == 0 && !range.empty()) --to; - if (from > at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; - } - cm.operation(function () { - for (var i2 = 0; i2 < linesToMove.length; i2 += 2) { - var from2 = linesToMove[i2], - to2 = linesToMove[i2 + 1]; - var line = cm.getLine(from2); - cm.replaceRange("", Pos(from2, 0), Pos(from2 + 1, 0), "+swapLine"); - if (to2 > cm.lastLine()) cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");else cm.replaceRange(line + "\n", Pos(to2, 0), null, "+swapLine"); - } - cm.setSelections(newSels); - cm.scrollIntoView(); - }); - }; - cmds.swapLineDown = function (cm) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - linesToMove = [], - at = cm.lastLine() + 1; - for (var i = ranges.length - 1; i >= 0; i--) { - var range = ranges[i], - from = range.to().line + 1, - to = range.from().line; - if (range.to().ch == 0 && !range.empty()) from--; - if (from < at) linesToMove.push(from, to);else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; - } - cm.operation(function () { - for (var i2 = linesToMove.length - 2; i2 >= 0; i2 -= 2) { - var from2 = linesToMove[i2], - to2 = linesToMove[i2 + 1]; - var line = cm.getLine(from2); - if (from2 == cm.lastLine()) cm.replaceRange("", Pos(from2 - 1), Pos(from2), "+swapLine");else cm.replaceRange("", Pos(from2, 0), Pos(from2 + 1, 0), "+swapLine"); - cm.replaceRange(line + "\n", Pos(to2, 0), null, "+swapLine"); - } - cm.scrollIntoView(); - }); - }; - cmds.toggleCommentIndented = function (cm) { - cm.toggleComment({ - indent: true - }); - }; - cmds.joinLines = function (cm) { - var ranges = cm.listSelections(), - joined = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], - from = range.from(); - var start = from.line, - end = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == end) end = ranges[++i].to().line; - joined.push({ - start, - end, - anchor: !range.empty() && from - }); - } - cm.operation(function () { - var offset = 0, - ranges2 = []; - for (var i2 = 0; i2 < joined.length; i2++) { - var obj = joined[i2]; - var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), - head; - for (var line = obj.start; line <= obj.end; line++) { - var actual = line - offset; - if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1); - if (actual < cm.lastLine()) { - cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length)); - ++offset; - } - } - ranges2.push({ - anchor: anchor || head, - head - }); - } - cm.setSelections(ranges2, 0); - }); - }; - cmds.duplicateLine = function (cm) { - cm.operation(function () { - var rangeCount = cm.listSelections().length; - for (var i = 0; i < rangeCount; i++) { - var range = cm.listSelections()[i]; - if (range.empty()) cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));else cm.replaceRange(cm.getRange(range.from(), range.to()), range.from()); - } - cm.scrollIntoView(); - }); - }; - function sortLines(cm, caseSensitive, direction) { - if (cm.isReadOnly()) return CodeMirror.Pass; - var ranges = cm.listSelections(), - toSort = [], - selected; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) continue; - var from = range.from().line, - to = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == to) to = ranges[++i].to().line; - if (!ranges[i].to().ch) to--; - toSort.push(from, to); - } - if (toSort.length) selected = true;else toSort.push(cm.firstLine(), cm.lastLine()); - cm.operation(function () { - var ranges2 = []; - for (var i2 = 0; i2 < toSort.length; i2 += 2) { - var from2 = toSort[i2], - to2 = toSort[i2 + 1]; - var start = Pos(from2, 0), - end = Pos(to2); - var lines = cm.getRange(start, end, false); - if (caseSensitive) lines.sort(function (a, b) { - return a < b ? -direction : a == b ? 0 : direction; - });else lines.sort(function (a, b) { - var au = a.toUpperCase(), - bu = b.toUpperCase(); - if (au != bu) { - a = au; - b = bu; - } - return a < b ? -direction : a == b ? 0 : direction; - }); - cm.replaceRange(lines, start, end); - if (selected) ranges2.push({ - anchor: start, - head: Pos(to2 + 1, 0) - }); - } - if (selected) cm.setSelections(ranges2, 0); - }); - } - __name(sortLines, "sortLines"); - cmds.sortLines = function (cm) { - sortLines(cm, true, 1); - }; - cmds.reverseSortLines = function (cm) { - sortLines(cm, true, -1); - }; - cmds.sortLinesInsensitive = function (cm) { - sortLines(cm, false, 1); - }; - cmds.reverseSortLinesInsensitive = function (cm) { - sortLines(cm, false, -1); - }; - cmds.nextBookmark = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - var current = marks.shift(); - var found = current.find(); - if (found) { - marks.push(current); - return cm.setSelection(found.from, found.to); - } - } - }; - cmds.prevBookmark = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - marks.unshift(marks.pop()); - var found = marks[marks.length - 1].find(); - if (!found) marks.pop();else return cm.setSelection(found.from, found.to); - } - }; - cmds.toggleBookmark = function (cm) { - var ranges = cm.listSelections(); - var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), - to = ranges[i].to(); - var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to); - for (var j = 0; j < found.length; j++) { - if (found[j].sublimeBookmark) { - found[j].clear(); - for (var k = 0; k < marks.length; k++) if (marks[k] == found[j]) marks.splice(k--, 1); - break; - } - } - if (j == found.length) marks.push(cm.markText(from, to, { - sublimeBookmark: true, - clearWhenEmpty: false - })); - } - }; - cmds.clearBookmarks = function (cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); - marks.length = 0; - }; - cmds.selectBookmarks = function (cm) { - var marks = cm.state.sublimeBookmarks, - ranges = []; - if (marks) for (var i = 0; i < marks.length; i++) { - var found = marks[i].find(); - if (!found) marks.splice(i--, 0);else ranges.push({ - anchor: found.from, - head: found.to - }); - } - if (ranges.length) cm.setSelections(ranges, 0); - }; - function modifyWordOrSelection(cm, mod) { - cm.operation(function () { - var ranges = cm.listSelections(), - indices = [], - replacements = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) { - indices.push(i); - replacements.push(""); - } else replacements.push(mod(cm.getRange(range.from(), range.to()))); - } - cm.replaceSelections(replacements, "around", "case"); - for (var i = indices.length - 1, at; i >= 0; i--) { - var range = ranges[indices[i]]; - if (at && CodeMirror.cmpPos(range.head, at) > 0) continue; - var word = wordAt(cm, range.head); - at = word.from; - cm.replaceRange(mod(word.word), word.from, word.to); - } - }); - } - __name(modifyWordOrSelection, "modifyWordOrSelection"); - cmds.smartBackspace = function (cm) { - if (cm.somethingSelected()) return CodeMirror.Pass; - cm.operation(function () { - var cursors = cm.listSelections(); - var indentUnit = cm.getOption("indentUnit"); - for (var i = cursors.length - 1; i >= 0; i--) { - var cursor = cursors[i].head; - var toStartOfLine = cm.getRange({ - line: cursor.line, - ch: 0 - }, cursor); - var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); - var deletePos = cm.findPosH(cursor, -1, "char", false); - if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) { - var prevIndent = new Pos(cursor.line, CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit)); - if (prevIndent.ch != cursor.ch) deletePos = prevIndent; - } - cm.replaceRange("", deletePos, cursor, "+delete"); - } - }); - }; - cmds.delLineRight = function (cm) { - cm.operation(function () { - var ranges = cm.listSelections(); - for (var i = ranges.length - 1; i >= 0; i--) cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete"); - cm.scrollIntoView(); - }); - }; - cmds.upcaseAtCursor = function (cm) { - modifyWordOrSelection(cm, function (str) { - return str.toUpperCase(); - }); - }; - cmds.downcaseAtCursor = function (cm) { - modifyWordOrSelection(cm, function (str) { - return str.toLowerCase(); - }); - }; - cmds.setSublimeMark = function (cm) { - if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); - }; - cmds.selectToSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) cm.setSelection(cm.getCursor(), found); - }; - cmds.deleteToSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - var from = cm.getCursor(), - to = found; - if (CodeMirror.cmpPos(from, to) > 0) { - var tmp = to; - to = from; - from = tmp; - } - cm.state.sublimeKilled = cm.getRange(from, to); - cm.replaceRange("", from, to); - } - }; - cmds.swapWithSublimeMark = function (cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); - cm.setCursor(found); - } - }; - cmds.sublimeYank = function (cm) { - if (cm.state.sublimeKilled != null) cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); - }; - cmds.showInCenter = function (cm) { - var pos = cm.cursorCoords(null, "local"); - cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); - }; - function getTarget(cm) { - var from = cm.getCursor("from"), - to = cm.getCursor("to"); - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - from = word.from; - to = word.to; - } - return { - from, - to, - query: cm.getRange(from, to), - word - }; - } - __name(getTarget, "getTarget"); - function findAndGoTo(cm, forward) { - var target = getTarget(cm); - if (!target) return; - var query = target.query; - var cur = cm.getSearchCursor(query, forward ? target.to : target.from); - if (forward ? cur.findNext() : cur.findPrevious()) { - cm.setSelection(cur.from(), cur.to()); - } else { - cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0) : cm.clipPos(Pos(cm.lastLine()))); - if (forward ? cur.findNext() : cur.findPrevious()) cm.setSelection(cur.from(), cur.to());else if (target.word) cm.setSelection(target.from, target.to); - } - } - __name(findAndGoTo, "findAndGoTo"); - cmds.findUnder = function (cm) { - findAndGoTo(cm, true); - }; - cmds.findUnderPrevious = function (cm) { - findAndGoTo(cm, false); - }; - cmds.findAllUnder = function (cm) { - var target = getTarget(cm); - if (!target) return; - var cur = cm.getSearchCursor(target.query); - var matches = []; - var primaryIndex = -1; - while (cur.findNext()) { - matches.push({ - anchor: cur.from(), - head: cur.to() - }); - if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch) primaryIndex++; - } - cm.setSelections(matches, primaryIndex); - }; - var keyMap = CodeMirror.keyMap; - keyMap.macSublime = { - "Cmd-Left": "goLineStartSmart", - "Shift-Tab": "indentLess", - "Shift-Ctrl-K": "deleteLine", - "Alt-Q": "wrapLines", - "Ctrl-Left": "goSubwordLeft", - "Ctrl-Right": "goSubwordRight", - "Ctrl-Alt-Up": "scrollLineUp", - "Ctrl-Alt-Down": "scrollLineDown", - "Cmd-L": "selectLine", - "Shift-Cmd-L": "splitSelectionByLine", - "Esc": "singleSelectionTop", - "Cmd-Enter": "insertLineAfter", - "Shift-Cmd-Enter": "insertLineBefore", - "Cmd-D": "selectNextOccurrence", - "Shift-Cmd-Space": "selectScope", - "Shift-Cmd-M": "selectBetweenBrackets", - "Cmd-M": "goToBracket", - "Cmd-Ctrl-Up": "swapLineUp", - "Cmd-Ctrl-Down": "swapLineDown", - "Cmd-/": "toggleCommentIndented", - "Cmd-J": "joinLines", - "Shift-Cmd-D": "duplicateLine", - "F5": "sortLines", - "Shift-F5": "reverseSortLines", - "Cmd-F5": "sortLinesInsensitive", - "Shift-Cmd-F5": "reverseSortLinesInsensitive", - "F2": "nextBookmark", - "Shift-F2": "prevBookmark", - "Cmd-F2": "toggleBookmark", - "Shift-Cmd-F2": "clearBookmarks", - "Alt-F2": "selectBookmarks", - "Backspace": "smartBackspace", - "Cmd-K Cmd-D": "skipAndSelectNextOccurrence", - "Cmd-K Cmd-K": "delLineRight", - "Cmd-K Cmd-U": "upcaseAtCursor", - "Cmd-K Cmd-L": "downcaseAtCursor", - "Cmd-K Cmd-Space": "setSublimeMark", - "Cmd-K Cmd-A": "selectToSublimeMark", - "Cmd-K Cmd-W": "deleteToSublimeMark", - "Cmd-K Cmd-X": "swapWithSublimeMark", - "Cmd-K Cmd-Y": "sublimeYank", - "Cmd-K Cmd-C": "showInCenter", - "Cmd-K Cmd-G": "clearBookmarks", - "Cmd-K Cmd-Backspace": "delLineLeft", - "Cmd-K Cmd-1": "foldAll", - "Cmd-K Cmd-0": "unfoldAll", - "Cmd-K Cmd-J": "unfoldAll", - "Ctrl-Shift-Up": "addCursorToPrevLine", - "Ctrl-Shift-Down": "addCursorToNextLine", - "Cmd-F3": "findUnder", - "Shift-Cmd-F3": "findUnderPrevious", - "Alt-F3": "findAllUnder", - "Shift-Cmd-[": "fold", - "Shift-Cmd-]": "unfold", - "Cmd-I": "findIncremental", - "Shift-Cmd-I": "findIncrementalReverse", - "Cmd-H": "replace", - "F3": "findNext", - "Shift-F3": "findPrev", - "fallthrough": "macDefault" - }; - CodeMirror.normalizeKeyMap(keyMap.macSublime); - keyMap.pcSublime = { - "Shift-Tab": "indentLess", - "Shift-Ctrl-K": "deleteLine", - "Alt-Q": "wrapLines", - "Ctrl-T": "transposeChars", - "Alt-Left": "goSubwordLeft", - "Alt-Right": "goSubwordRight", - "Ctrl-Up": "scrollLineUp", - "Ctrl-Down": "scrollLineDown", - "Ctrl-L": "selectLine", - "Shift-Ctrl-L": "splitSelectionByLine", - "Esc": "singleSelectionTop", - "Ctrl-Enter": "insertLineAfter", - "Shift-Ctrl-Enter": "insertLineBefore", - "Ctrl-D": "selectNextOccurrence", - "Shift-Ctrl-Space": "selectScope", - "Shift-Ctrl-M": "selectBetweenBrackets", - "Ctrl-M": "goToBracket", - "Shift-Ctrl-Up": "swapLineUp", - "Shift-Ctrl-Down": "swapLineDown", - "Ctrl-/": "toggleCommentIndented", - "Ctrl-J": "joinLines", - "Shift-Ctrl-D": "duplicateLine", - "F9": "sortLines", - "Shift-F9": "reverseSortLines", - "Ctrl-F9": "sortLinesInsensitive", - "Shift-Ctrl-F9": "reverseSortLinesInsensitive", - "F2": "nextBookmark", - "Shift-F2": "prevBookmark", - "Ctrl-F2": "toggleBookmark", - "Shift-Ctrl-F2": "clearBookmarks", - "Alt-F2": "selectBookmarks", - "Backspace": "smartBackspace", - "Ctrl-K Ctrl-D": "skipAndSelectNextOccurrence", - "Ctrl-K Ctrl-K": "delLineRight", - "Ctrl-K Ctrl-U": "upcaseAtCursor", - "Ctrl-K Ctrl-L": "downcaseAtCursor", - "Ctrl-K Ctrl-Space": "setSublimeMark", - "Ctrl-K Ctrl-A": "selectToSublimeMark", - "Ctrl-K Ctrl-W": "deleteToSublimeMark", - "Ctrl-K Ctrl-X": "swapWithSublimeMark", - "Ctrl-K Ctrl-Y": "sublimeYank", - "Ctrl-K Ctrl-C": "showInCenter", - "Ctrl-K Ctrl-G": "clearBookmarks", - "Ctrl-K Ctrl-Backspace": "delLineLeft", - "Ctrl-K Ctrl-1": "foldAll", - "Ctrl-K Ctrl-0": "unfoldAll", - "Ctrl-K Ctrl-J": "unfoldAll", - "Ctrl-Alt-Up": "addCursorToPrevLine", - "Ctrl-Alt-Down": "addCursorToNextLine", - "Ctrl-F3": "findUnder", - "Shift-Ctrl-F3": "findUnderPrevious", - "Alt-F3": "findAllUnder", - "Shift-Ctrl-[": "fold", - "Shift-Ctrl-]": "unfold", - "Ctrl-I": "findIncremental", - "Shift-Ctrl-I": "findIncrementalReverse", - "Ctrl-H": "replace", - "F3": "findNext", - "Shift-F3": "findPrev", - "fallthrough": "pcDefault" - }; - CodeMirror.normalizeKeyMap(keyMap.pcSublime); - var mac = keyMap.default == keyMap.macDefault; - keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime; - }); - })(); - var sublime = sublime$2.exports; - var sublime$1 = /* @__PURE__ */_mergeNamespaces({ - __proto__: null, - "default": sublime - }, [sublime$2.exports]); - _exports.s = sublime$1; -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/async-helpers/index.js": -/*!*********************************************************!*\ - !*** ../../graphiql-toolkit/esm/async-helpers/index.js ***! - \*********************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.fetcherReturnToPromise = fetcherReturnToPromise; - _exports.isAsyncIterable = isAsyncIterable; - _exports.isObservable = isObservable; - _exports.isPromise = isPromise; - function isPromise(value) { - return typeof value === 'object' && value !== null && typeof value.then === 'function'; - } - function observableToPromise(observable) { - return new Promise((resolve, reject) => { - const subscription = observable.subscribe({ - next: v => { - resolve(v); - subscription.unsubscribe(); - }, - error: reject, - complete: () => { - reject(new Error('no value resolved')); - } - }); - }); - } - function isObservable(value) { - return typeof value === 'object' && value !== null && 'subscribe' in value && typeof value.subscribe === 'function'; - } - function isAsyncIterable(input) { - return typeof input === 'object' && input !== null && (input[Symbol.toStringTag] === 'AsyncGenerator' || Symbol.asyncIterator in input); - } - function asyncIterableToPromise(input) { - return new Promise((resolve, reject) => { - var _a; - const iteratorReturn = (_a = ('return' in input ? input : input[Symbol.asyncIterator]()).return) === null || _a === void 0 ? void 0 : _a.bind(input); - const iteratorNext = ('next' in input ? input : input[Symbol.asyncIterator]()).next.bind(input); - iteratorNext().then(result => { - resolve(result.value); - iteratorReturn === null || iteratorReturn === void 0 ? void 0 : iteratorReturn(); - }).catch(err => { - reject(err); - }); - }); - } - function fetcherReturnToPromise(fetcherResult) { - return Promise.resolve(fetcherResult).then(result => { - if (isAsyncIterable(result)) { - return asyncIterableToPromise(result); - } - if (isObservable(result)) { - return observableToPromise(result); - } - return result; - }); - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js": -/*!******************************************************************!*\ - !*** ../../graphiql-toolkit/esm/create-fetcher/createFetcher.js ***! - \******************************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./lib */ "../../graphiql-toolkit/esm/create-fetcher/lib.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _lib) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.createGraphiQLFetcher = createGraphiQLFetcher; - function createGraphiQLFetcher(options) { - let httpFetch; - if (typeof window !== 'undefined' && window.fetch) { - httpFetch = window.fetch; - } - if ((options === null || options === void 0 ? void 0 : options.enableIncrementalDelivery) === null || options.enableIncrementalDelivery !== false) { - options.enableIncrementalDelivery = true; - } - if (options.fetch) { - httpFetch = options.fetch; - } - if (!httpFetch) { - throw new Error('No valid fetcher implementation available'); - } - const simpleFetcher = (0, _lib.createSimpleFetcher)(options, httpFetch); - const httpFetcher = options.enableIncrementalDelivery ? (0, _lib.createMultipartFetcher)(options, httpFetch) : simpleFetcher; - return (graphQLParams, fetcherOpts) => { - if (graphQLParams.operationName === 'IntrospectionQuery') { - return (options.schemaFetcher || simpleFetcher)(graphQLParams, fetcherOpts); - } - const isSubscription = (fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.documentAST) ? (0, _lib.isSubscriptionWithName)(fetcherOpts.documentAST, graphQLParams.operationName || undefined) : false; - if (isSubscription) { - const wsFetcher = (0, _lib.getWsFetcher)(options, fetcherOpts); - if (!wsFetcher) { - throw new Error(`Your GraphiQL createFetcher is not properly configured for websocket subscriptions yet. ${options.subscriptionUrl ? `Provided URL ${options.subscriptionUrl} failed` : `Please provide subscriptionUrl, wsClient or legacyClient option first.`}`); - } - return wsFetcher(graphQLParams); - } - return httpFetcher(graphQLParams, fetcherOpts); - }; - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/create-fetcher/index.js": -/*!**********************************************************!*\ - !*** ../../graphiql-toolkit/esm/create-fetcher/index.js ***! - \**********************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./types */ "../../graphiql-toolkit/esm/create-fetcher/types.js"), __webpack_require__(/*! ./createFetcher */ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _types, _createFetcher) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - var _exportNames = { - createGraphiQLFetcher: true - }; - Object.defineProperty(_exports, "createGraphiQLFetcher", { - enumerable: true, - get: function () { - return _createFetcher.createGraphiQLFetcher; - } - }); - Object.keys(_types).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in _exports && _exports[key] === _types[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _types[key]; - } - }); - }); -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/create-fetcher/lib.js": -/*!********************************************************!*\ - !*** ../../graphiql-toolkit/esm/create-fetcher/lib.js ***! - \********************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! meros */ "../../../node_modules/meros/browser/index.mjs"), __webpack_require__(/*! @n1ru4l/push-pull-async-iterable-iterator */ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _graphql, _meros, _pushPullAsyncIterableIterator) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.isSubscriptionWithName = _exports.getWsFetcher = _exports.createWebsocketsFetcherFromUrl = _exports.createWebsocketsFetcherFromClient = _exports.createSimpleFetcher = _exports.createMultipartFetcher = _exports.createLegacyWebsocketsFetcher = void 0; - var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __await = void 0 && (void 0).__await || function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - var __asyncValues = void 0 && (void 0).__asyncValues || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], - i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function (v) { - return new Promise(function (resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ - value: v, - done: d - }); - }, reject); - } - }; - var __asyncGenerator = void 0 && (void 0).__asyncGenerator || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), - i, - q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } - }; - const errorHasCode = err => { - return typeof err === 'object' && err !== null && 'code' in err; - }; - const isSubscriptionWithName = (document, name) => { - let isSubscription = false; - (0, _graphql.visit)(document, { - OperationDefinition(node) { - var _a; - if (name === ((_a = node.name) === null || _a === void 0 ? void 0 : _a.value) && node.operation === 'subscription') { - isSubscription = true; - } - } - }); - return isSubscription; - }; - _exports.isSubscriptionWithName = isSubscriptionWithName; - const createSimpleFetcher = (options, httpFetch) => (graphQLParams, fetcherOpts) => __awaiter(void 0, void 0, void 0, function* () { - const data = yield httpFetch(options.url, { - method: 'POST', - body: JSON.stringify(graphQLParams), - headers: Object.assign(Object.assign({ - 'content-type': 'application/json' - }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) - }); - return data.json(); - }); - _exports.createSimpleFetcher = createSimpleFetcher; - const createWebsocketsFetcherFromUrl = (url, connectionParams) => { - let wsClient; - try { - const { - createClient - } = __webpack_require__(/*! graphql-ws */ "../../../node_modules/graphql-ws/lib/index.js"); - wsClient = createClient({ - url, - connectionParams - }); - return createWebsocketsFetcherFromClient(wsClient); - } catch (err) { - if (errorHasCode(err) && err.code === 'MODULE_NOT_FOUND') { - throw new Error("You need to install the 'graphql-ws' package to use websockets when passing a 'subscriptionUrl'"); - } - console.error(`Error creating websocket client for ${url}`, err); - } - }; - _exports.createWebsocketsFetcherFromUrl = createWebsocketsFetcherFromUrl; - const createWebsocketsFetcherFromClient = wsClient => graphQLParams => (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => wsClient.subscribe(graphQLParams, Object.assign(Object.assign({}, sink), { - error: err => { - if (err instanceof CloseEvent) { - sink.error(new Error(`Socket closed with event ${err.code} ${err.reason || ''}`.trim())); - } else { - sink.error(err); - } - } - }))); - _exports.createWebsocketsFetcherFromClient = createWebsocketsFetcherFromClient; - const createLegacyWebsocketsFetcher = legacyWsClient => graphQLParams => { - const observable = legacyWsClient.request(graphQLParams); - return (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => observable.subscribe(sink).unsubscribe); - }; - _exports.createLegacyWebsocketsFetcher = createLegacyWebsocketsFetcher; - const createMultipartFetcher = (options, httpFetch) => function (graphQLParams, fetcherOpts) { - return __asyncGenerator(this, arguments, function* () { - var e_1, _a; - const response = yield __await(httpFetch(options.url, { - method: 'POST', - body: JSON.stringify(graphQLParams), - headers: Object.assign(Object.assign({ - 'content-type': 'application/json', - accept: 'application/json, multipart/mixed' - }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) - }).then(r => (0, _meros.meros)(r, { - multiple: true - }))); - if (!(0, _pushPullAsyncIterableIterator.isAsyncIterable)(response)) { - return yield __await(yield yield __await(response.json())); - } - try { - for (var response_1 = __asyncValues(response), response_1_1; response_1_1 = yield __await(response_1.next()), !response_1_1.done;) { - const chunk = response_1_1.value; - if (chunk.some(part => !part.json)) { - const message = chunk.map(part => `Headers::\n${part.headers}\n\nBody::\n${part.body}`); - throw new Error(`Expected multipart chunks to be of json type. got:\n${message}`); - } - yield yield __await(chunk.map(part => part.body)); - } - } catch (e_1_1) { - e_1 = { - error: e_1_1 - }; - } finally { - try { - if (response_1_1 && !response_1_1.done && (_a = response_1.return)) yield __await(_a.call(response_1)); - } finally { - if (e_1) throw e_1.error; - } - } - }); - }; - _exports.createMultipartFetcher = createMultipartFetcher; - const getWsFetcher = (options, fetcherOpts) => { - if (options.wsClient) { - return createWebsocketsFetcherFromClient(options.wsClient); - } - if (options.subscriptionUrl) { - return createWebsocketsFetcherFromUrl(options.subscriptionUrl, Object.assign(Object.assign({}, options.wsConnectionParams), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers)); - } - const legacyWebsocketsClient = options.legacyClient || options.legacyWsClient; - if (legacyWebsocketsClient) { - return createLegacyWebsocketsFetcher(legacyWebsocketsClient); - } - }; - _exports.getWsFetcher = getWsFetcher; -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/create-fetcher/types.js": -/*!**********************************************************!*\ - !*** ../../graphiql-toolkit/esm/create-fetcher/types.js ***! - \**********************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/format/index.js": -/*!**************************************************!*\ - !*** ../../graphiql-toolkit/esm/format/index.js ***! - \**************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.formatError = formatError; - _exports.formatResult = formatResult; - function stringify(obj) { - return JSON.stringify(obj, null, 2); - } - function formatSingleError(error) { - return Object.assign(Object.assign({}, error), { - message: error.message, - stack: error.stack - }); - } - function handleSingleError(error) { - if (error instanceof Error) { - return formatSingleError(error); - } - return error; - } - function formatError(error) { - if (Array.isArray(error)) { - return stringify({ - errors: error.map(e => handleSingleError(e)) - }); - } - return stringify({ - errors: [handleSingleError(error)] - }); - } - function formatResult(result) { - return stringify(result); - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js": -/*!*******************************************************************!*\ - !*** ../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js ***! - \*******************************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _graphql) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.fillLeafs = fillLeafs; - function fillLeafs(schema, docString, getDefaultFieldNames) { - const insertions = []; - if (!schema || !docString) { - return { - insertions, - result: docString - }; - } - let ast; - try { - ast = (0, _graphql.parse)(docString); - } catch (_a) { - return { - insertions, - result: docString - }; - } - const fieldNameFn = getDefaultFieldNames || defaultGetDefaultFieldNames; - const typeInfo = new _graphql.TypeInfo(schema); - (0, _graphql.visit)(ast, { - leave(node) { - typeInfo.leave(node); - }, - enter(node) { - typeInfo.enter(node); - if (node.kind === 'Field' && !node.selectionSet) { - const fieldType = typeInfo.getType(); - const selectionSet = buildSelectionSet(isFieldType(fieldType), fieldNameFn); - if (selectionSet && node.loc) { - const indent = getIndentation(docString, node.loc.start); - insertions.push({ - index: node.loc.end, - string: ' ' + (0, _graphql.print)(selectionSet).replace(/\n/g, '\n' + indent) - }); - } - } - } - }); - return { - insertions, - result: withInsertions(docString, insertions) - }; - } - function defaultGetDefaultFieldNames(type) { - if (!('getFields' in type)) { - return []; - } - const fields = type.getFields(); - if (fields.id) { - return ['id']; - } - if (fields.edges) { - return ['edges']; - } - if (fields.node) { - return ['node']; - } - const leafFieldNames = []; - Object.keys(fields).forEach(fieldName => { - if ((0, _graphql.isLeafType)(fields[fieldName].type)) { - leafFieldNames.push(fieldName); - } - }); - return leafFieldNames; - } - function buildSelectionSet(type, getDefaultFieldNames) { - const namedType = (0, _graphql.getNamedType)(type); - if (!type || (0, _graphql.isLeafType)(type)) { - return; - } - const fieldNames = getDefaultFieldNames(namedType); - if (!Array.isArray(fieldNames) || fieldNames.length === 0 || !('getFields' in namedType)) { - return; - } - return { - kind: _graphql.Kind.SELECTION_SET, - selections: fieldNames.map(fieldName => { - const fieldDef = namedType.getFields()[fieldName]; - const fieldType = fieldDef ? fieldDef.type : null; - return { - kind: _graphql.Kind.FIELD, - name: { - kind: _graphql.Kind.NAME, - value: fieldName - }, - selectionSet: buildSelectionSet(fieldType, getDefaultFieldNames) - }; - }) - }; - } - function withInsertions(initial, insertions) { - if (insertions.length === 0) { - return initial; - } - let edited = ''; - let prevIndex = 0; - insertions.forEach(_ref => { - let { - index, - string - } = _ref; - edited += initial.slice(prevIndex, index) + string; - prevIndex = index; - }); - edited += initial.slice(prevIndex); - return edited; - } - function getIndentation(str, index) { - let indentStart = index; - let indentEnd = index; - while (indentStart) { - const c = str.charCodeAt(indentStart - 1); - if (c === 10 || c === 13 || c === 0x2028 || c === 0x2029) { - break; - } - indentStart--; - if (c !== 9 && c !== 11 && c !== 12 && c !== 32 && c !== 160) { - indentEnd = indentStart; - } - } - return str.substring(indentStart, indentEnd); - } - function isFieldType(fieldType) { - if (fieldType) { - return fieldType; - } - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/graphql-helpers/index.js": -/*!***********************************************************!*\ - !*** ../../graphiql-toolkit/esm/graphql-helpers/index.js ***! - \***********************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./auto-complete */ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js"), __webpack_require__(/*! ./merge-ast */ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js"), __webpack_require__(/*! ./operation-name */ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _autoComplete, _mergeAst, _operationName) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - Object.keys(_autoComplete).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _autoComplete[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _autoComplete[key]; - } - }); - }); - Object.keys(_mergeAst).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _mergeAst[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _mergeAst[key]; - } - }); - }); - Object.keys(_operationName).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _operationName[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _operationName[key]; - } - }); - }); -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js": -/*!***************************************************************!*\ - !*** ../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js ***! - \***************************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _graphql) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.mergeAst = mergeAst; - function uniqueBy(array, iteratee) { - var _a; - const FilteredMap = new Map(); - const result = []; - for (const item of array) { - if (item.kind === 'Field') { - const uniqueValue = iteratee(item); - const existing = FilteredMap.get(uniqueValue); - if ((_a = item.directives) === null || _a === void 0 ? void 0 : _a.length) { - const itemClone = Object.assign({}, item); - result.push(itemClone); - } else if ((existing === null || existing === void 0 ? void 0 : existing.selectionSet) && item.selectionSet) { - existing.selectionSet.selections = [...existing.selectionSet.selections, ...item.selectionSet.selections]; - } else if (!existing) { - const itemClone = Object.assign({}, item); - FilteredMap.set(uniqueValue, itemClone); - result.push(itemClone); - } - } else { - result.push(item); - } - } - return result; - } - function inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType) { - var _a; - const selectionSetTypeName = selectionSetType ? (0, _graphql.getNamedType)(selectionSetType).name : null; - const outputSelections = []; - const seenSpreads = []; - for (let selection of selections) { - if (selection.kind === 'FragmentSpread') { - const fragmentName = selection.name.value; - if (!selection.directives || selection.directives.length === 0) { - if (seenSpreads.includes(fragmentName)) { - continue; - } else { - seenSpreads.push(fragmentName); - } - } - const fragmentDefinition = fragmentDefinitions[selection.name.value]; - if (fragmentDefinition) { - const { - typeCondition, - directives, - selectionSet - } = fragmentDefinition; - selection = { - kind: _graphql.Kind.INLINE_FRAGMENT, - typeCondition, - directives, - selectionSet - }; - } - } - if (selection.kind === _graphql.Kind.INLINE_FRAGMENT && (!selection.directives || ((_a = selection.directives) === null || _a === void 0 ? void 0 : _a.length) === 0)) { - const fragmentTypeName = selection.typeCondition ? selection.typeCondition.name.value : null; - if (!fragmentTypeName || fragmentTypeName === selectionSetTypeName) { - outputSelections.push(...inlineRelevantFragmentSpreads(fragmentDefinitions, selection.selectionSet.selections, selectionSetType)); - continue; - } - } - outputSelections.push(selection); - } - return outputSelections; - } - function mergeAst(documentAST, schema) { - const typeInfo = schema ? new _graphql.TypeInfo(schema) : null; - const fragmentDefinitions = Object.create(null); - for (const definition of documentAST.definitions) { - if (definition.kind === _graphql.Kind.FRAGMENT_DEFINITION) { - fragmentDefinitions[definition.name.value] = definition; - } - } - const visitors = { - SelectionSet(node) { - const selectionSetType = typeInfo ? typeInfo.getParentType() : null; - let { - selections - } = node; - selections = inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType); - selections = uniqueBy(selections, selection => selection.alias ? selection.alias.value : selection.name.value); - return Object.assign(Object.assign({}, node), { - selections - }); - }, - FragmentDefinition() { - return null; - } - }; - return (0, _graphql.visit)(documentAST, typeInfo ? (0, _graphql.visitWithTypeInfo)(typeInfo, visitors) : visitors); - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js": -/*!********************************************************************!*\ - !*** ../../graphiql-toolkit/esm/graphql-helpers/operation-name.js ***! - \********************************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.getSelectedOperationName = getSelectedOperationName; - function getSelectedOperationName(prevOperations, prevSelectedOperationName, operations) { - if (!operations || operations.length < 1) { - return; - } - const names = operations.map(op => { - var _a; - return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; - }); - if (prevSelectedOperationName && names.includes(prevSelectedOperationName)) { - return prevSelectedOperationName; - } - if (prevSelectedOperationName && prevOperations) { - const prevNames = prevOperations.map(op => { - var _a; - return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; - }); - const prevIndex = prevNames.indexOf(prevSelectedOperationName); - if (prevIndex !== -1 && prevIndex < names.length) { - return names[prevIndex]; - } - } - return names[0]; - } -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/index.js": -/*!*******************************************!*\ - !*** ../../graphiql-toolkit/esm/index.js ***! - \*******************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./async-helpers */ "../../graphiql-toolkit/esm/async-helpers/index.js"), __webpack_require__(/*! ./create-fetcher */ "../../graphiql-toolkit/esm/create-fetcher/index.js"), __webpack_require__(/*! ./format */ "../../graphiql-toolkit/esm/format/index.js"), __webpack_require__(/*! ./graphql-helpers */ "../../graphiql-toolkit/esm/graphql-helpers/index.js"), __webpack_require__(/*! ./storage */ "../../graphiql-toolkit/esm/storage/index.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _asyncHelpers, _createFetcher, _format, _graphqlHelpers, _storage) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - Object.keys(_asyncHelpers).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _asyncHelpers[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _asyncHelpers[key]; - } - }); - }); - Object.keys(_createFetcher).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _createFetcher[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _createFetcher[key]; - } - }); - }); - Object.keys(_format).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _format[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _format[key]; - } - }); - }); - Object.keys(_graphqlHelpers).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _graphqlHelpers[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _graphqlHelpers[key]; - } - }); - }); - Object.keys(_storage).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _storage[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _storage[key]; - } - }); - }); -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/storage/base.js": -/*!**************************************************!*\ - !*** ../../graphiql-toolkit/esm/storage/base.js ***! - \**************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.StorageAPI = void 0; - function isQuotaError(storage, e) { - return e instanceof DOMException && (e.code === 22 || e.code === 1014 || e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') && storage.length !== 0; - } - class StorageAPI { - constructor(storage) { - if (storage) { - this.storage = storage; - } else if (storage === null) { - this.storage = null; - } else if (typeof window === 'undefined') { - this.storage = null; - } else { - this.storage = { - getItem: window.localStorage.getItem.bind(window.localStorage), - setItem: window.localStorage.setItem.bind(window.localStorage), - removeItem: window.localStorage.removeItem.bind(window.localStorage), - get length() { - let keys = 0; - for (const key in window.localStorage) { - if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { - keys += 1; - } - } - return keys; - }, - clear: () => { - for (const key in window.localStorage) { - if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { - window.localStorage.removeItem(key); - } - } - } - }; - } - } - get(name) { - if (!this.storage) { - return null; - } - const key = `${STORAGE_NAMESPACE}:${name}`; - const value = this.storage.getItem(key); - if (value === 'null' || value === 'undefined') { - this.storage.removeItem(key); - return null; - } - return value || null; - } - set(name, value) { - let quotaError = false; - let error = null; - if (this.storage) { - const key = `${STORAGE_NAMESPACE}:${name}`; - if (value) { - try { - this.storage.setItem(key, value); - } catch (e) { - error = e instanceof Error ? e : new Error(`${e}`); - quotaError = isQuotaError(this.storage, e); - } - } else { - this.storage.removeItem(key); - } - } - return { - isQuotaError: quotaError, - error - }; - } - clear() { - if (this.storage) { - this.storage.clear(); - } - } - } - _exports.StorageAPI = StorageAPI; - const STORAGE_NAMESPACE = 'graphiql'; -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/storage/history.js": -/*!*****************************************************!*\ - !*** ../../graphiql-toolkit/esm/storage/history.js ***! - \*****************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _graphql, _query) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.HistoryStore = void 0; - const MAX_QUERY_SIZE = 100000; - class HistoryStore { - constructor(storage, maxHistoryLength) { - this.storage = storage; - this.maxHistoryLength = maxHistoryLength; - this.updateHistory = (query, variables, headers, operationName) => { - if (this.shouldSaveQuery(query, variables, headers, this.history.fetchRecent())) { - this.history.push({ - query, - variables, - headers, - operationName - }); - const historyQueries = this.history.items; - const favoriteQueries = this.favorite.items; - this.queries = historyQueries.concat(favoriteQueries); - } - }; - this.history = new _query.QueryStore('queries', this.storage, this.maxHistoryLength); - this.favorite = new _query.QueryStore('favorites', this.storage, null); - this.queries = [...this.history.fetchAll(), ...this.favorite.fetchAll()]; - } - shouldSaveQuery(query, variables, headers, lastQuerySaved) { - if (!query) { - return false; - } - try { - (0, _graphql.parse)(query); - } catch (_a) { - return false; - } - if (query.length > MAX_QUERY_SIZE) { - return false; - } - if (!lastQuerySaved) { - return true; - } - if (JSON.stringify(query) === JSON.stringify(lastQuerySaved.query)) { - if (JSON.stringify(variables) === JSON.stringify(lastQuerySaved.variables)) { - if (JSON.stringify(headers) === JSON.stringify(lastQuerySaved.headers)) { - return false; - } - if (headers && !lastQuerySaved.headers) { - return false; - } - } - if (variables && !lastQuerySaved.variables) { - return false; - } - } - return true; - } - toggleFavorite(query, variables, headers, operationName, label, favorite) { - const item = { - query, - variables, - headers, - operationName, - label - }; - if (!this.favorite.contains(item)) { - item.favorite = true; - this.favorite.push(item); - } else if (favorite) { - item.favorite = false; - this.favorite.delete(item); - } - this.queries = [...this.history.items, ...this.favorite.items]; - } - editLabel(query, variables, headers, operationName, label, favorite) { - const item = { - query, - variables, - headers, - operationName, - label - }; - if (favorite) { - this.favorite.edit(Object.assign(Object.assign({}, item), { - favorite - })); - } else { - this.history.edit(item); - } - this.queries = [...this.history.items, ...this.favorite.items]; - } - } - _exports.HistoryStore = HistoryStore; -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/storage/index.js": -/*!***************************************************!*\ - !*** ../../graphiql-toolkit/esm/storage/index.js ***! - \***************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! ./base */ "../../graphiql-toolkit/esm/storage/base.js"), __webpack_require__(/*! ./history */ "../../graphiql-toolkit/esm/storage/history.js"), __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _base, _history, _query) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - Object.keys(_base).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _base[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _base[key]; - } - }); - }); - Object.keys(_history).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _history[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _history[key]; - } - }); - }); - Object.keys(_query).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in _exports && _exports[key] === _query[key]) return; - Object.defineProperty(_exports, key, { - enumerable: true, - get: function () { - return _query[key]; - } - }); - }); -}); - -/***/ }), - -/***/ "../../graphiql-toolkit/esm/storage/query.js": -/*!***************************************************!*\ - !*** ../../graphiql-toolkit/esm/storage/query.js ***! - \***************************************************/ -/***/ (function(module, exports) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.QueryStore = void 0; - class QueryStore { - constructor(key, storage) { - let maxSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - this.key = key; - this.storage = storage; - this.maxSize = maxSize; - this.items = this.fetchAll(); - } - get length() { - return this.items.length; - } - contains(item) { - return this.items.some(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); - } - edit(item) { - const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); - if (itemIndex !== -1) { - this.items.splice(itemIndex, 1, item); - this.save(); - } - } - delete(item) { - const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); - if (itemIndex !== -1) { - this.items.splice(itemIndex, 1); - this.save(); - } - } - fetchRecent() { - return this.items[this.items.length - 1]; - } - fetchAll() { - const raw = this.storage.get(this.key); - if (raw) { - return JSON.parse(raw)[this.key]; - } - return []; - } - push(item) { - const items = [...this.items, item]; - if (this.maxSize && items.length > this.maxSize) { - items.shift(); - } - for (let attempts = 0; attempts < 5; attempts++) { - const response = this.storage.set(this.key, JSON.stringify({ - [this.key]: items - })); - if (!response || !response.error) { - this.items = items; - } else if (response.isQuotaError && this.maxSize) { - items.shift(); - } else { - return; - } - } - } - save() { - this.storage.set(this.key, JSON.stringify({ - [this.key]: this.items - })); - } - } - _exports.QueryStore = QueryStore; -}); - -/***/ }), - -/***/ "./cdn.ts": -/*!****************!*\ - !*** ./cdn.ts ***! - \****************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/graphiql-react.es.js"), __webpack_require__(/*! @graphiql/toolkit */ "../../graphiql-toolkit/esm/index.js"), __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"), __webpack_require__(/*! ./components/GraphiQL */ "./components/GraphiQL.tsx"), __webpack_require__(/*! @graphiql/react/font/roboto.css */ "../../graphiql-react/font/roboto.css"), __webpack_require__(/*! @graphiql/react/font/fira-code.css */ "../../graphiql-react/font/fira-code.css"), __webpack_require__(/*! @graphiql/react/dist/style.css */ "../../graphiql-react/dist/style.css"), __webpack_require__(/*! ./style.css */ "./style.css")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, GraphiQLReact, _toolkit, GraphQL, _GraphiQL, _roboto, _firaCode, _style, _style2) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.default = void 0; - GraphiQLReact = _interopRequireWildcard(GraphiQLReact); - GraphQL = _interopRequireWildcard(GraphQL); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /** - * Copyright (c) 2021 GraphQL Contributors. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - /** - * For the CDN bundle we add some static properties to the component function - * so that they can be accessed in the inline-script in the HTML file. - */ - - /** - * This function is needed in order to easily create a fetcher function. - */ - // @ts-expect-error - _GraphiQL.GraphiQL.createFetcher = _toolkit.createGraphiQLFetcher; - - /** - * We also add the complete `graphiql-js` exports so that this instance of - * `graphiql-js` can be reused from plugin CDN bundles. - */ - // @ts-expect-error - _GraphiQL.GraphiQL.GraphQL = GraphQL; - - /** - * We also add the complete `@graphiql/react` exports. These will be included - * in the bundle anyways since they make up the `GraphiQL` component, so by - * doing this we can reuse them from plugin CDN bundles. - */ - // @ts-expect-error - _GraphiQL.GraphiQL.React = GraphiQLReact; - var _default = _GraphiQL.GraphiQL; - _exports.default = _default; -}); - -/***/ }), - -/***/ "./components/GraphiQL.tsx": -/*!*********************************!*\ - !*** ./components/GraphiQL.tsx ***! - \*********************************/ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! react */ "react"), __webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/graphiql-react.es.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { var mod; } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _react2) { - "use strict"; - - Object.defineProperty(_exports, "__esModule", { - value: true - }); - _exports.GraphiQL = GraphiQL; - _exports.GraphiQLInterface = GraphiQLInterface; - _react = _interopRequireWildcard(_react); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); } - const majorVersion = parseInt(_react.default.version.slice(0, 2), 10); - if (majorVersion < 16) { - throw new Error(['GraphiQL 0.18.0 and after is not compatible with React 15 or below.', 'If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:', 'https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49'].join('\n')); - } - /** - * The top-level React component for GraphiQL, intended to encompass the entire - * browser viewport. - * - * @see https://github.com/graphql/graphiql#usage - */ - - function GraphiQL(_ref) { - let { - dangerouslyAssumeSchemaIsValid, - defaultQuery, - defaultTabs, - externalFragments, - fetcher, - getDefaultFieldNames, - headers, - initialTabs, - inputValueDeprecation, - introspectionQueryName, - maxHistoryLength, - onEditOperationName, - onSchemaChange, - onTabChange, - onTogglePluginVisibility, - operationName, - plugins, - query, - response, - schema, - schemaDescription, - shouldPersistHeaders, - storage, - validationRules, - variables, - visiblePlugin, - defaultHeaders, - ...props - } = _ref; - // Ensure props are correct - if (typeof fetcher !== 'function') { - throw new TypeError('The `GraphiQL` component requires a `fetcher` function to be passed as prop.'); - } - return /*#__PURE__*/_react.default.createElement(_react2.GraphiQLProvider, { - getDefaultFieldNames: getDefaultFieldNames, - dangerouslyAssumeSchemaIsValid: dangerouslyAssumeSchemaIsValid, - defaultQuery: defaultQuery, - defaultHeaders: defaultHeaders, - defaultTabs: defaultTabs, - externalFragments: externalFragments, - fetcher: fetcher, - headers: headers, - initialTabs: initialTabs, - inputValueDeprecation: inputValueDeprecation, - introspectionQueryName: introspectionQueryName, - maxHistoryLength: maxHistoryLength, - onEditOperationName: onEditOperationName, - onSchemaChange: onSchemaChange, - onTabChange: onTabChange, - onTogglePluginVisibility: onTogglePluginVisibility, - plugins: plugins, - visiblePlugin: visiblePlugin, - operationName: operationName, - query: query, - response: response, - schema: schema, - schemaDescription: schemaDescription, - shouldPersistHeaders: shouldPersistHeaders, - storage: storage, - validationRules: validationRules, - variables: variables - }, /*#__PURE__*/_react.default.createElement(GraphiQLInterface, _extends({ - showPersistHeadersSettings: shouldPersistHeaders !== false - }, props))); - } - // Export main windows/panes to be used separately if desired. - GraphiQL.Logo = GraphiQLLogo; - GraphiQL.Toolbar = GraphiQLToolbar; - GraphiQL.Footer = GraphiQLFooter; - function GraphiQLInterface(props) { - var _props$isHeadersEdito, _pluginContext$visibl, _props$toolbar; - const isHeadersEditorEnabled = (_props$isHeadersEdito = props.isHeadersEditorEnabled) !== null && _props$isHeadersEdito !== void 0 ? _props$isHeadersEdito : true; - const editorContext = (0, _react2.useEditorContext)({ - nonNull: true - }); - const executionContext = (0, _react2.useExecutionContext)({ - nonNull: true - }); - const schemaContext = (0, _react2.useSchemaContext)({ - nonNull: true - }); - const storageContext = (0, _react2.useStorageContext)(); - const pluginContext = (0, _react2.usePluginContext)(); - const copy = (0, _react2.useCopyQuery)({ - onCopyQuery: props.onCopyQuery - }); - const merge = (0, _react2.useMergeQuery)(); - const prettify = (0, _react2.usePrettifyEditors)(); - const { - theme, - setTheme - } = (0, _react2.useTheme)(); - const PluginContent = pluginContext === null || pluginContext === void 0 ? void 0 : (_pluginContext$visibl = pluginContext.visiblePlugin) === null || _pluginContext$visibl === void 0 ? void 0 : _pluginContext$visibl.content; - const pluginResize = (0, _react2.useDragResize)({ - defaultSizeRelation: 1 / 3, - direction: 'horizontal', - initiallyHidden: pluginContext !== null && pluginContext !== void 0 && pluginContext.visiblePlugin ? undefined : 'first', - onHiddenElementChange: resizableElement => { - if (resizableElement === 'first') { - pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.setVisiblePlugin(null); - } - }, - sizeThresholdSecond: 200, - storageKey: 'docExplorerFlex' - }); - const editorResize = (0, _react2.useDragResize)({ - direction: 'horizontal', - storageKey: 'editorFlex' - }); - const editorToolsResize = (0, _react2.useDragResize)({ - defaultSizeRelation: 3, - direction: 'vertical', - initiallyHidden: (() => { - if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { - return undefined; - } - if (typeof props.defaultEditorToolsVisibility === 'boolean') { - return props.defaultEditorToolsVisibility ? undefined : 'second'; - } - return editorContext.initialVariables || editorContext.initialHeaders ? undefined : 'second'; - })(), - sizeThresholdSecond: 60, - storageKey: 'secondaryEditorFlex' - }); - const [activeSecondaryEditor, setActiveSecondaryEditor] = (0, _react.useState)(() => { - if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { - return props.defaultEditorToolsVisibility; - } - return !editorContext.initialVariables && editorContext.initialHeaders && isHeadersEditorEnabled ? 'headers' : 'variables'; - }); - const [showDialog, setShowDialog] = (0, _react.useState)(null); - const [clearStorageStatus, setClearStorageStatus] = (0, _react.useState)(null); - const children = _react.default.Children.toArray(props.children); - const logo = children.find(child => isChildComponentType(child, GraphiQL.Logo)) || /*#__PURE__*/_react.default.createElement(GraphiQL.Logo, null); - const toolbar = children.find(child => isChildComponentType(child, GraphiQL.Toolbar)) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { - onClick: () => prettify(), - label: "Prettify query (Shift-Ctrl-P)" - }, /*#__PURE__*/_react.default.createElement(_react2.PrettifyIcon, { - className: "graphiql-toolbar-icon", - "aria-hidden": "true" - })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { - onClick: () => merge(), - label: "Merge fragments into query (Shift-Ctrl-M)" - }, /*#__PURE__*/_react.default.createElement(_react2.MergeIcon, { - className: "graphiql-toolbar-icon", - "aria-hidden": "true" - })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { - onClick: () => copy(), - label: "Copy query (Shift-Ctrl-C)" - }, /*#__PURE__*/_react.default.createElement(_react2.CopyIcon, { - className: "graphiql-toolbar-icon", - "aria-hidden": "true" - })), ((_props$toolbar = props.toolbar) === null || _props$toolbar === void 0 ? void 0 : _props$toolbar.additionalContent) || null); - const footer = children.find(child => isChildComponentType(child, GraphiQL.Footer)); - const onClickReference = () => { - if (pluginResize.hiddenElement === 'first') { - pluginResize.setHiddenElement(null); - } - }; - const modifier = window.navigator.platform.toLowerCase().indexOf('mac') === 0 ? /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Cmd") : /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Ctrl"); - return /*#__PURE__*/_react.default.createElement("div", { - "data-testid": "graphiql-container", - className: "graphiql-container" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-sidebar" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-sidebar-section" - }, pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.plugins.map(plugin => { - const isVisible = plugin === pluginContext.visiblePlugin; - const label = `${isVisible ? 'Hide' : 'Show'} ${plugin.title}`; - const Icon = plugin.icon; - return /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - key: plugin.title, - label: label - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - className: isVisible ? 'active' : '', - onClick: () => { - if (isVisible) { - pluginContext.setVisiblePlugin(null); - pluginResize.setHiddenElement('first'); - } else { - pluginContext.setVisiblePlugin(plugin); - pluginResize.setHiddenElement(null); - } - }, - "aria-label": label - }, /*#__PURE__*/_react.default.createElement(Icon, { - "aria-hidden": "true" - }))); - })), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-sidebar-section" - }, /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: "Re-fetch GraphQL schema" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - disabled: schemaContext.isFetching, - onClick: () => schemaContext.introspect(), - "aria-label": "Re-fetch GraphQL schema" - }, /*#__PURE__*/_react.default.createElement(_react2.ReloadIcon, { - className: schemaContext.isFetching ? 'graphiql-spin' : '', - "aria-hidden": "true" - }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: "Open short keys dialog" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - onClick: () => setShowDialog('short-keys'), - "aria-label": "Open short keys dialog" - }, /*#__PURE__*/_react.default.createElement(_react2.KeyboardShortcutIcon, { - "aria-hidden": "true" - }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: "Open settings dialog" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - onClick: () => setShowDialog('settings'), - "aria-label": "Open settings dialog" - }, /*#__PURE__*/_react.default.createElement(_react2.SettingsIcon, { - "aria-hidden": "true" - }))))), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-main" - }, /*#__PURE__*/_react.default.createElement("div", { - ref: pluginResize.firstRef, - style: { - // Make sure the container shrinks when containing long - // non-breaking texts - minWidth: '200px' - } - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-plugin" - }, PluginContent ? /*#__PURE__*/_react.default.createElement(PluginContent, null) : null)), /*#__PURE__*/_react.default.createElement("div", { - ref: pluginResize.dragBarRef - }, pluginContext !== null && pluginContext !== void 0 && pluginContext.visiblePlugin ? /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-horizontal-drag-bar" - }) : null), /*#__PURE__*/_react.default.createElement("div", { - ref: pluginResize.secondRef, - style: { - minWidth: 0 - } - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-sessions" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-session-header" - }, /*#__PURE__*/_react.default.createElement(_react2.Tabs, { - "aria-label": "Select active operation" - }, editorContext.tabs.length > 1 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, editorContext.tabs.map((tab, index) => /*#__PURE__*/_react.default.createElement(_react2.Tab, { - key: tab.id, - isActive: index === editorContext.activeTabIndex - }, /*#__PURE__*/_react.default.createElement(_react2.Tab.Button, { - "aria-controls": "graphiql-session", - id: `graphiql-session-tab-${index}`, - onClick: () => { - executionContext.stop(); - editorContext.changeTab(index); - } - }, tab.title), /*#__PURE__*/_react.default.createElement(_react2.Tab.Close, { - onClick: () => { - if (editorContext.activeTabIndex === index) { - executionContext.stop(); - } - editorContext.closeTab(index); - } - }))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: "Add tab" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - className: "graphiql-tab-add", - onClick: () => editorContext.addTab(), - "aria-label": "Add tab" - }, /*#__PURE__*/_react.default.createElement(_react2.PlusIcon, { - "aria-hidden": "true" - }))))) : null), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-session-header-right" - }, editorContext.tabs.length === 1 ? /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-add-tab-wrapper" - }, /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: "Add tab" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - className: "graphiql-tab-add", - onClick: () => editorContext.addTab(), - "aria-label": "Add tab" - }, /*#__PURE__*/_react.default.createElement(_react2.PlusIcon, { - "aria-hidden": "true" - })))) : null, logo)), /*#__PURE__*/_react.default.createElement("div", { - role: "tabpanel", - id: "graphiql-session", - className: "graphiql-session", - "aria-labelledby": `graphiql-session-tab-${editorContext.activeTabIndex}` - }, /*#__PURE__*/_react.default.createElement("div", { - ref: editorResize.firstRef - }, /*#__PURE__*/_react.default.createElement("div", { - className: `graphiql-editors${editorContext.tabs.length === 1 ? ' full-height' : ''}` - }, /*#__PURE__*/_react.default.createElement("div", { - ref: editorToolsResize.firstRef - }, /*#__PURE__*/_react.default.createElement("section", { - className: "graphiql-query-editor", - "aria-label": "Query Editor" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-query-editor-wrapper" - }, /*#__PURE__*/_react.default.createElement(_react2.QueryEditor, { - editorTheme: props.editorTheme, - keyMap: props.keyMap, - onClickReference: onClickReference, - onCopyQuery: props.onCopyQuery, - onEdit: props.onEditQuery, - readOnly: props.readOnly - })), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-toolbar", - role: "toolbar", - "aria-label": "Editor Commands" - }, /*#__PURE__*/_react.default.createElement(_react2.ExecuteButton, null), toolbar))), /*#__PURE__*/_react.default.createElement("div", { - ref: editorToolsResize.dragBarRef - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-editor-tools" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-editor-tools-tabs" - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - className: activeSecondaryEditor === 'variables' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', - onClick: () => { - if (editorToolsResize.hiddenElement === 'second') { - editorToolsResize.setHiddenElement(null); - } - setActiveSecondaryEditor('variables'); - } - }, "Variables"), isHeadersEditorEnabled ? /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - className: activeSecondaryEditor === 'headers' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', - onClick: () => { - if (editorToolsResize.hiddenElement === 'second') { - editorToolsResize.setHiddenElement(null); - } - setActiveSecondaryEditor('headers'); - } - }, "Headers") : null), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { - label: editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools' - }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { - type: "button", - onClick: () => { - editorToolsResize.setHiddenElement(editorToolsResize.hiddenElement === 'second' ? null : 'second'); - }, - "aria-label": editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools' - }, editorToolsResize.hiddenElement === 'second' ? /*#__PURE__*/_react.default.createElement(_react2.ChevronUpIcon, { - className: "graphiql-chevron-icon", - "aria-hidden": "true" - }) : /*#__PURE__*/_react.default.createElement(_react2.ChevronDownIcon, { - className: "graphiql-chevron-icon", - "aria-hidden": "true" - }))))), /*#__PURE__*/_react.default.createElement("div", { - ref: editorToolsResize.secondRef - }, /*#__PURE__*/_react.default.createElement("section", { - className: "graphiql-editor-tool", - "aria-label": activeSecondaryEditor === 'variables' ? 'Variables' : 'Headers' - }, /*#__PURE__*/_react.default.createElement(_react2.VariableEditor, { - editorTheme: props.editorTheme, - isHidden: activeSecondaryEditor !== 'variables', - keyMap: props.keyMap, - onEdit: props.onEditVariables, - onClickReference: onClickReference, - readOnly: props.readOnly - }), isHeadersEditorEnabled && /*#__PURE__*/_react.default.createElement(_react2.HeaderEditor, { - editorTheme: props.editorTheme, - isHidden: activeSecondaryEditor !== 'headers', - keyMap: props.keyMap, - onEdit: props.onEditHeaders, - readOnly: props.readOnly - }))))), /*#__PURE__*/_react.default.createElement("div", { - ref: editorResize.dragBarRef - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-horizontal-drag-bar" - })), /*#__PURE__*/_react.default.createElement("div", { - ref: editorResize.secondRef - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-response" - }, executionContext.isFetching ? /*#__PURE__*/_react.default.createElement(_react2.Spinner, null) : null, /*#__PURE__*/_react.default.createElement(_react2.ResponseEditor, { - editorTheme: props.editorTheme, - responseTooltip: props.responseTooltip, - keyMap: props.keyMap - }), footer)))))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { - isOpen: showDialog === 'short-keys', - onDismiss: () => setShowDialog(null) - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-header" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-title" - }, "Short Keys"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, { - onClick: () => setShowDialog(null) - })), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section" - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("table", { - className: "graphiql-table" - }, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, "Short key"), /*#__PURE__*/_react.default.createElement("th", null, "Function"))), /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, modifier, ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "F")), /*#__PURE__*/_react.default.createElement("td", null, "Search in editor")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, modifier, ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "K")), /*#__PURE__*/_react.default.createElement("td", null, "Search in documentation")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, modifier, ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Enter")), /*#__PURE__*/_react.default.createElement("td", null, "Execute query")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Ctrl"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Shift"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "P")), /*#__PURE__*/_react.default.createElement("td", null, "Prettify editors")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Ctrl"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Shift"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "M")), /*#__PURE__*/_react.default.createElement("td", null, "Merge fragments definitions into operation definition")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Ctrl"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Shift"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "C")), /*#__PURE__*/_react.default.createElement("td", null, "Copy query")), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Ctrl"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "Shift"), ' + ', /*#__PURE__*/_react.default.createElement("code", { - className: "graphiql-key" - }, "R")), /*#__PURE__*/_react.default.createElement("td", null, "Re-fetch schema using introspection")))), /*#__PURE__*/_react.default.createElement("p", null, "The editors use", ' ', /*#__PURE__*/_react.default.createElement("a", { - href: "https://codemirror.net/5/doc/manual.html#keymaps", - target: "_blank", - rel: "noopener noreferrer" - }, "CodeMirror Key Maps"), ' ', "that add more short keys. This instance of Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL uses", ' ', /*#__PURE__*/_react.default.createElement("code", null, props.keyMap || 'sublime'), ".")))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { - isOpen: showDialog === 'settings', - onDismiss: () => { - setShowDialog(null); - setClearStorageStatus(null); - } - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-header" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-title" - }, "Settings"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, { - onClick: () => { - setShowDialog(null); - setClearStorageStatus(null); - } - })), props.showPersistHeadersSettings ? /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section" - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-title" - }, "Persist headers"), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-caption" - }, "Save headers upon reloading.", ' ', /*#__PURE__*/_react.default.createElement("span", { - className: "graphiql-warning-text" - }, "Only enable if you trust this device."))), /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - id: "enable-persist-headers", - className: editorContext.shouldPersistHeaders ? 'active' : undefined, - onClick: () => { - editorContext.setShouldPersistHeaders(true); - } - }, "On"), /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - id: "disable-persist-headers", - className: editorContext.shouldPersistHeaders ? undefined : 'active', - onClick: () => { - editorContext.setShouldPersistHeaders(false); - } - }, "Off"))) : null, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section" - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-title" - }, "Theme"), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-caption" - }, "Adjust how the interface looks like.")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - className: theme === null ? 'active' : '', - onClick: () => setTheme(null) - }, "System"), /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - className: theme === 'light' ? 'active' : '', - onClick: () => setTheme('light') - }, "Light"), /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - className: theme === 'dark' ? 'active' : '', - onClick: () => setTheme('dark') - }, "Dark")))), storageContext ? /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section" - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-title" - }, "Clear storage"), /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-dialog-section-caption" - }, "Remove all locally stored data and start fresh.")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_react2.Button, { - type: "button", - state: clearStorageStatus || undefined, - disabled: clearStorageStatus === 'success', - onClick: () => { - try { - storageContext === null || storageContext === void 0 ? void 0 : storageContext.clear(); - setClearStorageStatus('success'); - } catch { - setClearStorageStatus('error'); - } - } - }, clearStorageStatus === 'success' ? 'Cleared data' : clearStorageStatus === 'error' ? 'Failed' : 'Clear data'))) : null)); - } - - // Configure the UI by providing this Component as a child of GraphiQL. - function GraphiQLLogo(props) { - return /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-logo" - }, props.children || /*#__PURE__*/_react.default.createElement("a", { - className: "graphiql-logo-link", - href: "https://github.com/graphql/graphiql", - target: "_blank", - rel: "noreferrer" - }, "Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL")); - } - GraphiQLLogo.displayName = 'GraphiQLLogo'; - - // Configure the UI by providing this Component as a child of GraphiQL. - function GraphiQLToolbar(props) { - // eslint-disable-next-line react/jsx-no-useless-fragment - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children); - } - GraphiQLToolbar.displayName = 'GraphiQLToolbar'; - - // Configure the UI by providing this Component as a child of GraphiQL. - function GraphiQLFooter(props) { - return /*#__PURE__*/_react.default.createElement("div", { - className: "graphiql-footer" - }, props.children); - } - GraphiQLFooter.displayName = 'GraphiQLFooter'; - - // Determines if the React child is of the same type of the provided React component - function isChildComponentType(child, component) { - var _child$type; - if (child !== null && child !== void 0 && (_child$type = child.type) !== null && _child$type !== void 0 && _child$type.displayName && child.type.displayName === component.displayName) { - return true; - } - return child.type === component; - } -}); - -/***/ }), - -/***/ "../../../node_modules/graphql-ws/lib/client.mjs": -/*!*******************************************************!*\ - !*** ../../../node_modules/graphql-ws/lib/client.mjs ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "CloseCode": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode; }, -/* harmony export */ "GRAPHQL_TRANSPORT_WS_PROTOCOL": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.GRAPHQL_TRANSPORT_WS_PROTOCOL; }, -/* harmony export */ "MessageType": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType; }, -/* harmony export */ "createClient": function() { return /* binding */ createClient; }, -/* harmony export */ "isMessage": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.isMessage; }, -/* harmony export */ "parseMessage": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.parseMessage; }, -/* harmony export */ "stringifyMessage": function() { return /* reexport safe */ _common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage; } -/* harmony export */ }); -/* harmony import */ var _common_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.mjs */ "../../../node_modules/graphql-ws/lib/common.mjs"); -/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); -/** - * - * client - * - */ - - -/** This file is the entry point for browsers, re-export common elements. */ - -/** - * Creates a disposable GraphQL over WebSocket client. - * - * @category Client - */ -function createClient(options) { - const { url, connectionParams, lazy = true, onNonLazyError = console.error, lazyCloseTimeout = 0, keepAlive = 0, disablePong, connectionAckWaitTimeout = 0, retryAttempts = 5, retryWait = async function randomisedExponentialBackoff(retries) { - let retryDelay = 1000; // start with 1s delay - for (let i = 0; i < retries; i++) { - retryDelay *= 2; - } - await new Promise((resolve) => setTimeout(resolve, retryDelay + - // add random timeout from 300ms to 3s - Math.floor(Math.random() * (3000 - 300) + 300))); - }, isFatalConnectionProblem = (errOrCloseEvent) => - // non `CloseEvent`s are fatal by default - !isLikeCloseEvent(errOrCloseEvent), on, webSocketImpl, - /** - * Generates a v4 UUID to be used as the ID using `Math` - * as the random number generator. Supply your own generator - * in case you need more uniqueness. - * - * Reference: https://gist.github.com/jed/982883 - */ - generateID = function generateUUID() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { - const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); - }, jsonMessageReplacer: replacer, jsonMessageReviver: reviver, } = options; - let ws; - if (webSocketImpl) { - if (!isWebSocket(webSocketImpl)) { - throw new Error('Invalid WebSocket implementation provided'); - } - ws = webSocketImpl; - } - else if (typeof WebSocket !== 'undefined') { - ws = WebSocket; - } - else if (typeof __webpack_require__.g !== 'undefined') { - ws = - __webpack_require__.g.WebSocket || - // @ts-expect-error: Support more browsers - __webpack_require__.g.MozWebSocket; - } - else if (typeof window !== 'undefined') { - ws = - window.WebSocket || - // @ts-expect-error: Support more browsers - window.MozWebSocket; - } - if (!ws) - throw new Error('WebSocket implementation missing'); - const WebSocketImpl = ws; - // websocket status emitter, subscriptions are handled differently - const emitter = (() => { - const message = (() => { - const listeners = {}; - return { - on(id, listener) { - listeners[id] = listener; - return () => { - delete listeners[id]; - }; - }, - emit(message) { - var _a; - if ('id' in message) - (_a = listeners[message.id]) === null || _a === void 0 ? void 0 : _a.call(listeners, message); - }, - }; - })(); - const listeners = { - connecting: (on === null || on === void 0 ? void 0 : on.connecting) ? [on.connecting] : [], - opened: (on === null || on === void 0 ? void 0 : on.opened) ? [on.opened] : [], - connected: (on === null || on === void 0 ? void 0 : on.connected) ? [on.connected] : [], - ping: (on === null || on === void 0 ? void 0 : on.ping) ? [on.ping] : [], - pong: (on === null || on === void 0 ? void 0 : on.pong) ? [on.pong] : [], - message: (on === null || on === void 0 ? void 0 : on.message) ? [message.emit, on.message] : [message.emit], - closed: (on === null || on === void 0 ? void 0 : on.closed) ? [on.closed] : [], - error: (on === null || on === void 0 ? void 0 : on.error) ? [on.error] : [], - }; - return { - onMessage: message.on, - on(event, listener) { - const l = listeners[event]; - l.push(listener); - return () => { - l.splice(l.indexOf(listener), 1); - }; - }, - emit(event, ...args) { - // we copy the listeners so that unlistens dont "pull the rug under our feet" - for (const listener of [...listeners[event]]) { - // @ts-expect-error: The args should fit - listener(...args); - } - }, - }; - })(); - // invokes the callback either when an error or closed event is emitted, - // first one that gets called prevails, other emissions are ignored - function errorOrClosed(cb) { - const listening = [ - // errors are fatal and more critical than close events, throw them first - emitter.on('error', (err) => { - listening.forEach((unlisten) => unlisten()); - cb(err); - }), - // closes can be graceful and not fatal, throw them second (if error didnt throw) - emitter.on('closed', (event) => { - listening.forEach((unlisten) => unlisten()); - cb(event); - }), - ]; - } - let connecting, locks = 0, retrying = false, retries = 0, disposed = false; - async function connect() { - const [socket, throwOnClose] = await (connecting !== null && connecting !== void 0 ? connecting : (connecting = new Promise((connected, denied) => (async () => { - if (retrying) { - await retryWait(retries); - // subscriptions might complete while waiting for retry - if (!locks) { - connecting = undefined; - return denied({ code: 1000, reason: 'All Subscriptions Gone' }); - } - retries++; - } - emitter.emit('connecting'); - const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, _common_mjs__WEBPACK_IMPORTED_MODULE_0__.GRAPHQL_TRANSPORT_WS_PROTOCOL); - let connectionAckTimeout, queuedPing; - function enqueuePing() { - if (isFinite(keepAlive) && keepAlive > 0) { - clearTimeout(queuedPing); // in case where a pong was received before a ping (this is valid behaviour) - queuedPing = setTimeout(() => { - if (socket.readyState === WebSocketImpl.OPEN) { - socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)({ type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Ping })); - emitter.emit('ping', false, undefined); - } - }, keepAlive); - } - } - errorOrClosed((errOrEvent) => { - connecting = undefined; - clearTimeout(connectionAckTimeout); - clearTimeout(queuedPing); - denied(errOrEvent); - }); - socket.onerror = (err) => emitter.emit('error', err); - socket.onclose = (event) => emitter.emit('closed', event); - socket.onopen = async () => { - try { - emitter.emit('opened', socket); - const payload = typeof connectionParams === 'function' - ? await connectionParams() - : connectionParams; - socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(payload - ? { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionInit, - payload, - } - : { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionInit, - // payload is completely absent if not provided - }, replacer)); - if (isFinite(connectionAckWaitTimeout) && - connectionAckWaitTimeout > 0) { - connectionAckTimeout = setTimeout(() => { - socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.ConnectionAcknowledgementTimeout, 'Connection acknowledgement timeout'); - }, connectionAckWaitTimeout); - } - enqueuePing(); // enqueue ping (noop if disabled) - } - catch (err) { - emitter.emit('error', err); - socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.InternalClientError, (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Internal client error')); - } - }; - let acknowledged = false; - socket.onmessage = ({ data }) => { - try { - const message = (0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.parseMessage)(data, reviver); - emitter.emit('message', message); - if (message.type === 'ping' || message.type === 'pong') { - emitter.emit(message.type, true, message.payload); // received - if (message.type === 'pong') { - enqueuePing(); // enqueue next ping (noop if disabled) - } - else if (!disablePong) { - // respond with pong on ping - socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(message.payload - ? { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Pong, - payload: message.payload, - } - : { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Pong, - // payload is completely absent if not provided - })); - emitter.emit('pong', false, message.payload); - } - return; // ping and pongs can be received whenever - } - if (acknowledged) - return; // already connected and acknowledged - if (message.type !== _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionAck) - throw new Error(`First message cannot be of type ${message.type}`); - clearTimeout(connectionAckTimeout); - acknowledged = true; - emitter.emit('connected', socket, message.payload); // connected = socket opened + acknowledged - retrying = false; // future lazy connects are not retries - retries = 0; // reset the retries on connect - connected([ - socket, - new Promise((_, reject) => errorOrClosed(reject)), - ]); - } - catch (err) { - socket.onmessage = null; // stop reading messages as soon as reading breaks once - emitter.emit('error', err); - socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.BadResponse, (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Bad response')); - } - }; - })()))); - // if the provided socket is in a closing state, wait for the throw on close - if (socket.readyState === WebSocketImpl.CLOSING) - await throwOnClose; - let release = () => { - // releases this connection - }; - const released = new Promise((resolve) => (release = resolve)); - return [ - socket, - release, - Promise.race([ - // wait for - released.then(() => { - if (!locks) { - // and if no more locks are present, complete the connection - const complete = () => socket.close(1000, 'Normal Closure'); - if (isFinite(lazyCloseTimeout) && lazyCloseTimeout > 0) { - // if the keepalive is set, allow for the specified calmdown time and - // then complete. but only if no lock got created in the meantime and - // if the socket is still open - setTimeout(() => { - if (!locks && socket.readyState === WebSocketImpl.OPEN) - complete(); - }, lazyCloseTimeout); - } - else { - // otherwise complete immediately - complete(); - } - } - }), - // or - throwOnClose, - ]), - ]; - } - /** - * Checks the `connect` problem and evaluates if the client should retry. - */ - function shouldRetryConnectOrThrow(errOrCloseEvent) { - // some close codes are worth reporting immediately - if (isLikeCloseEvent(errOrCloseEvent) && - (isFatalInternalCloseCode(errOrCloseEvent.code) || - [ - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.InternalServerError, - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.InternalClientError, - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.BadRequest, - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.BadResponse, - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.Unauthorized, - // CloseCode.Forbidden, might grant access out after retry - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.SubprotocolNotAcceptable, - // CloseCode.ConnectionInitialisationTimeout, might not time out after retry - // CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.SubscriberAlreadyExists, - _common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.TooManyInitialisationRequests, - ].includes(errOrCloseEvent.code))) - throw errOrCloseEvent; - // client was disposed, no retries should proceed regardless - if (disposed) - return false; - // normal closure (possibly all subscriptions have completed) - // if no locks were acquired in the meantime, shouldnt try again - if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000) - return locks > 0; - // retries are not allowed or we tried to many times, report error - if (!retryAttempts || retries >= retryAttempts) - throw errOrCloseEvent; - // throw fatal connection problems immediately - if (isFatalConnectionProblem(errOrCloseEvent)) - throw errOrCloseEvent; - // looks good, start retrying - return (retrying = true); - } - // in non-lazy (hot?) mode always hold one connection lock to persist the socket - if (!lazy) { - (async () => { - locks++; - for (;;) { - try { - const [, , throwOnClose] = await connect(); - await throwOnClose; // will always throw because releaser is not used - } - catch (errOrCloseEvent) { - try { - if (!shouldRetryConnectOrThrow(errOrCloseEvent)) - return; - } - catch (errOrCloseEvent) { - // report thrown error, no further retries - return onNonLazyError === null || onNonLazyError === void 0 ? void 0 : onNonLazyError(errOrCloseEvent); - } - } - } - })(); - } - return { - on: emitter.on, - subscribe(payload, sink) { - const id = generateID(); - let done = false, errored = false, releaser = () => { - // for handling completions before connect - locks--; - done = true; - }; - (async () => { - locks++; - for (;;) { - try { - const [socket, release, waitForReleaseOrThrowOnClose] = await connect(); - // if done while waiting for connect, release the connection lock right away - if (done) - return release(); - const unlisten = emitter.onMessage(id, (message) => { - switch (message.type) { - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Next: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sink.next(message.payload); - return; - } - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Error: { - (errored = true), (done = true); - sink.error(message.payload); - releaser(); - return; - } - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Complete: { - done = true; - releaser(); // release completes the sink - return; - } - } - }); - socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)({ - id, - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Subscribe, - payload, - }, replacer)); - releaser = () => { - if (!done && socket.readyState === WebSocketImpl.OPEN) - // if not completed already and socket is open, send complete message to server on release - socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)({ - id, - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Complete, - }, replacer)); - locks--; - done = true; - release(); - }; - // either the releaser will be called, connection completed and - // the promise resolved or the socket closed and the promise rejected. - // whatever happens though, we want to stop listening for messages - await waitForReleaseOrThrowOnClose.finally(unlisten); - return; // completed, shouldnt try again - } - catch (errOrCloseEvent) { - if (!shouldRetryConnectOrThrow(errOrCloseEvent)) - return; - } - } - })() - .then(() => { - // delivering either an error or a complete terminates the sequence - if (!errored) - sink.complete(); - }) // resolves on release or normal closure - .catch((err) => { - sink.error(err); - }); // rejects on close events and errors - return () => { - // dispose only of active subscriptions - if (!done) - releaser(); - }; - }, - async dispose() { - disposed = true; - if (connecting) { - // if there is a connection, close it - const [socket] = await connecting; - socket.close(1000, 'Normal Closure'); - } - }, - }; -} -function isLikeCloseEvent(val) { - return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isObject)(val) && 'code' in val && 'reason' in val; -} -function isFatalInternalCloseCode(code) { - if ([ - 1000, - 1001, - 1006, - 1005, - 1012, - 1013, - 1013, // Bad Gateway - ].includes(code)) - return false; - // all other internal errors are fatal - return code >= 1000 && code <= 1999; -} -function isWebSocket(val) { - return (typeof val === 'function' && - 'constructor' in val && - 'CLOSED' in val && - 'CLOSING' in val && - 'CONNECTING' in val && - 'OPEN' in val); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql-ws/lib/common.mjs": -/*!*******************************************************!*\ - !*** ../../../node_modules/graphql-ws/lib/common.mjs ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "CloseCode": function() { return /* binding */ CloseCode; }, -/* harmony export */ "GRAPHQL_TRANSPORT_WS_PROTOCOL": function() { return /* binding */ GRAPHQL_TRANSPORT_WS_PROTOCOL; }, -/* harmony export */ "MessageType": function() { return /* binding */ MessageType; }, -/* harmony export */ "isMessage": function() { return /* binding */ isMessage; }, -/* harmony export */ "parseMessage": function() { return /* binding */ parseMessage; }, -/* harmony export */ "stringifyMessage": function() { return /* binding */ stringifyMessage; } -/* harmony export */ }); -/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); -/** - * - * common - * - */ - -/** - * The WebSocket sub-protocol used for the [GraphQL over WebSocket Protocol](/PROTOCOL.md). - * - * @category Common - */ -const GRAPHQL_TRANSPORT_WS_PROTOCOL = 'graphql-transport-ws'; -/** - * `graphql-ws` expected and standard close codes of the [GraphQL over WebSocket Protocol](/PROTOCOL.md). - * - * @category Common - */ -var CloseCode; -(function (CloseCode) { - CloseCode[CloseCode["InternalServerError"] = 4500] = "InternalServerError"; - CloseCode[CloseCode["InternalClientError"] = 4005] = "InternalClientError"; - CloseCode[CloseCode["BadRequest"] = 4400] = "BadRequest"; - CloseCode[CloseCode["BadResponse"] = 4004] = "BadResponse"; - /** Tried subscribing before connect ack */ - CloseCode[CloseCode["Unauthorized"] = 4401] = "Unauthorized"; - CloseCode[CloseCode["Forbidden"] = 4403] = "Forbidden"; - CloseCode[CloseCode["SubprotocolNotAcceptable"] = 4406] = "SubprotocolNotAcceptable"; - CloseCode[CloseCode["ConnectionInitialisationTimeout"] = 4408] = "ConnectionInitialisationTimeout"; - CloseCode[CloseCode["ConnectionAcknowledgementTimeout"] = 4504] = "ConnectionAcknowledgementTimeout"; - /** Subscriber distinction is very important */ - CloseCode[CloseCode["SubscriberAlreadyExists"] = 4409] = "SubscriberAlreadyExists"; - CloseCode[CloseCode["TooManyInitialisationRequests"] = 4429] = "TooManyInitialisationRequests"; -})(CloseCode || (CloseCode = {})); -/** - * Types of messages allowed to be sent by the client/server over the WS protocol. - * - * @category Common - */ -var MessageType; -(function (MessageType) { - MessageType["ConnectionInit"] = "connection_init"; - MessageType["ConnectionAck"] = "connection_ack"; - MessageType["Ping"] = "ping"; - MessageType["Pong"] = "pong"; - MessageType["Subscribe"] = "subscribe"; - MessageType["Next"] = "next"; - MessageType["Error"] = "error"; - MessageType["Complete"] = "complete"; -})(MessageType || (MessageType = {})); -/** - * Checks if the provided value is a message. - * - * @category Common - */ -function isMessage(val) { - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.isObject)(val)) { - // all messages must have the `type` prop - if (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val, 'type')) { - return false; - } - // validate other properties depending on the `type` - switch (val.type) { - case MessageType.ConnectionInit: - // the connection init message can have optional payload object - return (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(val, 'payload') || - val.payload === undefined || - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.isObject)(val.payload)); - case MessageType.ConnectionAck: - case MessageType.Ping: - case MessageType.Pong: - // the connection ack, ping and pong messages can have optional payload object too - return (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(val, 'payload') || - val.payload === undefined || - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.isObject)(val.payload)); - case MessageType.Subscribe: - return ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val, 'id') && - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnObjectProperty)(val, 'payload') && - (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(val.payload, 'operationName') || - val.payload.operationName === undefined || - val.payload.operationName === null || - typeof val.payload.operationName === 'string') && - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val.payload, 'query') && - (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(val.payload, 'variables') || - val.payload.variables === undefined || - val.payload.variables === null || - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnObjectProperty)(val.payload, 'variables')) && - (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(val.payload, 'extensions') || - val.payload.extensions === undefined || - val.payload.extensions === null || - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnObjectProperty)(val.payload, 'extensions'))); - case MessageType.Next: - return ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val, 'id') && - (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnObjectProperty)(val, 'payload')); - case MessageType.Error: - return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val, 'id') && (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.areGraphQLErrors)(val.payload); - case MessageType.Complete: - return (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnStringProperty)(val, 'id'); - default: - return false; - } - } - return false; -} -/** - * Parses the raw websocket message data to a valid message. - * - * @category Common - */ -function parseMessage(data, reviver) { - if (isMessage(data)) { - return data; - } - if (typeof data !== 'string') { - throw new Error('Message not parsable'); - } - const message = JSON.parse(data, reviver); - if (!isMessage(message)) { - throw new Error('Invalid message'); - } - return message; -} -/** - * Stringifies a valid message ready to be sent through the socket. - * - * @category Common - */ -function stringifyMessage(msg, replacer) { - if (!isMessage(msg)) { - throw new Error('Cannot stringify invalid message'); - } - return JSON.stringify(msg, replacer); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql-ws/lib/server.mjs": -/*!*******************************************************!*\ - !*** ../../../node_modules/graphql-ws/lib/server.mjs ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "makeServer": function() { return /* binding */ makeServer; } -/* harmony export */ }); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/validation/validate.mjs"); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/utilities/getOperationAST.mjs"); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/execution/subscribe.mjs"); -/* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/execution/execute.mjs"); -/* harmony import */ var _common_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.mjs */ "../../../node_modules/graphql-ws/lib/common.mjs"); -/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "../../../node_modules/graphql-ws/lib/utils.mjs"); -/** - * - * server - * - */ -var __asyncValues = (undefined && undefined.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; - - - -/** - * Makes a Protocol complient WebSocket GraphQL server. The server - * is actually an API which is to be used with your favourite WebSocket - * server library! - * - * Read more about the Protocol in the PROTOCOL.md documentation file. - * - * @category Server - */ -function makeServer(options) { - const { schema, context, roots, validate, execute, subscribe, connectionInitWaitTimeout = 3000, // 3 seconds - onConnect, onDisconnect, onClose, onSubscribe, onOperation, onNext, onError, onComplete, jsonMessageReviver: reviver, jsonMessageReplacer: replacer, } = options; - return { - opened(socket, extra) { - const ctx = { - connectionInitReceived: false, - acknowledged: false, - subscriptions: {}, - extra, - }; - if (socket.protocol !== _common_mjs__WEBPACK_IMPORTED_MODULE_0__.GRAPHQL_TRANSPORT_WS_PROTOCOL) { - socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.SubprotocolNotAcceptable, 'Subprotocol not acceptable'); - return async (code, reason) => { - /* nothing was set up, just notify the closure */ - await (onClose === null || onClose === void 0 ? void 0 : onClose(ctx, code, reason)); - }; - } - // kick the client off (close socket) if the connection has - // not been initialised after the specified wait timeout - const connectionInitWait = connectionInitWaitTimeout > 0 && isFinite(connectionInitWaitTimeout) - ? setTimeout(() => { - if (!ctx.connectionInitReceived) - socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.ConnectionInitialisationTimeout, 'Connection initialisation timeout'); - }, connectionInitWaitTimeout) - : null; - socket.onMessage(async function onMessage(data) { - var e_1, _a; - var _b; - let message; - try { - message = (0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.parseMessage)(data, reviver); - } - catch (err) { - return socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.BadRequest, 'Invalid message received'); - } - switch (message.type) { - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionInit: { - if (ctx.connectionInitReceived) - return socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.TooManyInitialisationRequests, 'Too many initialisation requests'); - // @ts-expect-error: I can write - ctx.connectionInitReceived = true; - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isObject)(message.payload)) - // @ts-expect-error: I can write - ctx.connectionParams = message.payload; - const permittedOrPayload = await (onConnect === null || onConnect === void 0 ? void 0 : onConnect(ctx)); - if (permittedOrPayload === false) - return socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.Forbidden, 'Forbidden'); - await socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isObject)(permittedOrPayload) - ? { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionAck, - payload: permittedOrPayload, - } - : { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.ConnectionAck, - // payload is completely absent if not provided - }, replacer)); - // @ts-expect-error: I can write - ctx.acknowledged = true; - return; - } - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Ping: { - if (socket.onPing) - // if the onPing listener is registered, automatic pong is disabled - return await socket.onPing(message.payload); - await socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(message.payload - ? { type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Pong, payload: message.payload } - : { - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Pong, - // payload is completely absent if not provided - })); - return; - } - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Pong: - return await ((_b = socket.onPong) === null || _b === void 0 ? void 0 : _b.call(socket, message.payload)); - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Subscribe: { - if (!ctx.acknowledged) - return socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.Unauthorized, 'Unauthorized'); - const { id, payload } = message; - if (id in ctx.subscriptions) - return socket.close(_common_mjs__WEBPACK_IMPORTED_MODULE_0__.CloseCode.SubscriberAlreadyExists, `Subscriber for ${id} already exists`); - // if this turns out to be a streaming operation, the subscription value - // will change to an `AsyncIterable`, otherwise it will stay as is - ctx.subscriptions[id] = null; - const emit = { - next: async (result, args) => { - let nextMessage = { - id, - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Next, - payload: result, - }; - const maybeResult = await (onNext === null || onNext === void 0 ? void 0 : onNext(ctx, nextMessage, args, result)); - if (maybeResult) - nextMessage = Object.assign(Object.assign({}, nextMessage), { payload: maybeResult }); - await socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(nextMessage, replacer)); - }, - error: async (errors) => { - let errorMessage = { - id, - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Error, - payload: errors, - }; - const maybeErrors = await (onError === null || onError === void 0 ? void 0 : onError(ctx, errorMessage, errors)); - if (maybeErrors) - errorMessage = Object.assign(Object.assign({}, errorMessage), { payload: maybeErrors }); - await socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(errorMessage, replacer)); - }, - complete: async (notifyClient) => { - const completeMessage = { - id, - type: _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Complete, - }; - await (onComplete === null || onComplete === void 0 ? void 0 : onComplete(ctx, completeMessage)); - if (notifyClient) - await socket.send((0,_common_mjs__WEBPACK_IMPORTED_MODULE_0__.stringifyMessage)(completeMessage, replacer)); - }, - }; - let execArgs; - const maybeExecArgsOrErrors = await (onSubscribe === null || onSubscribe === void 0 ? void 0 : onSubscribe(ctx, message)); - if (maybeExecArgsOrErrors) { - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.areGraphQLErrors)(maybeExecArgsOrErrors)) - return await emit.error(maybeExecArgsOrErrors); - else if (Array.isArray(maybeExecArgsOrErrors)) - throw new Error('Invalid return value from onSubscribe hook, expected an array of GraphQLError objects'); - // not errors, is exec args - execArgs = maybeExecArgsOrErrors; - } - else { - // you either provide a schema dynamically through - // `onSubscribe` or you set one up during the server setup - if (!schema) - throw new Error('The GraphQL schema is not provided'); - const args = { - operationName: payload.operationName, - document: (0,graphql__WEBPACK_IMPORTED_MODULE_2__.parse)(payload.query), - variableValues: payload.variables, - }; - execArgs = Object.assign(Object.assign({}, args), { schema: typeof schema === 'function' - ? await schema(ctx, message, args) - : schema }); - const validationErrors = (validate !== null && validate !== void 0 ? validate : graphql__WEBPACK_IMPORTED_MODULE_3__.validate)(execArgs.schema, execArgs.document); - if (validationErrors.length > 0) - return await emit.error(validationErrors); - } - const operationAST = (0,graphql__WEBPACK_IMPORTED_MODULE_4__.getOperationAST)(execArgs.document, execArgs.operationName); - if (!operationAST) - return await emit.error([ - new graphql__WEBPACK_IMPORTED_MODULE_5__.GraphQLError('Unable to identify operation'), - ]); - // if `onSubscribe` didnt specify a rootValue, inject one - if (!('rootValue' in execArgs)) - execArgs.rootValue = roots === null || roots === void 0 ? void 0 : roots[operationAST.operation]; - // if `onSubscribe` didn't specify a context, inject one - if (!('contextValue' in execArgs)) - execArgs.contextValue = - typeof context === 'function' - ? await context(ctx, message, execArgs) - : context; - // the execution arguments have been prepared - // perform the operation and act accordingly - let operationResult; - if (operationAST.operation === 'subscription') - operationResult = await (subscribe !== null && subscribe !== void 0 ? subscribe : graphql__WEBPACK_IMPORTED_MODULE_6__.subscribe)(execArgs); - // operation === 'query' || 'mutation' - else - operationResult = await (execute !== null && execute !== void 0 ? execute : graphql__WEBPACK_IMPORTED_MODULE_7__.execute)(execArgs); - const maybeResult = await (onOperation === null || onOperation === void 0 ? void 0 : onOperation(ctx, message, execArgs, operationResult)); - if (maybeResult) - operationResult = maybeResult; - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncIterable)(operationResult)) { - /** multiple emitted results */ - if (!(id in ctx.subscriptions)) { - // subscription was completed/canceled before the operation settled - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncGenerator)(operationResult)) - operationResult.return(undefined); - } - else { - ctx.subscriptions[id] = operationResult; - try { - for (var operationResult_1 = __asyncValues(operationResult), operationResult_1_1; operationResult_1_1 = await operationResult_1.next(), !operationResult_1_1.done;) { - const result = operationResult_1_1.value; - await emit.next(result, execArgs); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (operationResult_1_1 && !operationResult_1_1.done && (_a = operationResult_1.return)) await _a.call(operationResult_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - else { - /** single emitted result */ - // if the client completed the subscription before the single result - // became available, he effectively canceled it and no data should be sent - if (id in ctx.subscriptions) - await emit.next(operationResult, execArgs); - } - // lack of subscription at this point indicates that the client - // completed the subscription, he doesnt need to be reminded - await emit.complete(id in ctx.subscriptions); - delete ctx.subscriptions[id]; - return; - } - case _common_mjs__WEBPACK_IMPORTED_MODULE_0__.MessageType.Complete: { - const subscription = ctx.subscriptions[message.id]; - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncGenerator)(subscription)) - await subscription.return(undefined); - delete ctx.subscriptions[message.id]; // deleting the subscription means no further activity should take place - return; - } - default: - throw new Error(`Unexpected message of type ${message.type} received`); - } - }); - // wait for close, cleanup and the disconnect callback - return async (code, reason) => { - if (connectionInitWait) - clearTimeout(connectionInitWait); - for (const sub of Object.values(ctx.subscriptions)) { - if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncGenerator)(sub)) - await sub.return(undefined); - } - if (ctx.acknowledged) - await (onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect(ctx, code, reason)); - await (onClose === null || onClose === void 0 ? void 0 : onClose(ctx, code, reason)); - }; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql-ws/lib/utils.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql-ws/lib/utils.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "areGraphQLErrors": function() { return /* binding */ areGraphQLErrors; }, -/* harmony export */ "hasOwnArrayProperty": function() { return /* binding */ hasOwnArrayProperty; }, -/* harmony export */ "hasOwnObjectProperty": function() { return /* binding */ hasOwnObjectProperty; }, -/* harmony export */ "hasOwnProperty": function() { return /* binding */ hasOwnProperty; }, -/* harmony export */ "hasOwnStringProperty": function() { return /* binding */ hasOwnStringProperty; }, -/* harmony export */ "isAsyncGenerator": function() { return /* binding */ isAsyncGenerator; }, -/* harmony export */ "isAsyncIterable": function() { return /* binding */ isAsyncIterable; }, -/* harmony export */ "isObject": function() { return /* binding */ isObject; }, -/* harmony export */ "limitCloseReason": function() { return /* binding */ limitCloseReason; } -/* harmony export */ }); -// Extremely small optimisation, reduces runtime prototype traversal -const baseHasOwnProperty = Object.prototype.hasOwnProperty; -/** @private */ -function isObject(val) { - return typeof val === 'object' && val !== null; -} -/** @private */ -function isAsyncIterable(val) { - return typeof Object(val)[Symbol.asyncIterator] === 'function'; -} -/** @private */ -function isAsyncGenerator(val) { - return (isObject(val) && - typeof Object(val)[Symbol.asyncIterator] === 'function' && - typeof val.return === 'function' - // for lazy ones, we only need the return anyway - // typeof val.throw === 'function' && - // typeof val.next === 'function' - ); -} -/** @private */ -function areGraphQLErrors(obj) { - return (Array.isArray(obj) && - // must be at least one error - obj.length > 0 && - // error has at least a message - obj.every((ob) => 'message' in ob)); -} -/** @private */ -function hasOwnProperty(obj, prop) { - return baseHasOwnProperty.call(obj, prop); -} -/** @private */ -function hasOwnObjectProperty(obj, prop) { - return baseHasOwnProperty.call(obj, prop) && isObject(obj[prop]); -} -/** @private */ -function hasOwnArrayProperty(obj, prop) { - return baseHasOwnProperty.call(obj, prop) && Array.isArray(obj[prop]); -} -/** @private */ -function hasOwnStringProperty(obj, prop) { - return baseHasOwnProperty.call(obj, prop) && typeof obj[prop] === 'string'; -} -/** - * Limits the WebSocket close event reason to not exceed a length of one frame. - * Reference: https://datatracker.ietf.org/doc/html/rfc6455#section-5.2. - * - * @private - */ -function limitCloseReason(reason, whenTooLong) { - return reason.length < 124 ? reason : whenTooLong; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/error/GraphQLError.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/error/GraphQLError.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "GraphQLError": function() { return /* binding */ GraphQLError; }, -/* harmony export */ "formatError": function() { return /* binding */ formatError; }, -/* harmony export */ "printError": function() { return /* binding */ printError; } -/* harmony export */ }); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _language_location_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/location.mjs */ "../../../node_modules/graphql/language/location.mjs"); -/* harmony import */ var _language_printLocation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/printLocation.mjs */ "../../../node_modules/graphql/language/printLocation.mjs"); - - - - -function toNormalizedOptions(args) { - const firstArg = args[0]; - - if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) { - return { - nodes: firstArg, - source: args[1], - positions: args[2], - path: args[3], - originalError: args[4], - extensions: args[5], - }; - } - - return firstArg; -} -/** - * A GraphQLError describes an Error found during the parse, validate, or - * execute phases of performing a GraphQL operation. In addition to a message - * and stack trace, it also includes information about the locations in a - * GraphQL document and/or execution result that correspond to the Error. - */ - -class GraphQLError extends Error { - /** - * An array of `{ line, column }` locations within the source GraphQL document - * which correspond to this error. - * - * Errors during validation often contain multiple locations, for example to - * point out two things with the same name. Errors during execution include a - * single location, the field which produced the error. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - - /** - * An array describing the JSON-path into the execution response which - * corresponds to this error. Only included for errors during execution. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - - /** - * The source GraphQL document for the first location of this error. - * - * Note that if this Error represents more than one node, the source may not - * represent nodes after the first node. - */ - - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - - /** - * The original error thrown from a field resolver during execution. - */ - - /** - * Extension fields to add to the formatted error. - */ - - /** - * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead. - */ - constructor(message, ...rawArgs) { - var _this$nodes, _nodeLocations$, _ref; - - const { nodes, source, positions, path, originalError, extensions } = - toNormalizedOptions(rawArgs); - super(message); - this.name = 'GraphQLError'; - this.path = path !== null && path !== void 0 ? path : undefined; - this.originalError = - originalError !== null && originalError !== void 0 - ? originalError - : undefined; // Compute list of blame nodes. - - this.nodes = undefinedIfEmpty( - Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined, - ); - const nodeLocations = undefinedIfEmpty( - (_this$nodes = this.nodes) === null || _this$nodes === void 0 - ? void 0 - : _this$nodes.map((node) => node.loc).filter((loc) => loc != null), - ); // Compute locations in the source for the given nodes/positions. - - this.source = - source !== null && source !== void 0 - ? source - : nodeLocations === null || nodeLocations === void 0 - ? void 0 - : (_nodeLocations$ = nodeLocations[0]) === null || - _nodeLocations$ === void 0 - ? void 0 - : _nodeLocations$.source; - this.positions = - positions !== null && positions !== void 0 - ? positions - : nodeLocations === null || nodeLocations === void 0 - ? void 0 - : nodeLocations.map((loc) => loc.start); - this.locations = - positions && source - ? positions.map((pos) => (0,_language_location_mjs__WEBPACK_IMPORTED_MODULE_0__.getLocation)(source, pos)) - : nodeLocations === null || nodeLocations === void 0 - ? void 0 - : nodeLocations.map((loc) => (0,_language_location_mjs__WEBPACK_IMPORTED_MODULE_0__.getLocation)(loc.source, loc.start)); - const originalExtensions = (0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectLike)( - originalError === null || originalError === void 0 - ? void 0 - : originalError.extensions, - ) - ? originalError === null || originalError === void 0 - ? void 0 - : originalError.extensions - : undefined; - this.extensions = - (_ref = - extensions !== null && extensions !== void 0 - ? extensions - : originalExtensions) !== null && _ref !== void 0 - ? _ref - : Object.create(null); // Only properties prescribed by the spec should be enumerable. - // Keep the rest as non-enumerable. - - Object.defineProperties(this, { - message: { - writable: true, - enumerable: true, - }, - name: { - enumerable: false, - }, - nodes: { - enumerable: false, - }, - source: { - enumerable: false, - }, - positions: { - enumerable: false, - }, - originalError: { - enumerable: false, - }, - }); // Include (non-enumerable) stack trace. - - /* c8 ignore start */ - // FIXME: https://github.com/graphql/graphql-js/issues/2317 - - if ( - originalError !== null && - originalError !== void 0 && - originalError.stack - ) { - Object.defineProperty(this, 'stack', { - value: originalError.stack, - writable: true, - configurable: true, - }); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, GraphQLError); - } else { - Object.defineProperty(this, 'stack', { - value: Error().stack, - writable: true, - configurable: true, - }); - } - /* c8 ignore stop */ - } - - get [Symbol.toStringTag]() { - return 'GraphQLError'; - } - - toString() { - let output = this.message; - - if (this.nodes) { - for (const node of this.nodes) { - if (node.loc) { - output += '\n\n' + (0,_language_printLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.printLocation)(node.loc); - } - } - } else if (this.source && this.locations) { - for (const location of this.locations) { - output += '\n\n' + (0,_language_printLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.printSourceLocation)(this.source, location); - } - } - - return output; - } - - toJSON() { - const formattedError = { - message: this.message, - }; - - if (this.locations != null) { - formattedError.locations = this.locations; - } - - if (this.path != null) { - formattedError.path = this.path; - } - - if (this.extensions != null && Object.keys(this.extensions).length > 0) { - formattedError.extensions = this.extensions; - } - - return formattedError; - } -} - -function undefinedIfEmpty(array) { - return array === undefined || array.length === 0 ? undefined : array; -} -/** - * See: https://spec.graphql.org/draft/#sec-Errors - */ - -/** - * Prints a GraphQLError to a string, representing useful location information - * about the error's position in the source. - * - * @deprecated Please use `error.toString` instead. Will be removed in v17 - */ -function printError(error) { - return error.toString(); -} -/** - * Given a GraphQLError, format it according to the rules described by the - * Response Format, Errors section of the GraphQL Specification. - * - * @deprecated Please use `error.toJSON` instead. Will be removed in v17 - */ - -function formatError(error) { - return error.toJSON(); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/error/locatedError.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/error/locatedError.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "locatedError": function() { return /* binding */ locatedError; } -/* harmony export */ }); -/* harmony import */ var _jsutils_toError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/toError.mjs */ "../../../node_modules/graphql/jsutils/toError.mjs"); -/* harmony import */ var _GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Given an arbitrary value, presumably thrown while attempting to execute a - * GraphQL operation, produce a new GraphQLError aware of the location in the - * document responsible for the original Error. - */ - -function locatedError(rawOriginalError, nodes, path) { - var _nodes; - - const originalError = (0,_jsutils_toError_mjs__WEBPACK_IMPORTED_MODULE_0__.toError)(rawOriginalError); // Note: this uses a brand-check to support GraphQL errors originating from other contexts. - - if (isLocatedGraphQLError(originalError)) { - return originalError; - } - - return new _GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(originalError.message, { - nodes: - (_nodes = originalError.nodes) !== null && _nodes !== void 0 - ? _nodes - : nodes, - source: originalError.source, - positions: originalError.positions, - path, - originalError, - }); -} - -function isLocatedGraphQLError(error) { - return Array.isArray(error.path); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/error/syntaxError.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/error/syntaxError.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "syntaxError": function() { return /* binding */ syntaxError; } -/* harmony export */ }); -/* harmony import */ var _GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - -/** - * Produces a GraphQLError representing a syntax error, containing useful - * descriptive information about the syntax error's position in the source. - */ - -function syntaxError(source, position, description) { - return new _GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError(`Syntax Error: ${description}`, { - source, - positions: [position], - }); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/execution/collectFields.mjs": -/*!*****************************************************************!*\ - !*** ../../../node_modules/graphql/execution/collectFields.mjs ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "collectFields": function() { return /* binding */ collectFields; }, -/* harmony export */ "collectSubfields": function() { return /* binding */ collectSubfields; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/* harmony import */ var _values_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); - - - - - -/** - * Given a selectionSet, collects all of the fields and returns them. - * - * CollectFields requires the "runtime type" of an object. For a field that - * returns an Interface or Union type, the "runtime type" will be the actual - * object type returned by that field. - * - * @internal - */ - -function collectFields( - schema, - fragments, - variableValues, - runtimeType, - selectionSet, -) { - const fields = new Map(); - collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - selectionSet, - fields, - new Set(), - ); - return fields; -} -/** - * Given an array of field nodes, collects all of the subfields of the passed - * in fields, and returns them at the end. - * - * CollectSubFields requires the "return type" of an object. For a field that - * returns an Interface or Union type, the "return type" will be the actual - * object type returned by that field. - * - * @internal - */ - -function collectSubfields( - schema, - fragments, - variableValues, - returnType, - fieldNodes, -) { - const subFieldNodes = new Map(); - const visitedFragmentNames = new Set(); - - for (const node of fieldNodes) { - if (node.selectionSet) { - collectFieldsImpl( - schema, - fragments, - variableValues, - returnType, - node.selectionSet, - subFieldNodes, - visitedFragmentNames, - ); - } - } - - return subFieldNodes; -} - -function collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - selectionSet, - fields, - visitedFragmentNames, -) { - for (const selection of selectionSet.selections) { - switch (selection.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FIELD: { - if (!shouldIncludeNode(variableValues, selection)) { - continue; - } - - const name = getFieldEntryKey(selection); - const fieldList = fields.get(name); - - if (fieldList !== undefined) { - fieldList.push(selection); - } else { - fields.set(name, [selection]); - } - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INLINE_FRAGMENT: { - if ( - !shouldIncludeNode(variableValues, selection) || - !doesFragmentConditionMatch(schema, selection, runtimeType) - ) { - continue; - } - - collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - selection.selectionSet, - fields, - visitedFragmentNames, - ); - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_SPREAD: { - const fragName = selection.name.value; - - if ( - visitedFragmentNames.has(fragName) || - !shouldIncludeNode(variableValues, selection) - ) { - continue; - } - - visitedFragmentNames.add(fragName); - const fragment = fragments[fragName]; - - if ( - !fragment || - !doesFragmentConditionMatch(schema, fragment, runtimeType) - ) { - continue; - } - - collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - fragment.selectionSet, - fields, - visitedFragmentNames, - ); - break; - } - } - } -} -/** - * Determines if a field should be included based on the `@include` and `@skip` - * directives, where `@skip` has higher precedence than `@include`. - */ - -function shouldIncludeNode(variableValues, node) { - const skip = (0,_values_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveValues)(_type_directives_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLSkipDirective, node, variableValues); - - if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) { - return false; - } - - const include = (0,_values_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveValues)( - _type_directives_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLIncludeDirective, - node, - variableValues, - ); - - if ( - (include === null || include === void 0 ? void 0 : include.if) === false - ) { - return false; - } - - return true; -} -/** - * Determines if a fragment is applicable to the given type. - */ - -function doesFragmentConditionMatch(schema, fragment, type) { - const typeConditionNode = fragment.typeCondition; - - if (!typeConditionNode) { - return true; - } - - const conditionalType = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__.typeFromAST)(schema, typeConditionNode); - - if (conditionalType === type) { - return true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_4__.isAbstractType)(conditionalType)) { - return schema.isSubType(conditionalType, type); - } - - return false; -} -/** - * Implements the logic to compute the key of a given field's entry - */ - -function getFieldEntryKey(node) { - return node.alias ? node.alias.value : node.name.value; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/execution/execute.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/execution/execute.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "assertValidExecutionArguments": function() { return /* binding */ assertValidExecutionArguments; }, -/* harmony export */ "buildExecutionContext": function() { return /* binding */ buildExecutionContext; }, -/* harmony export */ "buildResolveInfo": function() { return /* binding */ buildResolveInfo; }, -/* harmony export */ "defaultFieldResolver": function() { return /* binding */ defaultFieldResolver; }, -/* harmony export */ "defaultTypeResolver": function() { return /* binding */ defaultTypeResolver; }, -/* harmony export */ "execute": function() { return /* binding */ execute; }, -/* harmony export */ "executeSync": function() { return /* binding */ executeSync; }, -/* harmony export */ "getFieldDef": function() { return /* binding */ getFieldDef; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); -/* harmony import */ var _jsutils_memoize3_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/memoize3.mjs */ "../../../node_modules/graphql/jsutils/memoize3.mjs"); -/* harmony import */ var _jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); -/* harmony import */ var _jsutils_promiseForObject_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../jsutils/promiseForObject.mjs */ "../../../node_modules/graphql/jsutils/promiseForObject.mjs"); -/* harmony import */ var _jsutils_promiseReduce_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../jsutils/promiseReduce.mjs */ "../../../node_modules/graphql/jsutils/promiseReduce.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../error/locatedError.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); -/* harmony import */ var _language_ast_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_validate_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -/* harmony import */ var _collectFields_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); -/* harmony import */ var _values_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); - - - - - - - - - - - - - - - - - - - -/** - * A memoized collection of relevant subfields with regard to the return - * type. Memoizing ensures the subfields are not repeatedly calculated, which - * saves overhead when resolving lists of values. - */ - -const collectSubfields = (0,_jsutils_memoize3_mjs__WEBPACK_IMPORTED_MODULE_0__.memoize3)((exeContext, returnType, fieldNodes) => - (0,_collectFields_mjs__WEBPACK_IMPORTED_MODULE_1__.collectSubfields)( - exeContext.schema, - exeContext.fragments, - exeContext.variableValues, - returnType, - fieldNodes, - ), -); -/** - * Terminology - * - * "Definitions" are the generic name for top-level statements in the document. - * Examples of this include: - * 1) Operations (such as a query) - * 2) Fragments - * - * "Operations" are a generic name for requests in the document. - * Examples of this include: - * 1) query, - * 2) mutation - * - * "Selections" are the definitions that can appear legally and at - * single level of the query. These include: - * 1) field references e.g `a` - * 2) fragment "spreads" e.g. `...c` - * 3) inline fragment "spreads" e.g. `...on Type { a }` - */ - -/** - * Data that must be available at all points during query execution. - * - * Namely, schema of the type system that is currently executing, - * and the fragments defined in the query document - */ - -/** - * Implements the "Executing requests" section of the GraphQL specification. - * - * Returns either a synchronous ExecutionResult (if all encountered resolvers - * are synchronous), or a Promise of an ExecutionResult that will eventually be - * resolved and never rejected. - * - * If the arguments to this function do not result in a legal execution context, - * a GraphQLError will be thrown immediately explaining the invalid input. - */ -function execute(args) { - // Temporary for v15 to v16 migration. Remove in v17 - arguments.length < 2 || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', - ); - const { schema, document, variableValues, rootValue } = args; // If arguments are missing or incorrect, throw an error. - - assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, - // a "Response" with only errors is returned. - - const exeContext = buildExecutionContext(args); // Return early errors if execution context failed. - - if (!('schema' in exeContext)) { - return { - errors: exeContext, - }; - } // Return a Promise that will eventually resolve to the data described by - // The "Response" section of the GraphQL specification. - // - // If errors are encountered while executing a GraphQL field, only that - // field and its descendants will be omitted, and sibling fields will still - // be executed. An execution which encounters errors will still result in a - // resolved Promise. - // - // Errors from sub-fields of a NonNull type may propagate to the top level, - // at which point we still log the error and null the parent field, which - // in this case is the entire response. - - try { - const { operation } = exeContext; - const result = executeOperation(exeContext, operation, rootValue); - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - return result.then( - (data) => buildResponse(data, exeContext.errors), - (error) => { - exeContext.errors.push(error); - return buildResponse(null, exeContext.errors); - }, - ); - } - - return buildResponse(result, exeContext.errors); - } catch (error) { - exeContext.errors.push(error); - return buildResponse(null, exeContext.errors); - } -} -/** - * Also implements the "Executing requests" section of the GraphQL specification. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ - -function executeSync(args) { - const result = execute(args); // Assert that the execution was synchronous. - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - throw new Error('GraphQL execution failed to complete synchronously.'); - } - - return result; -} -/** - * Given a completed execution context and data, build the `{ errors, data }` - * response defined by the "Response" section of the GraphQL specification. - */ - -function buildResponse(data, errors) { - return errors.length === 0 - ? { - data, - } - : { - errors, - data, - }; -} -/** - * Essential assertions before executing to provide developer feedback for - * improper use of the GraphQL library. - * - * @internal - */ - -function assertValidExecutionArguments( - schema, - document, - rawVariableValues, -) { - document || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)(false, 'Must provide document.'); // If the schema used for execution is invalid, throw an error. - - (0,_type_validate_mjs__WEBPACK_IMPORTED_MODULE_4__.assertValidSchema)(schema); // Variables, if provided, must be an object. - - rawVariableValues == null || - (0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(rawVariableValues) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.', - ); -} -/** - * Constructs a ExecutionContext object from the arguments passed to - * execute, which we will pass throughout the other execution methods. - * - * Throws a GraphQLError if a valid execution context cannot be created. - * - * @internal - */ - -function buildExecutionContext(args) { - var _definition$name, _operation$variableDe; - - const { - schema, - document, - rootValue, - contextValue, - variableValues: rawVariableValues, - operationName, - fieldResolver, - typeResolver, - subscribeFieldResolver, - } = args; - let operation; - const fragments = Object.create(null); - - for (const definition of document.definitions) { - switch (definition.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_6__.Kind.OPERATION_DEFINITION: - if (operationName == null) { - if (operation !== undefined) { - return [ - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - 'Must provide operation name if query contains multiple operations.', - ), - ]; - } - - operation = definition; - } else if ( - ((_definition$name = definition.name) === null || - _definition$name === void 0 - ? void 0 - : _definition$name.value) === operationName - ) { - operation = definition; - } - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_6__.Kind.FRAGMENT_DEFINITION: - fragments[definition.name.value] = definition; - break; - - default: // ignore non-executable definitions - } - } - - if (!operation) { - if (operationName != null) { - return [new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError(`Unknown operation named "${operationName}".`)]; - } - - return [new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError('Must provide an operation.')]; - } // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const variableDefinitions = - (_operation$variableDe = operation.variableDefinitions) !== null && - _operation$variableDe !== void 0 - ? _operation$variableDe - : []; - const coercedVariableValues = (0,_values_mjs__WEBPACK_IMPORTED_MODULE_8__.getVariableValues)( - schema, - variableDefinitions, - rawVariableValues !== null && rawVariableValues !== void 0 - ? rawVariableValues - : {}, - { - maxErrors: 50, - }, - ); - - if (coercedVariableValues.errors) { - return coercedVariableValues.errors; - } - - return { - schema, - fragments, - rootValue, - contextValue, - operation, - variableValues: coercedVariableValues.coerced, - fieldResolver: - fieldResolver !== null && fieldResolver !== void 0 - ? fieldResolver - : defaultFieldResolver, - typeResolver: - typeResolver !== null && typeResolver !== void 0 - ? typeResolver - : defaultTypeResolver, - subscribeFieldResolver: - subscribeFieldResolver !== null && subscribeFieldResolver !== void 0 - ? subscribeFieldResolver - : defaultFieldResolver, - errors: [], - }; -} -/** - * Implements the "Executing operations" section of the spec. - */ - -function executeOperation(exeContext, operation, rootValue) { - const rootType = exeContext.schema.getRootType(operation.operation); - - if (rootType == null) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Schema is not configured to execute ${operation.operation} operation.`, - { - nodes: operation, - }, - ); - } - - const rootFields = (0,_collectFields_mjs__WEBPACK_IMPORTED_MODULE_1__.collectFields)( - exeContext.schema, - exeContext.fragments, - exeContext.variableValues, - rootType, - operation.selectionSet, - ); - const path = undefined; - - switch (operation.operation) { - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_9__.OperationTypeNode.QUERY: - return executeFields(exeContext, rootType, rootValue, path, rootFields); - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_9__.OperationTypeNode.MUTATION: - return executeFieldsSerially( - exeContext, - rootType, - rootValue, - path, - rootFields, - ); - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_9__.OperationTypeNode.SUBSCRIPTION: - // TODO: deprecate `subscribe` and move all logic here - // Temporary solution until we finish merging execute and subscribe together - return executeFields(exeContext, rootType, rootValue, path, rootFields); - } -} -/** - * Implements the "Executing selection sets" section of the spec - * for fields that must be executed serially. - */ - -function executeFieldsSerially( - exeContext, - parentType, - sourceValue, - path, - fields, -) { - return (0,_jsutils_promiseReduce_mjs__WEBPACK_IMPORTED_MODULE_10__.promiseReduce)( - fields.entries(), - (results, [responseName, fieldNodes]) => { - const fieldPath = (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.addPath)(path, responseName, parentType.name); - const result = executeField( - exeContext, - parentType, - sourceValue, - fieldNodes, - fieldPath, - ); - - if (result === undefined) { - return results; - } - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - return result.then((resolvedResult) => { - results[responseName] = resolvedResult; - return results; - }); - } - - results[responseName] = result; - return results; - }, - Object.create(null), - ); -} -/** - * Implements the "Executing selection sets" section of the spec - * for fields that may be executed in parallel. - */ - -function executeFields(exeContext, parentType, sourceValue, path, fields) { - const results = Object.create(null); - let containsPromise = false; - - for (const [responseName, fieldNodes] of fields.entries()) { - const fieldPath = (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.addPath)(path, responseName, parentType.name); - const result = executeField( - exeContext, - parentType, - sourceValue, - fieldNodes, - fieldPath, - ); - - if (result !== undefined) { - results[responseName] = result; - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - containsPromise = true; - } - } - } // If there are no promises, we can just return the object - - if (!containsPromise) { - return results; - } // Otherwise, results is a map from field name to the result of resolving that - // field, which is possibly a promise. Return a promise that will return this - // same map, but with any promises replaced with the values they resolved to. - - return (0,_jsutils_promiseForObject_mjs__WEBPACK_IMPORTED_MODULE_12__.promiseForObject)(results); -} -/** - * Implements the "Executing fields" section of the spec - * In particular, this function figures out the value that the field returns by - * calling its resolve function, then calls completeValue to complete promises, - * serialize scalars, or execute the sub-selection-set for objects. - */ - -function executeField(exeContext, parentType, source, fieldNodes, path) { - var _fieldDef$resolve; - - const fieldDef = getFieldDef(exeContext.schema, parentType, fieldNodes[0]); - - if (!fieldDef) { - return; - } - - const returnType = fieldDef.type; - const resolveFn = - (_fieldDef$resolve = fieldDef.resolve) !== null && - _fieldDef$resolve !== void 0 - ? _fieldDef$resolve - : exeContext.fieldResolver; - const info = buildResolveInfo( - exeContext, - fieldDef, - fieldNodes, - parentType, - path, - ); // Get the resolve function, regardless of if its result is normal or abrupt (error). - - try { - // Build a JS object of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - // TODO: find a way to memoize, in case this field is within a List type. - const args = (0,_values_mjs__WEBPACK_IMPORTED_MODULE_8__.getArgumentValues)( - fieldDef, - fieldNodes[0], - exeContext.variableValues, - ); // The resolve function's optional third argument is a context value that - // is provided to every resolve function within an execution. It is commonly - // used to represent an authenticated user, or request-specific caches. - - const contextValue = exeContext.contextValue; - const result = resolveFn(source, args, contextValue, info); - let completed; - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - completed = result.then((resolved) => - completeValue(exeContext, returnType, fieldNodes, info, path, resolved), - ); - } else { - completed = completeValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, - ); - } - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(completed)) { - // Note: we don't rely on a `catch` method, but we do expect "thenable" - // to take a second callback for the error case. - return completed.then(undefined, (rawError) => { - const error = (0,_error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_13__.locatedError)(rawError, fieldNodes, (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.pathToArray)(path)); - return handleFieldError(error, returnType, exeContext); - }); - } - - return completed; - } catch (rawError) { - const error = (0,_error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_13__.locatedError)(rawError, fieldNodes, (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.pathToArray)(path)); - return handleFieldError(error, returnType, exeContext); - } -} -/** - * @internal - */ - -function buildResolveInfo( - exeContext, - fieldDef, - fieldNodes, - parentType, - path, -) { - // The resolve function's optional fourth argument is a collection of - // information about the current execution state. - return { - fieldName: fieldDef.name, - fieldNodes, - returnType: fieldDef.type, - parentType, - path, - schema: exeContext.schema, - fragments: exeContext.fragments, - rootValue: exeContext.rootValue, - operation: exeContext.operation, - variableValues: exeContext.variableValues, - }; -} - -function handleFieldError(error, returnType, exeContext) { - // If the field type is non-nullable, then it is resolved without any - // protection from errors, however it still properly locates the error. - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isNonNullType)(returnType)) { - throw error; - } // Otherwise, error protection is applied, logging the error and resolving - // a null value for this field if one is encountered. - - exeContext.errors.push(error); - return null; -} -/** - * Implements the instructions for completeValue as defined in the - * "Value Completion" section of the spec. - * - * If the field type is Non-Null, then this recursively completes the value - * for the inner type. It throws a field error if that completion returns null, - * as per the "Nullability" section of the spec. - * - * If the field type is a List, then this recursively completes the value - * for the inner type on each item in the list. - * - * If the field type is a Scalar or Enum, ensures the completed value is a legal - * value of the type by calling the `serialize` method of GraphQL type - * definition. - * - * If the field is an abstract type, determine the runtime type of the value - * and then complete based on that type - * - * Otherwise, the field type expects a sub-selection set, and will complete the - * value by executing all sub-selections. - */ - -function completeValue(exeContext, returnType, fieldNodes, info, path, result) { - // If result is an Error, throw a located error. - if (result instanceof Error) { - throw result; - } // If field type is NonNull, complete for inner type, and throw field error - // if result is null. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isNonNullType)(returnType)) { - const completed = completeValue( - exeContext, - returnType.ofType, - fieldNodes, - info, - path, - result, - ); - - if (completed === null) { - throw new Error( - `Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`, - ); - } - - return completed; - } // If result value is null or undefined then return null. - - if (result == null) { - return null; - } // If field type is List, complete each item in the list with the inner type - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isListType)(returnType)) { - return completeListValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, - ); - } // If field type is a leaf type, Scalar or Enum, serialize to a valid value, - // returning null if serialization is not possible. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isLeafType)(returnType)) { - return completeLeafValue(returnType, result); - } // If field type is an abstract type, Interface or Union, determine the - // runtime Object type and complete for that type. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isAbstractType)(returnType)) { - return completeAbstractValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, - ); - } // If field type is Object, execute and complete all sub-selections. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isObjectType)(returnType)) { - return completeObjectValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, - ); - } - /* c8 ignore next 6 */ - // Not reachable, all possible output types have been considered. - - false || - (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_15__.invariant)( - false, - 'Cannot complete value of unexpected output type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(returnType), - ); -} -/** - * Complete a list value by completing each item in the list with the - * inner type - */ - -function completeListValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, -) { - if (!(0,_jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_17__.isIterableObject)(result)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Expected Iterable, but did not find one for field "${info.parentType.name}.${info.fieldName}".`, - ); - } // This is specified as a simple map, however we're optimizing the path - // where the list contains no Promises by avoiding creating another Promise. - - const itemType = returnType.ofType; - let containsPromise = false; - const completedResults = Array.from(result, (item, index) => { - // No need to modify the info object containing the path, - // since from here on it is not ever accessed by resolver functions. - const itemPath = (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.addPath)(path, index, undefined); - - try { - let completedItem; - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(item)) { - completedItem = item.then((resolved) => - completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - resolved, - ), - ); - } else { - completedItem = completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - item, - ); - } - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(completedItem)) { - containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect "thenable" - // to take a second callback for the error case. - - return completedItem.then(undefined, (rawError) => { - const error = (0,_error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_13__.locatedError)( - rawError, - fieldNodes, - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.pathToArray)(itemPath), - ); - return handleFieldError(error, itemType, exeContext); - }); - } - - return completedItem; - } catch (rawError) { - const error = (0,_error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_13__.locatedError)(rawError, fieldNodes, (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_11__.pathToArray)(itemPath)); - return handleFieldError(error, itemType, exeContext); - } - }); - return containsPromise ? Promise.all(completedResults) : completedResults; -} -/** - * Complete a Scalar or Enum by serializing to a valid value, returning - * null if serialization is not possible. - */ - -function completeLeafValue(returnType, result) { - const serializedResult = returnType.serialize(result); - - if (serializedResult == null) { - throw new Error( - `Expected \`${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(returnType)}.serialize(${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(result)})\` to ` + - `return non-nullable value, returned: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(serializedResult)}`, - ); - } - - return serializedResult; -} -/** - * Complete a value of an abstract type by determining the runtime object type - * of that value, then complete the value for that type. - */ - -function completeAbstractValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, -) { - var _returnType$resolveTy; - - const resolveTypeFn = - (_returnType$resolveTy = returnType.resolveType) !== null && - _returnType$resolveTy !== void 0 - ? _returnType$resolveTy - : exeContext.typeResolver; - const contextValue = exeContext.contextValue; - const runtimeType = resolveTypeFn(result, contextValue, info, returnType); - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(runtimeType)) { - return runtimeType.then((resolvedRuntimeType) => - completeObjectValue( - exeContext, - ensureValidRuntimeType( - resolvedRuntimeType, - exeContext, - returnType, - fieldNodes, - info, - result, - ), - fieldNodes, - info, - path, - result, - ), - ); - } - - return completeObjectValue( - exeContext, - ensureValidRuntimeType( - runtimeType, - exeContext, - returnType, - fieldNodes, - info, - result, - ), - fieldNodes, - info, - path, - result, - ); -} - -function ensureValidRuntimeType( - runtimeTypeName, - exeContext, - returnType, - fieldNodes, - info, - result, -) { - if (runtimeTypeName == null) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, - fieldNodes, - ); - } // releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType` - // TODO: remove in 17.0.0 release - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isObjectType)(runtimeTypeName)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - 'Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.', - ); - } - - if (typeof runtimeTypeName !== 'string') { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with ` + - `value ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(result)}, received "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(runtimeTypeName)}".`, - ); - } - - const runtimeType = exeContext.schema.getType(runtimeTypeName); - - if (runtimeType == null) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, - { - nodes: fieldNodes, - }, - ); - } - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_14__.isObjectType)(runtimeType)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, - { - nodes: fieldNodes, - }, - ); - } - - if (!exeContext.schema.isSubType(returnType, runtimeType)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`, - { - nodes: fieldNodes, - }, - ); - } - - return runtimeType; -} -/** - * Complete an Object value by executing all sub-selections. - */ - -function completeObjectValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, -) { - // Collect sub-fields to execute to complete this value. - const subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); // If there is an isTypeOf predicate function, call it with the - // current result. If isTypeOf returns false, then raise an error rather - // than continuing execution. - - if (returnType.isTypeOf) { - const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(isTypeOf)) { - return isTypeOf.then((resolvedIsTypeOf) => { - if (!resolvedIsTypeOf) { - throw invalidReturnTypeError(returnType, result, fieldNodes); - } - - return executeFields( - exeContext, - returnType, - result, - path, - subFieldNodes, - ); - }); - } - - if (!isTypeOf) { - throw invalidReturnTypeError(returnType, result, fieldNodes); - } - } - - return executeFields(exeContext, returnType, result, path, subFieldNodes); -} - -function invalidReturnTypeError(returnType, result, fieldNodes) { - return new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLError( - `Expected value of type "${returnType.name}" but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_16__.inspect)(result)}.`, - { - nodes: fieldNodes, - }, - ); -} -/** - * If a resolveType function is not given, then a default resolve behavior is - * used which attempts two strategies: - * - * First, See if the provided value has a `__typename` field defined, if so, use - * that value as name of the resolved type. - * - * Otherwise, test each possible type for the abstract type by calling - * isTypeOf for the object being coerced, returning the first type that matches. - */ - -const defaultTypeResolver = function ( - value, - contextValue, - info, - abstractType, -) { - // First, look for `__typename`. - if ((0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(value) && typeof value.__typename === 'string') { - return value.__typename; - } // Otherwise, test each possible type. - - const possibleTypes = info.schema.getPossibleTypes(abstractType); - const promisedIsTypeOfResults = []; - - for (let i = 0; i < possibleTypes.length; i++) { - const type = possibleTypes[i]; - - if (type.isTypeOf) { - const isTypeOfResult = type.isTypeOf(value, contextValue, info); - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_3__.isPromise)(isTypeOfResult)) { - promisedIsTypeOfResults[i] = isTypeOfResult; - } else if (isTypeOfResult) { - return type.name; - } - } - } - - if (promisedIsTypeOfResults.length) { - return Promise.all(promisedIsTypeOfResults).then((isTypeOfResults) => { - for (let i = 0; i < isTypeOfResults.length; i++) { - if (isTypeOfResults[i]) { - return possibleTypes[i].name; - } - } - }); - } -}; -/** - * If a resolve function is not given, then a default resolve behavior is used - * which takes the property of the source object of the same name as the field - * and returns it as the result, or if it's a function, returns the result - * of calling that function while passing along args and context value. - */ - -const defaultFieldResolver = function ( - source, - args, - contextValue, - info, -) { - // ensure source is a value for which property access is acceptable. - if ((0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(source) || typeof source === 'function') { - const property = source[info.fieldName]; - - if (typeof property === 'function') { - return source[info.fieldName](args, contextValue, info); - } - - return property; - } -}; -/** - * This method looks up the field on the given type definition. - * It has special casing for the three introspection fields, - * __schema, __type and __typename. __typename is special because - * it can always be queried as a field, even in situations where no - * other fields are allowed, like on a Union. __schema and __type - * could get automatically added to the query type, but that would - * require mutating type definitions, which would cause issues. - * - * @internal - */ - -function getFieldDef(schema, parentType, fieldNode) { - const fieldName = fieldNode.name.value; - - if ( - fieldName === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.SchemaMetaFieldDef.name && - schema.getQueryType() === parentType - ) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.SchemaMetaFieldDef; - } else if ( - fieldName === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.TypeMetaFieldDef.name && - schema.getQueryType() === parentType - ) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.TypeMetaFieldDef; - } else if (fieldName === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.TypeNameMetaFieldDef.name) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_18__.TypeNameMetaFieldDef; - } - - return parentType.getFields()[fieldName]; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/execution/mapAsyncIterator.mjs": -/*!********************************************************************!*\ - !*** ../../../node_modules/graphql/execution/mapAsyncIterator.mjs ***! - \********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "mapAsyncIterator": function() { return /* binding */ mapAsyncIterator; } -/* harmony export */ }); -/** - * Given an AsyncIterable and a callback function, return an AsyncIterator - * which produces values mapped via calling the callback function. - */ -function mapAsyncIterator(iterable, callback) { - const iterator = iterable[Symbol.asyncIterator](); - - async function mapResult(result) { - if (result.done) { - return result; - } - - try { - return { - value: await callback(result.value), - done: false, - }; - } catch (error) { - /* c8 ignore start */ - // FIXME: add test case - if (typeof iterator.return === 'function') { - try { - await iterator.return(); - } catch (_e) { - /* ignore error */ - } - } - - throw error; - /* c8 ignore stop */ - } - } - - return { - async next() { - return mapResult(await iterator.next()); - }, - - async return() { - // If iterator.return() does not exist, then type R must be undefined. - return typeof iterator.return === 'function' - ? mapResult(await iterator.return()) - : { - value: undefined, - done: true, - }; - }, - - async throw(error) { - if (typeof iterator.throw === 'function') { - return mapResult(await iterator.throw(error)); - } - - throw error; - }, - - [Symbol.asyncIterator]() { - return this; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/execution/subscribe.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/execution/subscribe.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "createSourceEventStream": function() { return /* binding */ createSourceEventStream; }, -/* harmony export */ "subscribe": function() { return /* binding */ subscribe; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_isAsyncIterable_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/isAsyncIterable.mjs */ "../../../node_modules/graphql/jsutils/isAsyncIterable.mjs"); -/* harmony import */ var _jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/locatedError.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); -/* harmony import */ var _collectFields_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); -/* harmony import */ var _execute_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); -/* harmony import */ var _mapAsyncIterator_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mapAsyncIterator.mjs */ "../../../node_modules/graphql/execution/mapAsyncIterator.mjs"); -/* harmony import */ var _values_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); - - - - - - - - - - -/** - * Implements the "Subscribe" algorithm described in the GraphQL specification. - * - * Returns a Promise which resolves to either an AsyncIterator (if successful) - * or an ExecutionResult (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * If the client-provided arguments to this function do not result in a - * compliant subscription, a GraphQL Response (ExecutionResult) with - * descriptive errors and no data will be returned. - * - * If the source stream could not be created due to faulty subscription - * resolver logic or underlying systems, the promise will resolve to a single - * ExecutionResult containing `errors` and no `data`. - * - * If the operation succeeded, the promise resolves to an AsyncIterator, which - * yields a stream of ExecutionResults representing the response stream. - * - * Accepts either an object with named arguments, or individual arguments. - */ - -async function subscribe(args) { - // Temporary for v15 to v16 migration. Remove in v17 - arguments.length < 2 || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)( - false, - 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', - ); - const { - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - subscribeFieldResolver, - } = args; - const resultOrStream = await createSourceEventStream( - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - subscribeFieldResolver, - ); - - if (!(0,_jsutils_isAsyncIterable_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncIterable)(resultOrStream)) { - return resultOrStream; - } // For each payload yielded from a subscription, map it over the normal - // GraphQL `execute` function, with `payload` as the rootValue. - // This implements the "MapSourceToResponseEvent" algorithm described in - // the GraphQL specification. The `execute` function provides the - // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the - // "ExecuteQuery" algorithm, for which `execute` is also used. - - const mapSourceToResponse = (payload) => - (0,_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.execute)({ - schema, - document, - rootValue: payload, - contextValue, - variableValues, - operationName, - fieldResolver, - }); // Map every source value to a ExecutionResult value as described above. - - return (0,_mapAsyncIterator_mjs__WEBPACK_IMPORTED_MODULE_3__.mapAsyncIterator)(resultOrStream, mapSourceToResponse); -} -/** - * Implements the "CreateSourceEventStream" algorithm described in the - * GraphQL specification, resolving the subscription source event stream. - * - * Returns a Promise which resolves to either an AsyncIterable (if successful) - * or an ExecutionResult (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * If the client-provided arguments to this function do not result in a - * compliant subscription, a GraphQL Response (ExecutionResult) with - * descriptive errors and no data will be returned. - * - * If the the source stream could not be created due to faulty subscription - * resolver logic or underlying systems, the promise will resolve to a single - * ExecutionResult containing `errors` and no `data`. - * - * If the operation succeeded, the promise resolves to the AsyncIterable for the - * event stream returned by the resolver. - * - * A Source Event Stream represents a sequence of events, each of which triggers - * a GraphQL execution for that event. - * - * This may be useful when hosting the stateful subscription service in a - * different process or machine than the stateless GraphQL execution engine, - * or otherwise separating these two steps. For more on this, see the - * "Supporting Subscriptions at Scale" information in the GraphQL specification. - */ - -async function createSourceEventStream( - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - subscribeFieldResolver, -) { - // If arguments are missing or incorrectly typed, this is an internal - // developer mistake which should throw an early error. - (0,_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.assertValidExecutionArguments)(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, - // a "Response" with only errors is returned. - - const exeContext = (0,_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.buildExecutionContext)({ - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - subscribeFieldResolver, - }); // Return early errors if execution context failed. - - if (!('schema' in exeContext)) { - return { - errors: exeContext, - }; - } - - try { - const eventStream = await executeSubscription(exeContext); // Assert field returned an event stream, otherwise yield an error. - - if (!(0,_jsutils_isAsyncIterable_mjs__WEBPACK_IMPORTED_MODULE_1__.isAsyncIterable)(eventStream)) { - throw new Error( - 'Subscription field must return Async Iterable. ' + - `Received: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__.inspect)(eventStream)}.`, - ); - } - - return eventStream; - } catch (error) { - // If it GraphQLError, report it as an ExecutionResult, containing only errors and no data. - // Otherwise treat the error as a system-class error and re-throw it. - if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLError) { - return { - errors: [error], - }; - } - - throw error; - } -} - -async function executeSubscription(exeContext) { - const { schema, fragments, operation, variableValues, rootValue } = - exeContext; - const rootType = schema.getSubscriptionType(); - - if (rootType == null) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLError( - 'Schema is not configured to execute subscription operation.', - { - nodes: operation, - }, - ); - } - - const rootFields = (0,_collectFields_mjs__WEBPACK_IMPORTED_MODULE_6__.collectFields)( - schema, - fragments, - variableValues, - rootType, - operation.selectionSet, - ); - const [responseName, fieldNodes] = [...rootFields.entries()][0]; - const fieldDef = (0,_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.getFieldDef)(schema, rootType, fieldNodes[0]); - - if (!fieldDef) { - const fieldName = fieldNodes[0].name.value; - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLError( - `The subscription field "${fieldName}" is not defined.`, - { - nodes: fieldNodes, - }, - ); - } - - const path = (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_7__.addPath)(undefined, responseName, rootType.name); - const info = (0,_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.buildResolveInfo)( - exeContext, - fieldDef, - fieldNodes, - rootType, - path, - ); - - try { - var _fieldDef$subscribe; - - // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. - // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. - // Build a JS object of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - const args = (0,_values_mjs__WEBPACK_IMPORTED_MODULE_8__.getArgumentValues)(fieldDef, fieldNodes[0], variableValues); // The resolve function's optional third argument is a context value that - // is provided to every resolve function within an execution. It is commonly - // used to represent an authenticated user, or request-specific caches. - - const contextValue = exeContext.contextValue; // Call the `subscribe()` resolver or the default resolver to produce an - // AsyncIterable yielding raw payloads. - - const resolveFn = - (_fieldDef$subscribe = fieldDef.subscribe) !== null && - _fieldDef$subscribe !== void 0 - ? _fieldDef$subscribe - : exeContext.subscribeFieldResolver; - const eventStream = await resolveFn(rootValue, args, contextValue, info); - - if (eventStream instanceof Error) { - throw eventStream; - } - - return eventStream; - } catch (error) { - throw (0,_error_locatedError_mjs__WEBPACK_IMPORTED_MODULE_9__.locatedError)(error, fieldNodes, (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_7__.pathToArray)(path)); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/execution/values.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/execution/values.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getArgumentValues": function() { return /* binding */ getArgumentValues; }, -/* harmony export */ "getDirectiveValues": function() { return /* binding */ getDirectiveValues; }, -/* harmony export */ "getVariableValues": function() { return /* binding */ getVariableValues; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _jsutils_printPathArray_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/printPathArray.mjs */ "../../../node_modules/graphql/jsutils/printPathArray.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_coerceInputValue_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/coerceInputValue.mjs */ "../../../node_modules/graphql/utilities/coerceInputValue.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/* harmony import */ var _utilities_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); - - - - - - - - - - - -/** - * Prepares an object map of variableValues of the correct type based on the - * provided variable definitions and arbitrary input. If the input cannot be - * parsed to match the variable definitions, a GraphQLError will be thrown. - * - * Note: The returned value is a plain Object with a prototype, since it is - * exposed to user code. Care should be taken to not pull values from the - * Object prototype. - */ -function getVariableValues(schema, varDefNodes, inputs, options) { - const errors = []; - const maxErrors = - options === null || options === void 0 ? void 0 : options.maxErrors; - - try { - const coerced = coerceVariableValues( - schema, - varDefNodes, - inputs, - (error) => { - if (maxErrors != null && errors.length >= maxErrors) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - 'Too many errors processing variables, error limit reached. Execution aborted.', - ); - } - - errors.push(error); - }, - ); - - if (errors.length === 0) { - return { - coerced, - }; - } - } catch (error) { - errors.push(error); - } - - return { - errors, - }; -} - -function coerceVariableValues(schema, varDefNodes, inputs, onError) { - const coercedValues = {}; - - for (const varDefNode of varDefNodes) { - const varName = varDefNode.variable.name.value; - const varType = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_1__.typeFromAST)(schema, varDefNode.type); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputType)(varType)) { - // Must use input types for variables. This should be caught during - // validation, however is checked again here for safety. - const varTypeStr = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_3__.print)(varDefNode.type); - onError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, - { - nodes: varDefNode.type, - }, - ), - ); - continue; - } - - if (!hasOwnProperty(inputs, varName)) { - if (varDefNode.defaultValue) { - coercedValues[varName] = (0,_utilities_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_4__.valueFromAST)(varDefNode.defaultValue, varType); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(varType)) { - const varTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(varType); - onError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, - { - nodes: varDefNode, - }, - ), - ); - } - - continue; - } - - const value = inputs[varName]; - - if (value === null && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(varType)) { - const varTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(varType); - onError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, - { - nodes: varDefNode, - }, - ), - ); - continue; - } - - coercedValues[varName] = (0,_utilities_coerceInputValue_mjs__WEBPACK_IMPORTED_MODULE_6__.coerceInputValue)( - value, - varType, - (path, invalidValue, error) => { - let prefix = - `Variable "$${varName}" got invalid value ` + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(invalidValue); - - if (path.length > 0) { - prefix += ` at "${varName}${(0,_jsutils_printPathArray_mjs__WEBPACK_IMPORTED_MODULE_7__.printPathArray)(path)}"`; - } - - onError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError(prefix + '; ' + error.message, { - nodes: varDefNode, - originalError: error.originalError, - }), - ); - }, - ); - } - - return coercedValues; -} -/** - * Prepares an object map of argument values given a list of argument - * definitions and list of argument AST nodes. - * - * Note: The returned value is a plain Object with a prototype, since it is - * exposed to user code. Care should be taken to not pull values from the - * Object prototype. - */ - -function getArgumentValues(def, node, variableValues) { - var _node$arguments; - - const coercedValues = {}; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const argumentNodes = - (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 - ? _node$arguments - : []; - const argNodeMap = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_8__.keyMap)(argumentNodes, (arg) => arg.name.value); - - for (const argDef of def.args) { - const name = argDef.name; - const argType = argDef.type; - const argumentNode = argNodeMap[name]; - - if (!argumentNode) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(argType)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Argument "${name}" of required type "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(argType)}" ` + - 'was not provided.', - { - nodes: node, - }, - ); - } - - continue; - } - - const valueNode = argumentNode.value; - let isNull = valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_9__.Kind.NULL; - - if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_9__.Kind.VARIABLE) { - const variableName = valueNode.name.value; - - if ( - variableValues == null || - !hasOwnProperty(variableValues, variableName) - ) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(argType)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Argument "${name}" of required type "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(argType)}" ` + - `was provided the variable "$${variableName}" which was not provided a runtime value.`, - { - nodes: valueNode, - }, - ); - } - - continue; - } - - isNull = variableValues[variableName] == null; - } - - if (isNull && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(argType)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Argument "${name}" of non-null type "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(argType)}" ` + - 'must not be null.', - { - nodes: valueNode, - }, - ); - } - - const coercedValue = (0,_utilities_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_4__.valueFromAST)(valueNode, argType, variableValues); - - if (coercedValue === undefined) { - // Note: ValuesOfCorrectTypeRule validation should catch this before - // execution. This is a runtime check to ensure execution does not - // continue with an invalid argument value. - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Argument "${name}" has invalid value ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_3__.print)(valueNode)}.`, - { - nodes: valueNode, - }, - ); - } - - coercedValues[name] = coercedValue; - } - - return coercedValues; -} -/** - * Prepares an object map of argument values given a directive definition - * and a AST node which may contain directives. Optionally also accepts a map - * of variable values. - * - * If the directive does not exist on the node, returns undefined. - * - * Note: The returned value is a plain Object with a prototype, since it is - * exposed to user code. Care should be taken to not pull values from the - * Object prototype. - */ - -function getDirectiveValues(directiveDef, node, variableValues) { - var _node$directives; - - const directiveNode = - (_node$directives = node.directives) === null || _node$directives === void 0 - ? void 0 - : _node$directives.find( - (directive) => directive.name.value === directiveDef.name, - ); - - if (directiveNode) { - return getArgumentValues(directiveDef, directiveNode, variableValues); - } -} - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/graphql.mjs": -/*!*************************************************!*\ - !*** ../../../node_modules/graphql/graphql.mjs ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "graphql": function() { return /* binding */ graphql; }, -/* harmony export */ "graphqlSync": function() { return /* binding */ graphqlSync; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsutils/isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); -/* harmony import */ var _language_parser_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var _type_validate_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -/* harmony import */ var _validation_validate_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -/* harmony import */ var _execution_execute_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./execution/execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); - - - - - - -/** - * This is the primary entry point function for fulfilling GraphQL operations - * by parsing, validating, and executing a GraphQL document along side a - * GraphQL schema. - * - * More sophisticated GraphQL servers, such as those which persist queries, - * may wish to separate the validation and execution phases to a static time - * tooling step, and a server runtime step. - * - * Accepts either an object with named arguments, or individual arguments: - * - * schema: - * The GraphQL type system to use when validating and executing a query. - * source: - * A GraphQL language formatted string representing the requested operation. - * rootValue: - * The value provided as the first argument to resolver functions on the top - * level type (e.g. the query object type). - * contextValue: - * The context value is provided as an argument to resolver functions after - * field arguments. It is used to pass shared information useful at any point - * during executing this query, for example the currently logged in user and - * connections to databases or other services. - * variableValues: - * A mapping of variable name to runtime value to use for all variables - * defined in the requestString. - * operationName: - * The name of the operation to use if requestString contains multiple - * possible operations. Can be omitted if requestString contains only - * one operation. - * fieldResolver: - * A resolver function to use when one is not provided by the schema. - * If not provided, the default field resolver is used (which looks for a - * value or method on the source value with the field's name). - * typeResolver: - * A type resolver function to use when none is provided by the schema. - * If not provided, the default type resolver is used (which looks for a - * `__typename` field or alternatively calls the `isTypeOf` method). - */ - -function graphql(args) { - // Always return a Promise for a consistent API. - return new Promise((resolve) => resolve(graphqlImpl(args))); -} -/** - * The graphqlSync function also fulfills GraphQL operations by parsing, - * validating, and executing a GraphQL document along side a GraphQL schema. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ - -function graphqlSync(args) { - const result = graphqlImpl(args); // Assert that the execution was synchronous. - - if ((0,_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_0__.isPromise)(result)) { - throw new Error('GraphQL execution failed to complete synchronously.'); - } - - return result; -} - -function graphqlImpl(args) { - // Temporary for v15 to v16 migration. Remove in v17 - arguments.length < 2 || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__.devAssert)( - false, - 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.', - ); - const { - schema, - source, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - typeResolver, - } = args; // Validate Schema - - const schemaValidationErrors = (0,_type_validate_mjs__WEBPACK_IMPORTED_MODULE_2__.validateSchema)(schema); - - if (schemaValidationErrors.length > 0) { - return { - errors: schemaValidationErrors, - }; - } // Parse - - let document; - - try { - document = (0,_language_parser_mjs__WEBPACK_IMPORTED_MODULE_3__.parse)(source); - } catch (syntaxError) { - return { - errors: [syntaxError], - }; - } // Validate - - const validationErrors = (0,_validation_validate_mjs__WEBPACK_IMPORTED_MODULE_4__.validate)(schema, document); - - if (validationErrors.length > 0) { - return { - errors: validationErrors, - }; - } // Execute - - return (0,_execution_execute_mjs__WEBPACK_IMPORTED_MODULE_5__.execute)({ - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - typeResolver, - }); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/index.mjs": -/*!***********************************************!*\ - !*** ../../../node_modules/graphql/index.mjs ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "BREAK": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__.BREAK; }, -/* harmony export */ "BreakingChangeType": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_87__.BreakingChangeType; }, -/* harmony export */ "DEFAULT_DEPRECATION_REASON": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_DEPRECATION_REASON; }, -/* harmony export */ "DangerousChangeType": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_87__.DangerousChangeType; }, -/* harmony export */ "DirectiveLocation": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_19__.DirectiveLocation; }, -/* harmony export */ "ExecutableDefinitionsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_28__.ExecutableDefinitionsRule; }, -/* harmony export */ "FieldsOnCorrectTypeRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_29__.FieldsOnCorrectTypeRule; }, -/* harmony export */ "FragmentsOnCompositeTypesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_30__.FragmentsOnCompositeTypesRule; }, -/* harmony export */ "GRAPHQL_MAX_INT": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GRAPHQL_MAX_INT; }, -/* harmony export */ "GRAPHQL_MIN_INT": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GRAPHQL_MIN_INT; }, -/* harmony export */ "GraphQLBoolean": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLBoolean; }, -/* harmony export */ "GraphQLDeprecatedDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLDeprecatedDirective; }, -/* harmony export */ "GraphQLDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLDirective; }, -/* harmony export */ "GraphQLEnumType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLEnumType; }, -/* harmony export */ "GraphQLError": function() { return /* reexport safe */ _error_index_mjs__WEBPACK_IMPORTED_MODULE_64__.GraphQLError; }, -/* harmony export */ "GraphQLFloat": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLFloat; }, -/* harmony export */ "GraphQLID": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLID; }, -/* harmony export */ "GraphQLIncludeDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLIncludeDirective; }, -/* harmony export */ "GraphQLInputObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLInputObjectType; }, -/* harmony export */ "GraphQLInt": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLInt; }, -/* harmony export */ "GraphQLInterfaceType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLInterfaceType; }, -/* harmony export */ "GraphQLList": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLList; }, -/* harmony export */ "GraphQLNonNull": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLNonNull; }, -/* harmony export */ "GraphQLObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLObjectType; }, -/* harmony export */ "GraphQLScalarType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLScalarType; }, -/* harmony export */ "GraphQLSchema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLSchema; }, -/* harmony export */ "GraphQLSkipDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLSkipDirective; }, -/* harmony export */ "GraphQLSpecifiedByDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLSpecifiedByDirective; }, -/* harmony export */ "GraphQLString": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLString; }, -/* harmony export */ "GraphQLUnionType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLUnionType; }, -/* harmony export */ "Kind": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_18__.Kind; }, -/* harmony export */ "KnownArgumentNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_31__.KnownArgumentNamesRule; }, -/* harmony export */ "KnownDirectivesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_32__.KnownDirectivesRule; }, -/* harmony export */ "KnownFragmentNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_33__.KnownFragmentNamesRule; }, -/* harmony export */ "KnownTypeNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_34__.KnownTypeNamesRule; }, -/* harmony export */ "Lexer": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_13__.Lexer; }, -/* harmony export */ "Location": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_9__.Location; }, -/* harmony export */ "LoneAnonymousOperationRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_35__.LoneAnonymousOperationRule; }, -/* harmony export */ "LoneSchemaDefinitionRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_54__.LoneSchemaDefinitionRule; }, -/* harmony export */ "NoDeprecatedCustomRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_62__.NoDeprecatedCustomRule; }, -/* harmony export */ "NoFragmentCyclesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_36__.NoFragmentCyclesRule; }, -/* harmony export */ "NoSchemaIntrospectionCustomRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_63__.NoSchemaIntrospectionCustomRule; }, -/* harmony export */ "NoUndefinedVariablesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_37__.NoUndefinedVariablesRule; }, -/* harmony export */ "NoUnusedFragmentsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_38__.NoUnusedFragmentsRule; }, -/* harmony export */ "NoUnusedVariablesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_39__.NoUnusedVariablesRule; }, -/* harmony export */ "OperationTypeNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_9__.OperationTypeNode; }, -/* harmony export */ "OverlappingFieldsCanBeMergedRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_40__.OverlappingFieldsCanBeMergedRule; }, -/* harmony export */ "PossibleFragmentSpreadsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_41__.PossibleFragmentSpreadsRule; }, -/* harmony export */ "PossibleTypeExtensionsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_61__.PossibleTypeExtensionsRule; }, -/* harmony export */ "ProvidedRequiredArgumentsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_42__.ProvidedRequiredArgumentsRule; }, -/* harmony export */ "ScalarLeafsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_43__.ScalarLeafsRule; }, -/* harmony export */ "SchemaMetaFieldDef": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.SchemaMetaFieldDef; }, -/* harmony export */ "SingleFieldSubscriptionsRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_44__.SingleFieldSubscriptionsRule; }, -/* harmony export */ "Source": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_10__.Source; }, -/* harmony export */ "Token": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_9__.Token; }, -/* harmony export */ "TokenKind": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_14__.TokenKind; }, -/* harmony export */ "TypeInfo": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_80__.TypeInfo; }, -/* harmony export */ "TypeKind": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.TypeKind; }, -/* harmony export */ "TypeMetaFieldDef": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.TypeMetaFieldDef; }, -/* harmony export */ "TypeNameMetaFieldDef": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.TypeNameMetaFieldDef; }, -/* harmony export */ "UniqueArgumentDefinitionNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_59__.UniqueArgumentDefinitionNamesRule; }, -/* harmony export */ "UniqueArgumentNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_45__.UniqueArgumentNamesRule; }, -/* harmony export */ "UniqueDirectiveNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_60__.UniqueDirectiveNamesRule; }, -/* harmony export */ "UniqueDirectivesPerLocationRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_46__.UniqueDirectivesPerLocationRule; }, -/* harmony export */ "UniqueEnumValueNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_57__.UniqueEnumValueNamesRule; }, -/* harmony export */ "UniqueFieldDefinitionNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_58__.UniqueFieldDefinitionNamesRule; }, -/* harmony export */ "UniqueFragmentNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_47__.UniqueFragmentNamesRule; }, -/* harmony export */ "UniqueInputFieldNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_48__.UniqueInputFieldNamesRule; }, -/* harmony export */ "UniqueOperationNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_49__.UniqueOperationNamesRule; }, -/* harmony export */ "UniqueOperationTypesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_55__.UniqueOperationTypesRule; }, -/* harmony export */ "UniqueTypeNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_56__.UniqueTypeNamesRule; }, -/* harmony export */ "UniqueVariableNamesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_50__.UniqueVariableNamesRule; }, -/* harmony export */ "ValidationContext": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_26__.ValidationContext; }, -/* harmony export */ "ValuesOfCorrectTypeRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_51__.ValuesOfCorrectTypeRule; }, -/* harmony export */ "VariablesAreInputTypesRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_52__.VariablesAreInputTypesRule; }, -/* harmony export */ "VariablesInAllowedPositionRule": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_53__.VariablesInAllowedPositionRule; }, -/* harmony export */ "__Directive": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__Directive; }, -/* harmony export */ "__DirectiveLocation": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__DirectiveLocation; }, -/* harmony export */ "__EnumValue": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__EnumValue; }, -/* harmony export */ "__Field": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__Field; }, -/* harmony export */ "__InputValue": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__InputValue; }, -/* harmony export */ "__Schema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__Schema; }, -/* harmony export */ "__Type": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__Type; }, -/* harmony export */ "__TypeKind": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.__TypeKind; }, -/* harmony export */ "assertAbstractType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertAbstractType; }, -/* harmony export */ "assertCompositeType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertCompositeType; }, -/* harmony export */ "assertDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.assertDirective; }, -/* harmony export */ "assertEnumType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertEnumType; }, -/* harmony export */ "assertEnumValueName": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_8__.assertEnumValueName; }, -/* harmony export */ "assertInputObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertInputObjectType; }, -/* harmony export */ "assertInputType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertInputType; }, -/* harmony export */ "assertInterfaceType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertInterfaceType; }, -/* harmony export */ "assertLeafType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertLeafType; }, -/* harmony export */ "assertListType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertListType; }, -/* harmony export */ "assertName": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_8__.assertName; }, -/* harmony export */ "assertNamedType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertNamedType; }, -/* harmony export */ "assertNonNullType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertNonNullType; }, -/* harmony export */ "assertNullableType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertNullableType; }, -/* harmony export */ "assertObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertObjectType; }, -/* harmony export */ "assertOutputType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertOutputType; }, -/* harmony export */ "assertScalarType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertScalarType; }, -/* harmony export */ "assertSchema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_3__.assertSchema; }, -/* harmony export */ "assertType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertType; }, -/* harmony export */ "assertUnionType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertUnionType; }, -/* harmony export */ "assertValidName": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_86__.assertValidName; }, -/* harmony export */ "assertValidSchema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_7__.assertValidSchema; }, -/* harmony export */ "assertWrappingType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.assertWrappingType; }, -/* harmony export */ "astFromValue": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_79__.astFromValue; }, -/* harmony export */ "buildASTSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_72__.buildASTSchema; }, -/* harmony export */ "buildClientSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_71__.buildClientSchema; }, -/* harmony export */ "buildSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_72__.buildSchema; }, -/* harmony export */ "coerceInputValue": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_81__.coerceInputValue; }, -/* harmony export */ "concatAST": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_82__.concatAST; }, -/* harmony export */ "createSourceEventStream": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_24__.createSourceEventStream; }, -/* harmony export */ "defaultFieldResolver": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_21__.defaultFieldResolver; }, -/* harmony export */ "defaultTypeResolver": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_21__.defaultTypeResolver; }, -/* harmony export */ "doTypesOverlap": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_85__.doTypesOverlap; }, -/* harmony export */ "execute": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_21__.execute; }, -/* harmony export */ "executeSync": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_21__.executeSync; }, -/* harmony export */ "extendSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_73__.extendSchema; }, -/* harmony export */ "findBreakingChanges": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_87__.findBreakingChanges; }, -/* harmony export */ "findDangerousChanges": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_87__.findDangerousChanges; }, -/* harmony export */ "formatError": function() { return /* reexport safe */ _error_index_mjs__WEBPACK_IMPORTED_MODULE_64__.formatError; }, -/* harmony export */ "getArgumentValues": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_23__.getArgumentValues; }, -/* harmony export */ "getDirectiveValues": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_23__.getDirectiveValues; }, -/* harmony export */ "getEnterLeaveForKind": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__.getEnterLeaveForKind; }, -/* harmony export */ "getIntrospectionQuery": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_67__.getIntrospectionQuery; }, -/* harmony export */ "getLocation": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_11__.getLocation; }, -/* harmony export */ "getNamedType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.getNamedType; }, -/* harmony export */ "getNullableType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.getNullableType; }, -/* harmony export */ "getOperationAST": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_68__.getOperationAST; }, -/* harmony export */ "getOperationRootType": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_69__.getOperationRootType; }, -/* harmony export */ "getVariableValues": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_23__.getVariableValues; }, -/* harmony export */ "getVisitFn": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__.getVisitFn; }, -/* harmony export */ "graphql": function() { return /* reexport safe */ _graphql_mjs__WEBPACK_IMPORTED_MODULE_1__.graphql; }, -/* harmony export */ "graphqlSync": function() { return /* reexport safe */ _graphql_mjs__WEBPACK_IMPORTED_MODULE_1__.graphqlSync; }, -/* harmony export */ "introspectionFromSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_70__.introspectionFromSchema; }, -/* harmony export */ "introspectionTypes": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.introspectionTypes; }, -/* harmony export */ "isAbstractType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isAbstractType; }, -/* harmony export */ "isCompositeType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isCompositeType; }, -/* harmony export */ "isConstValueNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isConstValueNode; }, -/* harmony export */ "isDefinitionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isDefinitionNode; }, -/* harmony export */ "isDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isDirective; }, -/* harmony export */ "isEnumType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isEnumType; }, -/* harmony export */ "isEqualType": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_85__.isEqualType; }, -/* harmony export */ "isExecutableDefinitionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isExecutableDefinitionNode; }, -/* harmony export */ "isInputObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType; }, -/* harmony export */ "isInputType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputType; }, -/* harmony export */ "isInterfaceType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType; }, -/* harmony export */ "isIntrospectionType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__.isIntrospectionType; }, -/* harmony export */ "isLeafType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isLeafType; }, -/* harmony export */ "isListType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isListType; }, -/* harmony export */ "isNamedType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isNamedType; }, -/* harmony export */ "isNonNullType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType; }, -/* harmony export */ "isNullableType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isNullableType; }, -/* harmony export */ "isObjectType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType; }, -/* harmony export */ "isOutputType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isOutputType; }, -/* harmony export */ "isRequiredArgument": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredArgument; }, -/* harmony export */ "isRequiredInputField": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredInputField; }, -/* harmony export */ "isScalarType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isScalarType; }, -/* harmony export */ "isSchema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_3__.isSchema; }, -/* harmony export */ "isSelectionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isSelectionNode; }, -/* harmony export */ "isSpecifiedDirective": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isSpecifiedDirective; }, -/* harmony export */ "isSpecifiedScalarType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.isSpecifiedScalarType; }, -/* harmony export */ "isType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isType; }, -/* harmony export */ "isTypeDefinitionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isTypeDefinitionNode; }, -/* harmony export */ "isTypeExtensionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isTypeExtensionNode; }, -/* harmony export */ "isTypeNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isTypeNode; }, -/* harmony export */ "isTypeSubTypeOf": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_85__.isTypeSubTypeOf; }, -/* harmony export */ "isTypeSystemDefinitionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isTypeSystemDefinitionNode; }, -/* harmony export */ "isTypeSystemExtensionNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isTypeSystemExtensionNode; }, -/* harmony export */ "isUnionType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isUnionType; }, -/* harmony export */ "isValidNameError": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_86__.isValidNameError; }, -/* harmony export */ "isValueNode": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__.isValueNode; }, -/* harmony export */ "isWrappingType": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.isWrappingType; }, -/* harmony export */ "lexicographicSortSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_74__.lexicographicSortSchema; }, -/* harmony export */ "locatedError": function() { return /* reexport safe */ _error_index_mjs__WEBPACK_IMPORTED_MODULE_66__.locatedError; }, -/* harmony export */ "parse": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_15__.parse; }, -/* harmony export */ "parseConstValue": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_15__.parseConstValue; }, -/* harmony export */ "parseType": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_15__.parseType; }, -/* harmony export */ "parseValue": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_15__.parseValue; }, -/* harmony export */ "print": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_16__.print; }, -/* harmony export */ "printError": function() { return /* reexport safe */ _error_index_mjs__WEBPACK_IMPORTED_MODULE_64__.printError; }, -/* harmony export */ "printIntrospectionSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_75__.printIntrospectionSchema; }, -/* harmony export */ "printLocation": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_12__.printLocation; }, -/* harmony export */ "printSchema": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_75__.printSchema; }, -/* harmony export */ "printSourceLocation": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_12__.printSourceLocation; }, -/* harmony export */ "printType": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_75__.printType; }, -/* harmony export */ "resolveObjMapThunk": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.resolveObjMapThunk; }, -/* harmony export */ "resolveReadonlyArrayThunk": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__.resolveReadonlyArrayThunk; }, -/* harmony export */ "responsePathAsArray": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_22__.pathToArray; }, -/* harmony export */ "separateOperations": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_83__.separateOperations; }, -/* harmony export */ "specifiedDirectives": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__.specifiedDirectives; }, -/* harmony export */ "specifiedRules": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_27__.specifiedRules; }, -/* harmony export */ "specifiedScalarTypes": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__.specifiedScalarTypes; }, -/* harmony export */ "stripIgnoredCharacters": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_84__.stripIgnoredCharacters; }, -/* harmony export */ "subscribe": function() { return /* reexport safe */ _execution_index_mjs__WEBPACK_IMPORTED_MODULE_24__.subscribe; }, -/* harmony export */ "syntaxError": function() { return /* reexport safe */ _error_index_mjs__WEBPACK_IMPORTED_MODULE_65__.syntaxError; }, -/* harmony export */ "typeFromAST": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_76__.typeFromAST; }, -/* harmony export */ "validate": function() { return /* reexport safe */ _validation_index_mjs__WEBPACK_IMPORTED_MODULE_25__.validate; }, -/* harmony export */ "validateSchema": function() { return /* reexport safe */ _type_index_mjs__WEBPACK_IMPORTED_MODULE_7__.validateSchema; }, -/* harmony export */ "valueFromAST": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_77__.valueFromAST; }, -/* harmony export */ "valueFromASTUntyped": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_78__.valueFromASTUntyped; }, -/* harmony export */ "version": function() { return /* reexport safe */ _version_mjs__WEBPACK_IMPORTED_MODULE_0__.version; }, -/* harmony export */ "versionInfo": function() { return /* reexport safe */ _version_mjs__WEBPACK_IMPORTED_MODULE_0__.versionInfo; }, -/* harmony export */ "visit": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__.visit; }, -/* harmony export */ "visitInParallel": function() { return /* reexport safe */ _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__.visitInParallel; }, -/* harmony export */ "visitWithTypeInfo": function() { return /* reexport safe */ _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_80__.visitWithTypeInfo; } -/* harmony export */ }); -/* harmony import */ var _version_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.mjs */ "../../../node_modules/graphql/version.mjs"); -/* harmony import */ var _graphql_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graphql.mjs */ "../../../node_modules/graphql/graphql.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -/* harmony import */ var _type_index_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./type/index.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/source.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/location.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/printLocation.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -/* harmony import */ var _language_index_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./language/index.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -/* harmony import */ var _execution_index_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); -/* harmony import */ var _execution_index_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); -/* harmony import */ var _execution_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/execution/values.mjs"); -/* harmony import */ var _execution_index_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./execution/index.mjs */ "../../../node_modules/graphql/execution/subscribe.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs"); -/* harmony import */ var _validation_index_mjs__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./validation/index.mjs */ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs"); -/* harmony import */ var _error_index_mjs__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./error/index.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _error_index_mjs__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./error/index.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); -/* harmony import */ var _error_index_mjs__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./error/index.mjs */ "../../../node_modules/graphql/error/locatedError.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/getOperationAST.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/getOperationRootType.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/buildClientSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/buildASTSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/printSchema.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/coerceInputValue.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/concatAST.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/separateOperations.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/assertValidName.mjs"); -/* harmony import */ var _utilities_index_mjs__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./utilities/index.mjs */ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs"); -/** - * GraphQL.js provides a reference implementation for the GraphQL specification - * but is also a useful utility for operating on GraphQL files and building - * sophisticated tools. - * - * This primary module exports a general purpose function for fulfilling all - * steps of the GraphQL specification in a single operation, but also includes - * utilities for every part of the GraphQL specification: - * - * - Parsing the GraphQL language. - * - Building a GraphQL type schema. - * - Validating a GraphQL request against a type schema. - * - Executing a GraphQL request against a type schema. - * - * This also includes utility functions for operating on GraphQL types and - * GraphQL documents to facilitate building tools. - * - * You may also import from each sub-directory directly. For example, the - * following two import statements are equivalent: - * - * ```ts - * import { parse } from 'graphql'; - * import { parse } from 'graphql/language'; - * ``` - * - * @packageDocumentation - */ -// The GraphQL.js version info. - // The primary entry point into fulfilling a GraphQL request. - - // Create and operate on GraphQL type definitions and schema. - - -// Parse and operate on GraphQL language source files. - -// Execute GraphQL queries. - -// Validate GraphQL documents. - -// Create, format, and print GraphQL errors. - -// Utilities for operating on GraphQL type schema and parsed sources. - - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/Path.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/Path.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "addPath": function() { return /* binding */ addPath; }, -/* harmony export */ "pathToArray": function() { return /* binding */ pathToArray; } -/* harmony export */ }); -/** - * Given a Path and a key, return a new Path containing the new key. - */ -function addPath(prev, key, typename) { - return { - prev, - key, - typename, - }; -} -/** - * Given a Path, return an Array of the path keys. - */ - -function pathToArray(path) { - const flattened = []; - let curr = path; - - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - - return flattened.reverse(); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/devAssert.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/devAssert.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "devAssert": function() { return /* binding */ devAssert; } -/* harmony export */ }); -function devAssert(condition, message) { - const booleanCondition = Boolean(condition); - - if (!booleanCondition) { - throw new Error(message); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/didYouMean.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/didYouMean.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "didYouMean": function() { return /* binding */ didYouMean; } -/* harmony export */ }); -const MAX_SUGGESTIONS = 5; -/** - * Given [ A, B, C ] return ' Did you mean A, B, or C?'. - */ - -function didYouMean(firstArg, secondArg) { - const [subMessage, suggestionsArg] = secondArg - ? [firstArg, secondArg] - : [undefined, firstArg]; - let message = ' Did you mean '; - - if (subMessage) { - message += subMessage + ' '; - } - - const suggestions = suggestionsArg.map((x) => `"${x}"`); - - switch (suggestions.length) { - case 0: - return ''; - - case 1: - return message + suggestions[0] + '?'; - - case 2: - return message + suggestions[0] + ' or ' + suggestions[1] + '?'; - } - - const selected = suggestions.slice(0, MAX_SUGGESTIONS); - const lastItem = selected.pop(); - return message + selected.join(', ') + ', or ' + lastItem + '?'; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/groupBy.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/groupBy.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "groupBy": function() { return /* binding */ groupBy; } -/* harmony export */ }); -/** - * Groups array items into a Map, given a function to produce grouping key. - */ -function groupBy(list, keyFn) { - const result = new Map(); - - for (const item of list) { - const key = keyFn(item); - const group = result.get(key); - - if (group === undefined) { - result.set(key, [item]); - } else { - group.push(item); - } - } - - return result; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/identityFunc.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/identityFunc.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "identityFunc": function() { return /* binding */ identityFunc; } -/* harmony export */ }); -/** - * Returns the first argument it receives. - */ -function identityFunc(x) { - return x; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/inspect.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/inspect.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "inspect": function() { return /* binding */ inspect; } -/* harmony export */ }); -const MAX_ARRAY_LENGTH = 10; -const MAX_RECURSIVE_DEPTH = 2; -/** - * Used to print values in error messages. - */ - -function inspect(value) { - return formatValue(value, []); -} - -function formatValue(value, seenValues) { - switch (typeof value) { - case 'string': - return JSON.stringify(value); - - case 'function': - return value.name ? `[function ${value.name}]` : '[function]'; - - case 'object': - return formatObjectValue(value, seenValues); - - default: - return String(value); - } -} - -function formatObjectValue(value, previouslySeenValues) { - if (value === null) { - return 'null'; - } - - if (previouslySeenValues.includes(value)) { - return '[Circular]'; - } - - const seenValues = [...previouslySeenValues, value]; - - if (isJSONable(value)) { - const jsonValue = value.toJSON(); // check for infinite recursion - - if (jsonValue !== value) { - return typeof jsonValue === 'string' - ? jsonValue - : formatValue(jsonValue, seenValues); - } - } else if (Array.isArray(value)) { - return formatArray(value, seenValues); - } - - return formatObject(value, seenValues); -} - -function isJSONable(value) { - return typeof value.toJSON === 'function'; -} - -function formatObject(object, seenValues) { - const entries = Object.entries(object); - - if (entries.length === 0) { - return '{}'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[' + getObjectTag(object) + ']'; - } - - const properties = entries.map( - ([key, value]) => key + ': ' + formatValue(value, seenValues), - ); - return '{ ' + properties.join(', ') + ' }'; -} - -function formatArray(array, seenValues) { - if (array.length === 0) { - return '[]'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[Array]'; - } - - const len = Math.min(MAX_ARRAY_LENGTH, array.length); - const remaining = array.length - len; - const items = []; - - for (let i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - - if (remaining === 1) { - items.push('... 1 more item'); - } else if (remaining > 1) { - items.push(`... ${remaining} more items`); - } - - return '[' + items.join(', ') + ']'; -} - -function getObjectTag(object) { - const tag = Object.prototype.toString - .call(object) - .replace(/^\[object /, '') - .replace(/]$/, ''); - - if (tag === 'Object' && typeof object.constructor === 'function') { - const name = object.constructor.name; - - if (typeof name === 'string' && name !== '') { - return name; - } - } - - return tag; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/instanceOf.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/instanceOf.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "instanceOf": function() { return /* binding */ instanceOf; } -/* harmony export */ }); -/* harmony import */ var _inspect_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); - -/** - * A replacement for instanceof which includes an error warning when multi-realm - * constructors are detected. - * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production - * See: https://webpack.js.org/guides/production/ - */ - -const instanceOf = - /* c8 ignore next 6 */ - // FIXME: https://github.com/graphql/graphql-js/issues/2317 - // eslint-disable-next-line no-undef - false - ? 0 - : function instanceOf(value, constructor) { - if (value instanceof constructor) { - return true; - } - - if (typeof value === 'object' && value !== null) { - var _value$constructor; - - // Prefer Symbol.toStringTag since it is immune to minification. - const className = constructor.prototype[Symbol.toStringTag]; - const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009 - ? value[Symbol.toStringTag] - : (_value$constructor = value.constructor) === null || - _value$constructor === void 0 - ? void 0 - : _value$constructor.name; - - if (className === valueClassName) { - const stringifiedValue = (0,_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(value); - throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm. - -Ensure that there is only one instance of "graphql" in the node_modules -directory. If different versions of "graphql" are the dependencies of other -relied on modules, use "resolutions" to ensure only one version is installed. - -https://yarnpkg.com/en/docs/selective-version-resolutions - -Duplicate "graphql" modules cannot be used at the same time since different -versions may have different capabilities and behavior. The data from one -version used in the function from another could produce confusing and -spurious results.`); - } - } - - return false; - }; - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/invariant.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/invariant.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "invariant": function() { return /* binding */ invariant; } -/* harmony export */ }); -function invariant(condition, message) { - const booleanCondition = Boolean(condition); - - if (!booleanCondition) { - throw new Error( - message != null ? message : 'Unexpected invariant triggered.', - ); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isAsyncIterable.mjs": -/*!*****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isAsyncIterable.mjs ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isAsyncIterable": function() { return /* binding */ isAsyncIterable; } -/* harmony export */ }); -/** - * Returns true if the provided object implements the AsyncIterator protocol via - * implementing a `Symbol.asyncIterator` method. - */ -function isAsyncIterable(maybeAsyncIterable) { - return ( - typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 - ? void 0 - : maybeAsyncIterable[Symbol.asyncIterator]) === 'function' - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isIterableObject.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isIterableObject.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isIterableObject": function() { return /* binding */ isIterableObject; } -/* harmony export */ }); -/** - * Returns true if the provided object is an Object (i.e. not a string literal) - * and implements the Iterator protocol. - * - * This may be used in place of [Array.isArray()][isArray] to determine if - * an object should be iterated-over e.g. Array, Map, Set, Int8Array, - * TypedArray, etc. but excludes string literals. - * - * @example - * ```ts - * isIterableObject([ 1, 2, 3 ]) // true - * isIterableObject(new Map()) // true - * isIterableObject('ABC') // false - * isIterableObject({ key: 'value' }) // false - * isIterableObject({ length: 1, 0: 'Alpha' }) // false - * ``` - */ -function isIterableObject(maybeIterable) { - return ( - typeof maybeIterable === 'object' && - typeof (maybeIterable === null || maybeIterable === void 0 - ? void 0 - : maybeIterable[Symbol.iterator]) === 'function' - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isObjectLike.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isObjectLike.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isObjectLike": function() { return /* binding */ isObjectLike; } -/* harmony export */ }); -/** - * Return true if `value` is object-like. A value is object-like if it's not - * `null` and has a `typeof` result of "object". - */ -function isObjectLike(value) { - return typeof value == 'object' && value !== null; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/isPromise.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/isPromise.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isPromise": function() { return /* binding */ isPromise; } -/* harmony export */ }); -/** - * Returns true if the value acts like a Promise, i.e. has a "then" function, - * otherwise returns false. - */ -function isPromise(value) { - return ( - typeof (value === null || value === void 0 ? void 0 : value.then) === - 'function' - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/keyMap.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/keyMap.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "keyMap": function() { return /* binding */ keyMap; } -/* harmony export */ }); -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * for each value in the array. - * - * This provides a convenient lookup for the array items if the key function - * produces unique results. - * ```ts - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * const entriesByName = keyMap( - * phoneBook, - * entry => entry.name - * ) - * - * // { - * // Jon: { name: 'Jon', num: '555-1234' }, - * // Jenny: { name: 'Jenny', num: '867-5309' } - * // } - * - * const jennyEntry = entriesByName['Jenny'] - * - * // { name: 'Jenny', num: '857-6309' } - * ``` - */ -function keyMap(list, keyFn) { - const result = Object.create(null); - - for (const item of list) { - result[keyFn(item)] = item; - } - - return result; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/keyValMap.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/keyValMap.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "keyValMap": function() { return /* binding */ keyValMap; } -/* harmony export */ }); -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * and a function to produce the values from each item in the array. - * ```ts - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: '555-1234', Jenny: '867-5309' } - * const phonesByName = keyValMap( - * phoneBook, - * entry => entry.name, - * entry => entry.num - * ) - * ``` - */ -function keyValMap(list, keyFn, valFn) { - const result = Object.create(null); - - for (const item of list) { - result[keyFn(item)] = valFn(item); - } - - return result; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/mapValue.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/mapValue.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "mapValue": function() { return /* binding */ mapValue; } -/* harmony export */ }); -/** - * Creates an object map with the same keys as `map` and values generated by - * running each value of `map` thru `fn`. - */ -function mapValue(map, fn) { - const result = Object.create(null); - - for (const key of Object.keys(map)) { - result[key] = fn(map[key], key); - } - - return result; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/memoize3.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/memoize3.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "memoize3": function() { return /* binding */ memoize3; } -/* harmony export */ }); -/** - * Memoizes the provided three-argument function. - */ -function memoize3(fn) { - let cache0; - return function memoized(a1, a2, a3) { - if (cache0 === undefined) { - cache0 = new WeakMap(); - } - - let cache1 = cache0.get(a1); - - if (cache1 === undefined) { - cache1 = new WeakMap(); - cache0.set(a1, cache1); - } - - let cache2 = cache1.get(a2); - - if (cache2 === undefined) { - cache2 = new WeakMap(); - cache1.set(a2, cache2); - } - - let fnResult = cache2.get(a3); - - if (fnResult === undefined) { - fnResult = fn(a1, a2, a3); - cache2.set(a3, fnResult); - } - - return fnResult; - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/naturalCompare.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/naturalCompare.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "naturalCompare": function() { return /* binding */ naturalCompare; } -/* harmony export */ }); -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -function naturalCompare(aStr, bStr) { - let aIndex = 0; - let bIndex = 0; - - while (aIndex < aStr.length && bIndex < bStr.length) { - let aChar = aStr.charCodeAt(aIndex); - let bChar = bStr.charCodeAt(bIndex); - - if (isDigit(aChar) && isDigit(bChar)) { - let aNum = 0; - - do { - ++aIndex; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIndex); - } while (isDigit(aChar) && aNum > 0); - - let bNum = 0; - - do { - ++bIndex; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIndex); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - - if (aChar > bChar) { - return 1; - } - - ++aIndex; - ++bIndex; - } - } - - return aStr.length - bStr.length; -} -const DIGIT_0 = 48; -const DIGIT_9 = 57; - -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/printPathArray.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/printPathArray.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "printPathArray": function() { return /* binding */ printPathArray; } -/* harmony export */ }); -/** - * Build a string describing the path. - */ -function printPathArray(path) { - return path - .map((key) => - typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key, - ) - .join(''); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/promiseForObject.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/promiseForObject.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "promiseForObject": function() { return /* binding */ promiseForObject; } -/* harmony export */ }); -/** - * This function transforms a JS object `ObjMap>` into - * a `Promise>` - * - * This is akin to bluebird's `Promise.props`, but implemented only using - * `Promise.all` so it will work with any implementation of ES6 promises. - */ -function promiseForObject(object) { - return Promise.all(Object.values(object)).then((resolvedValues) => { - const resolvedObject = Object.create(null); - - for (const [i, key] of Object.keys(object).entries()) { - resolvedObject[key] = resolvedValues[i]; - } - - return resolvedObject; - }); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/promiseReduce.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/promiseReduce.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "promiseReduce": function() { return /* binding */ promiseReduce; } -/* harmony export */ }); -/* harmony import */ var _isPromise_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPromise.mjs */ "../../../node_modules/graphql/jsutils/isPromise.mjs"); - - -/** - * Similar to Array.prototype.reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - */ -function promiseReduce(values, callbackFn, initialValue) { - let accumulator = initialValue; - - for (const value of values) { - accumulator = (0,_isPromise_mjs__WEBPACK_IMPORTED_MODULE_0__.isPromise)(accumulator) - ? accumulator.then((resolved) => callbackFn(resolved, value)) - : callbackFn(accumulator, value); - } - - return accumulator; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/suggestionList.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/suggestionList.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "suggestionList": function() { return /* binding */ suggestionList; } -/* harmony export */ }); -/* harmony import */ var _naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); - -/** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - */ - -function suggestionList(input, options) { - const optionsByDistance = Object.create(null); - const lexicalDistance = new LexicalDistance(input); - const threshold = Math.floor(input.length * 0.4) + 1; - - for (const option of options) { - const distance = lexicalDistance.measure(option, threshold); - - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort((a, b) => { - const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : (0,_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_0__.naturalCompare)(a, b); - }); -} -/** - * Computes the lexical distance between strings A and B. - * - * The "distance" between two strings is given by counting the minimum number - * of edits needed to transform string A into string B. An edit can be an - * insertion, deletion, or substitution of a single character, or a swap of two - * adjacent characters. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1. - * - * This distance can be useful for detecting typos in input or sorting - */ - -class LexicalDistance { - constructor(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [ - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - ]; - } - - measure(option, threshold) { - if (this._input === option) { - return 0; - } - - const optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - let a = stringToArray(optionLowerCase); - let b = this._inputArray; - - if (a.length < b.length) { - const tmp = a; - a = b; - b = tmp; - } - - const aLength = a.length; - const bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - const rows = this._rows; - - for (let j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (let i = 1; i <= aLength; i++) { - const upRow = rows[(i - 1) % 3]; - const currentRow = rows[i % 3]; - let smallestCell = (currentRow[0] = i); - - for (let j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - let currentCell = Math.min( - upRow[j] + 1, // delete - currentRow[j - 1] + 1, // insert - upRow[j - 1] + cost, // substitute - ); - - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - // transposition - const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - if (smallestCell > threshold) { - return undefined; - } - } - - const distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - } -} - -function stringToArray(str) { - const strLength = str.length; - const array = new Array(strLength); - - for (let i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - - return array; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/toError.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/toError.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "toError": function() { return /* binding */ toError; } -/* harmony export */ }); -/* harmony import */ var _inspect_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); - -/** - * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. - */ - -function toError(thrownValue) { - return thrownValue instanceof Error - ? thrownValue - : new NonErrorThrown(thrownValue); -} - -class NonErrorThrown extends Error { - constructor(thrownValue) { - super('Unexpected error value: ' + (0,_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(thrownValue)); - this.name = 'NonErrorThrown'; - this.thrownValue = thrownValue; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/jsutils/toObjMap.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/jsutils/toObjMap.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "toObjMap": function() { return /* binding */ toObjMap; } -/* harmony export */ }); -function toObjMap(obj) { - if (obj == null) { - return Object.create(null); - } - - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - const map = Object.create(null); - - for (const [key, value] of Object.entries(obj)) { - map[key] = value; - } - - return map; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/ast.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/language/ast.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Location": function() { return /* binding */ Location; }, -/* harmony export */ "OperationTypeNode": function() { return /* binding */ OperationTypeNode; }, -/* harmony export */ "QueryDocumentKeys": function() { return /* binding */ QueryDocumentKeys; }, -/* harmony export */ "Token": function() { return /* binding */ Token; }, -/* harmony export */ "isNode": function() { return /* binding */ isNode; } -/* harmony export */ }); -/** - * Contains a range of UTF-8 character offsets and token references that - * identify the region of the source from which the AST derived. - */ -class Location { - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The Token at which this Node begins. - */ - - /** - * The Token at which this Node ends. - */ - - /** - * The Source document the AST represents. - */ - constructor(startToken, endToken, source) { - this.start = startToken.start; - this.end = endToken.end; - this.startToken = startToken; - this.endToken = endToken; - this.source = source; - } - - get [Symbol.toStringTag]() { - return 'Location'; - } - - toJSON() { - return { - start: this.start, - end: this.end, - }; - } -} -/** - * Represents a range of characters represented by a lexical token - * within a Source. - */ - -class Token { - /** - * The kind of Token. - */ - - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The 1-indexed line number on which this Token appears. - */ - - /** - * The 1-indexed column number at which this Token begins. - */ - - /** - * For non-punctuation tokens, represents the interpreted value of the token. - * - * Note: is undefined for punctuation tokens, but typed as string for - * convenience in the parser. - */ - - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - constructor(kind, start, end, line, column, value) { - this.kind = kind; - this.start = start; - this.end = end; - this.line = line; - this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - - this.value = value; - this.prev = null; - this.next = null; - } - - get [Symbol.toStringTag]() { - return 'Token'; - } - - toJSON() { - return { - kind: this.kind, - value: this.value, - line: this.line, - column: this.column, - }; - } -} -/** - * The list of all possible AST node types. - */ - -/** - * @internal - */ -const QueryDocumentKeys = { - Name: [], - Document: ['definitions'], - OperationDefinition: [ - 'name', - 'variableDefinitions', - 'directives', - 'selectionSet', - ], - VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], - Variable: ['name'], - SelectionSet: ['selections'], - Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], - Argument: ['name', 'value'], - FragmentSpread: ['name', 'directives'], - InlineFragment: ['typeCondition', 'directives', 'selectionSet'], - FragmentDefinition: [ - 'name', // Note: fragment variable definitions are deprecated and will removed in v17.0.0 - 'variableDefinitions', - 'typeCondition', - 'directives', - 'selectionSet', - ], - IntValue: [], - FloatValue: [], - StringValue: [], - BooleanValue: [], - NullValue: [], - EnumValue: [], - ListValue: ['values'], - ObjectValue: ['fields'], - ObjectField: ['name', 'value'], - Directive: ['name', 'arguments'], - NamedType: ['name'], - ListType: ['type'], - NonNullType: ['type'], - SchemaDefinition: ['description', 'directives', 'operationTypes'], - OperationTypeDefinition: ['type'], - ScalarTypeDefinition: ['description', 'name', 'directives'], - ObjectTypeDefinition: [ - 'description', - 'name', - 'interfaces', - 'directives', - 'fields', - ], - FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], - InputValueDefinition: [ - 'description', - 'name', - 'type', - 'defaultValue', - 'directives', - ], - InterfaceTypeDefinition: [ - 'description', - 'name', - 'interfaces', - 'directives', - 'fields', - ], - UnionTypeDefinition: ['description', 'name', 'directives', 'types'], - EnumTypeDefinition: ['description', 'name', 'directives', 'values'], - EnumValueDefinition: ['description', 'name', 'directives'], - InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], - DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], - SchemaExtension: ['directives', 'operationTypes'], - ScalarTypeExtension: ['name', 'directives'], - ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], - InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'], - UnionTypeExtension: ['name', 'directives', 'types'], - EnumTypeExtension: ['name', 'directives', 'values'], - InputObjectTypeExtension: ['name', 'directives', 'fields'], -}; -const kindValues = new Set(Object.keys(QueryDocumentKeys)); -/** - * @internal - */ - -function isNode(maybeNode) { - const maybeKind = - maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind; - return typeof maybeKind === 'string' && kindValues.has(maybeKind); -} -/** Name */ - -let OperationTypeNode; - -(function (OperationTypeNode) { - OperationTypeNode['QUERY'] = 'query'; - OperationTypeNode['MUTATION'] = 'mutation'; - OperationTypeNode['SUBSCRIPTION'] = 'subscription'; -})(OperationTypeNode || (OperationTypeNode = {})); - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/blockString.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/language/blockString.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "dedentBlockStringLines": function() { return /* binding */ dedentBlockStringLines; }, -/* harmony export */ "isPrintableAsBlockString": function() { return /* binding */ isPrintableAsBlockString; }, -/* harmony export */ "printBlockString": function() { return /* binding */ printBlockString; } -/* harmony export */ }); -/* harmony import */ var _characterClasses_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); - -/** - * Produces the value of a block string from its parsed raw value, similar to - * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. - * - * This implements the GraphQL spec's BlockStringValue() static algorithm. - * - * @internal - */ - -function dedentBlockStringLines(lines) { - var _firstNonEmptyLine2; - - let commonIndent = Number.MAX_SAFE_INTEGER; - let firstNonEmptyLine = null; - let lastNonEmptyLine = -1; - - for (let i = 0; i < lines.length; ++i) { - var _firstNonEmptyLine; - - const line = lines[i]; - const indent = leadingWhitespace(line); - - if (indent === line.length) { - continue; // skip empty lines - } - - firstNonEmptyLine = - (_firstNonEmptyLine = firstNonEmptyLine) !== null && - _firstNonEmptyLine !== void 0 - ? _firstNonEmptyLine - : i; - lastNonEmptyLine = i; - - if (i !== 0 && indent < commonIndent) { - commonIndent = indent; - } - } - - return lines // Remove common indentation from all lines but first. - .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) // Remove leading and trailing blank lines. - .slice( - (_firstNonEmptyLine2 = firstNonEmptyLine) !== null && - _firstNonEmptyLine2 !== void 0 - ? _firstNonEmptyLine2 - : 0, - lastNonEmptyLine + 1, - ); -} - -function leadingWhitespace(str) { - let i = 0; - - while (i < str.length && (0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_0__.isWhiteSpace)(str.charCodeAt(i))) { - ++i; - } - - return i; -} -/** - * @internal - */ - -function isPrintableAsBlockString(value) { - if (value === '') { - return true; // empty string is printable - } - - let isEmptyLine = true; - let hasIndent = false; - let hasCommonIndent = true; - let seenNonEmptyLine = false; - - for (let i = 0; i < value.length; ++i) { - switch (value.codePointAt(i)) { - case 0x0000: - case 0x0001: - case 0x0002: - case 0x0003: - case 0x0004: - case 0x0005: - case 0x0006: - case 0x0007: - case 0x0008: - case 0x000b: - case 0x000c: - case 0x000e: - case 0x000f: - return false; - // Has non-printable characters - - case 0x000d: - // \r - return false; - // Has \r or \r\n which will be replaced as \n - - case 10: - // \n - if (isEmptyLine && !seenNonEmptyLine) { - return false; // Has leading new line - } - - seenNonEmptyLine = true; - isEmptyLine = true; - hasIndent = false; - break; - - case 9: // \t - - case 32: - // - hasIndent || (hasIndent = isEmptyLine); - break; - - default: - hasCommonIndent && (hasCommonIndent = hasIndent); - isEmptyLine = false; - } - } - - if (isEmptyLine) { - return false; // Has trailing empty lines - } - - if (hasCommonIndent && seenNonEmptyLine) { - return false; // Has internal indent - } - - return true; -} -/** - * Print a block string in the indented block form by adding a leading and - * trailing blank line. However, if a block string starts with whitespace and is - * a single-line, adding a leading blank line would strip that whitespace. - * - * @internal - */ - -function printBlockString(value, options) { - const escapedValue = value.replace(/"""/g, '\\"""'); // Expand a block string's raw value into independent lines. - - const lines = escapedValue.split(/\r\n|[\n\r]/g); - const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line - - const forceLeadingNewLine = - lines.length > 1 && - lines - .slice(1) - .every((line) => line.length === 0 || (0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_0__.isWhiteSpace)(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line - - const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); // Trailing quote (single or double) or slash forces trailing new line - - const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes; - const hasTrailingSlash = value.endsWith('\\'); - const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash; - const printAsMultipleLines = - !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability - (!isSingleLine || - value.length > 70 || - forceTrailingNewline || - forceLeadingNewLine || - hasTrailingTripleQuotes); - let result = ''; // Format a multi-line block quote to account for leading space. - - const skipLeadingNewLine = isSingleLine && (0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_0__.isWhiteSpace)(value.charCodeAt(0)); - - if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) { - result += '\n'; - } - - result += escapedValue; - - if (printAsMultipleLines || forceTrailingNewline) { - result += '\n'; - } - - return '"""' + result + '"""'; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/characterClasses.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/language/characterClasses.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isDigit": function() { return /* binding */ isDigit; }, -/* harmony export */ "isLetter": function() { return /* binding */ isLetter; }, -/* harmony export */ "isNameContinue": function() { return /* binding */ isNameContinue; }, -/* harmony export */ "isNameStart": function() { return /* binding */ isNameStart; }, -/* harmony export */ "isWhiteSpace": function() { return /* binding */ isWhiteSpace; } -/* harmony export */ }); -/** - * ``` - * WhiteSpace :: - * - "Horizontal Tab (U+0009)" - * - "Space (U+0020)" - * ``` - * @internal - */ -function isWhiteSpace(code) { - return code === 0x0009 || code === 0x0020; -} -/** - * ``` - * Digit :: one of - * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` - * ``` - * @internal - */ - -function isDigit(code) { - return code >= 0x0030 && code <= 0x0039; -} -/** - * ``` - * Letter :: one of - * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` - * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` - * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` - * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` - * ``` - * @internal - */ - -function isLetter(code) { - return ( - (code >= 0x0061 && code <= 0x007a) || // A-Z - (code >= 0x0041 && code <= 0x005a) // a-z - ); -} -/** - * ``` - * NameStart :: - * - Letter - * - `_` - * ``` - * @internal - */ - -function isNameStart(code) { - return isLetter(code) || code === 0x005f; -} -/** - * ``` - * NameContinue :: - * - Letter - * - Digit - * - `_` - * ``` - * @internal - */ - -function isNameContinue(code) { - return isLetter(code) || isDigit(code) || code === 0x005f; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/directiveLocation.mjs": -/*!********************************************************************!*\ - !*** ../../../node_modules/graphql/language/directiveLocation.mjs ***! - \********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "DirectiveLocation": function() { return /* binding */ DirectiveLocation; } -/* harmony export */ }); -/** - * The set of allowed directive location values. - */ -let DirectiveLocation; -/** - * The enum type representing the directive location values. - * - * @deprecated Please use `DirectiveLocation`. Will be remove in v17. - */ - -(function (DirectiveLocation) { - DirectiveLocation['QUERY'] = 'QUERY'; - DirectiveLocation['MUTATION'] = 'MUTATION'; - DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION'; - DirectiveLocation['FIELD'] = 'FIELD'; - DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION'; - DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD'; - DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT'; - DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION'; - DirectiveLocation['SCHEMA'] = 'SCHEMA'; - DirectiveLocation['SCALAR'] = 'SCALAR'; - DirectiveLocation['OBJECT'] = 'OBJECT'; - DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION'; - DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION'; - DirectiveLocation['INTERFACE'] = 'INTERFACE'; - DirectiveLocation['UNION'] = 'UNION'; - DirectiveLocation['ENUM'] = 'ENUM'; - DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE'; - DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT'; - DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION'; -})(DirectiveLocation || (DirectiveLocation = {})); - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/kinds.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/language/kinds.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Kind": function() { return /* binding */ Kind; } -/* harmony export */ }); -/** - * The set of allowed kind values for AST nodes. - */ -let Kind; -/** - * The enum type representing the possible kind values of AST nodes. - * - * @deprecated Please use `Kind`. Will be remove in v17. - */ - -(function (Kind) { - Kind['NAME'] = 'Name'; - Kind['DOCUMENT'] = 'Document'; - Kind['OPERATION_DEFINITION'] = 'OperationDefinition'; - Kind['VARIABLE_DEFINITION'] = 'VariableDefinition'; - Kind['SELECTION_SET'] = 'SelectionSet'; - Kind['FIELD'] = 'Field'; - Kind['ARGUMENT'] = 'Argument'; - Kind['FRAGMENT_SPREAD'] = 'FragmentSpread'; - Kind['INLINE_FRAGMENT'] = 'InlineFragment'; - Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition'; - Kind['VARIABLE'] = 'Variable'; - Kind['INT'] = 'IntValue'; - Kind['FLOAT'] = 'FloatValue'; - Kind['STRING'] = 'StringValue'; - Kind['BOOLEAN'] = 'BooleanValue'; - Kind['NULL'] = 'NullValue'; - Kind['ENUM'] = 'EnumValue'; - Kind['LIST'] = 'ListValue'; - Kind['OBJECT'] = 'ObjectValue'; - Kind['OBJECT_FIELD'] = 'ObjectField'; - Kind['DIRECTIVE'] = 'Directive'; - Kind['NAMED_TYPE'] = 'NamedType'; - Kind['LIST_TYPE'] = 'ListType'; - Kind['NON_NULL_TYPE'] = 'NonNullType'; - Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition'; - Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition'; - Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition'; - Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition'; - Kind['FIELD_DEFINITION'] = 'FieldDefinition'; - Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition'; - Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition'; - Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition'; - Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition'; - Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition'; - Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition'; - Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition'; - Kind['SCHEMA_EXTENSION'] = 'SchemaExtension'; - Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension'; - Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension'; - Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension'; - Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension'; - Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension'; - Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension'; -})(Kind || (Kind = {})); - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/lexer.mjs": -/*!********************************************************!*\ - !*** ../../../node_modules/graphql/language/lexer.mjs ***! - \********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Lexer": function() { return /* binding */ Lexer; }, -/* harmony export */ "isPunctuatorTokenKind": function() { return /* binding */ isPunctuatorTokenKind; } -/* harmony export */ }); -/* harmony import */ var _error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); -/* harmony import */ var _ast_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _blockString_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -/* harmony import */ var _characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); -/* harmony import */ var _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); - - - - - -/** - * Given a Source object, creates a Lexer for that source. - * A Lexer is a stateful stream generator in that every time - * it is advanced, it returns the next token in the Source. Assuming the - * source lexes, the final Token emitted by the lexer will be of kind - * EOF, after which the lexer will repeatedly return the same EOF token - * whenever called. - */ - -class Lexer { - /** - * The previously focused non-ignored token. - */ - - /** - * The currently focused non-ignored token. - */ - - /** - * The (1-indexed) line containing the current token. - */ - - /** - * The character offset at which the current line begins. - */ - constructor(source) { - const startOfFileToken = new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.SOF, 0, 0, 0, 0); - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - this.line = 1; - this.lineStart = 0; - } - - get [Symbol.toStringTag]() { - return 'Lexer'; - } - /** - * Advances the token stream to the next non-ignored token. - */ - - advance() { - this.lastToken = this.token; - const token = (this.token = this.lookahead()); - return token; - } - /** - * Looks ahead and returns the next non-ignored token, but does not change - * the state of Lexer. - */ - - lookahead() { - let token = this.token; - - if (token.kind !== _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.EOF) { - do { - if (token.next) { - token = token.next; - } else { - // Read the next token and form a link in the token linked-list. - const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing. - - token.next = nextToken; // @ts-expect-error prev is only mutable during parsing. - - nextToken.prev = token; - token = nextToken; - } - } while (token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COMMENT); - } - - return token; - } -} -/** - * @internal - */ - -function isPunctuatorTokenKind(kind) { - return ( - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BANG || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.DOLLAR || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.AMP || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PAREN_L || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PAREN_R || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.SPREAD || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COLON || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.EQUALS || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.AT || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACKET_L || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACKET_R || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACE_L || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PIPE || - kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACE_R - ); -} -/** - * A Unicode scalar value is any Unicode code point except surrogate code - * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and - * 0xE000 to 0x10FFFF. - * - * SourceCharacter :: - * - "Any Unicode scalar value" - */ - -function isUnicodeScalarValue(code) { - return ( - (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff) - ); -} -/** - * The GraphQL specification defines source text as a sequence of unicode scalar - * values (which Unicode defines to exclude surrogate code points). However - * JavaScript defines strings as a sequence of UTF-16 code units which may - * include surrogates. A surrogate pair is a valid source character as it - * encodes a supplementary code point (above U+FFFF), but unpaired surrogate - * code points are not valid source characters. - */ - -function isSupplementaryCodePoint(body, location) { - return ( - isLeadingSurrogate(body.charCodeAt(location)) && - isTrailingSurrogate(body.charCodeAt(location + 1)) - ); -} - -function isLeadingSurrogate(code) { - return code >= 0xd800 && code <= 0xdbff; -} - -function isTrailingSurrogate(code) { - return code >= 0xdc00 && code <= 0xdfff; -} -/** - * Prints the code point (or end of file reference) at a given location in a - * source for use in error messages. - * - * Printable ASCII is printed quoted, while other points are printed in Unicode - * code point form (ie. U+1234). - */ - -function printCodePointAt(lexer, location) { - const code = lexer.source.body.codePointAt(location); - - if (code === undefined) { - return _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.EOF; - } else if (code >= 0x0020 && code <= 0x007e) { - // Printable ASCII - const char = String.fromCodePoint(code); - return char === '"' ? "'\"'" : `"${char}"`; - } // Unicode code point - - return 'U+' + code.toString(16).toUpperCase().padStart(4, '0'); -} -/** - * Create a token with line and column location information. - */ - -function createToken(lexer, kind, start, end, value) { - const line = lexer.line; - const col = 1 + start - lexer.lineStart; - return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(kind, start, end, line, col, value); -} -/** - * Gets the next token from the source starting at the given position. - * - * This skips over whitespace until it finds the next lexable token, then lexes - * punctuators immediately or calls the appropriate helper function for more - * complicated tokens. - */ - -function readNextToken(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start; - - while (position < bodyLength) { - const code = body.charCodeAt(position); // SourceCharacter - - switch (code) { - // Ignored :: - // - UnicodeBOM - // - WhiteSpace - // - LineTerminator - // - Comment - // - Comma - // - // UnicodeBOM :: "Byte Order Mark (U+FEFF)" - // - // WhiteSpace :: - // - "Horizontal Tab (U+0009)" - // - "Space (U+0020)" - // - // Comma :: , - case 0xfeff: // - - case 0x0009: // \t - - case 0x0020: // - - case 0x002c: - // , - ++position; - continue; - // LineTerminator :: - // - "New Line (U+000A)" - // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"] - // - "Carriage Return (U+000D)" "New Line (U+000A)" - - case 0x000a: - // \n - ++position; - ++lexer.line; - lexer.lineStart = position; - continue; - - case 0x000d: - // \r - if (body.charCodeAt(position + 1) === 0x000a) { - position += 2; - } else { - ++position; - } - - ++lexer.line; - lexer.lineStart = position; - continue; - // Comment - - case 0x0023: - // # - return readComment(lexer, position); - // Token :: - // - Punctuator - // - Name - // - IntValue - // - FloatValue - // - StringValue - // - // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } - - case 0x0021: - // ! - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BANG, position, position + 1); - - case 0x0024: - // $ - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.DOLLAR, position, position + 1); - - case 0x0026: - // & - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.AMP, position, position + 1); - - case 0x0028: - // ( - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PAREN_L, position, position + 1); - - case 0x0029: - // ) - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PAREN_R, position, position + 1); - - case 0x002e: - // . - if ( - body.charCodeAt(position + 1) === 0x002e && - body.charCodeAt(position + 2) === 0x002e - ) { - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.SPREAD, position, position + 3); - } - - break; - - case 0x003a: - // : - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COLON, position, position + 1); - - case 0x003d: - // = - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.EQUALS, position, position + 1); - - case 0x0040: - // @ - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.AT, position, position + 1); - - case 0x005b: - // [ - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACKET_L, position, position + 1); - - case 0x005d: - // ] - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACKET_R, position, position + 1); - - case 0x007b: - // { - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACE_L, position, position + 1); - - case 0x007c: - // | - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.PIPE, position, position + 1); - - case 0x007d: - // } - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BRACE_R, position, position + 1); - // StringValue - - case 0x0022: - // " - if ( - body.charCodeAt(position + 1) === 0x0022 && - body.charCodeAt(position + 2) === 0x0022 - ) { - return readBlockString(lexer, position); - } - - return readString(lexer, position); - } // IntValue | FloatValue (Digit | -) - - if ((0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isDigit)(code) || code === 0x002d) { - return readNumber(lexer, position, code); - } // Name - - if ((0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isNameStart)(code)) { - return readName(lexer, position); - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - code === 0x0027 - ? 'Unexpected single quote character (\'), did you mean to use a double quote (")?' - : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) - ? `Unexpected character: ${printCodePointAt(lexer, position)}.` - : `Invalid character: ${printCodePointAt(lexer, position)}.`, - ); - } - - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.EOF, bodyLength, bodyLength); -} -/** - * Reads a comment token from the source file. - * - * ``` - * Comment :: # CommentChar* [lookahead != CommentChar] - * - * CommentChar :: SourceCharacter but not LineTerminator - * ``` - */ - -function readComment(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - - while (position < bodyLength) { - const code = body.charCodeAt(position); // LineTerminator (\n | \r) - - if (code === 0x000a || code === 0x000d) { - break; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - break; - } - } - - return createToken( - lexer, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COMMENT, - start, - position, - body.slice(start + 1, position), - ); -} -/** - * Reads a number token from the source file, either a FloatValue or an IntValue - * depending on whether a FractionalPart or ExponentPart is encountered. - * - * ``` - * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}] - * - * IntegerPart :: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit Digit* - * - * NegativeSign :: - - * - * NonZeroDigit :: Digit but not `0` - * - * FloatValue :: - * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}] - * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}] - * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}] - * - * FractionalPart :: . Digit+ - * - * ExponentPart :: ExponentIndicator Sign? Digit+ - * - * ExponentIndicator :: one of `e` `E` - * - * Sign :: one of + - - * ``` - */ - -function readNumber(lexer, start, firstCode) { - const body = lexer.source.body; - let position = start; - let code = firstCode; - let isFloat = false; // NegativeSign (-) - - if (code === 0x002d) { - code = body.charCodeAt(++position); - } // Zero (0) - - if (code === 0x0030) { - code = body.charCodeAt(++position); - - if ((0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isDigit)(code)) { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid number, unexpected digit after 0: ${printCodePointAt( - lexer, - position, - )}.`, - ); - } - } else { - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // Full stop (.) - - if (code === 0x002e) { - isFloat = true; - code = body.charCodeAt(++position); - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // E e - - if (code === 0x0045 || code === 0x0065) { - isFloat = true; - code = body.charCodeAt(++position); // + - - - if (code === 0x002b || code === 0x002d) { - code = body.charCodeAt(++position); - } - - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } // Numbers cannot be followed by . or NameStart - - if (code === 0x002e || (0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isNameStart)(code)) { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid number, expected digit but got: ${printCodePointAt( - lexer, - position, - )}.`, - ); - } - - return createToken( - lexer, - isFloat ? _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.FLOAT : _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.INT, - start, - position, - body.slice(start, position), - ); -} -/** - * Returns the new position in the source after reading one or more digits. - */ - -function readDigits(lexer, start, firstCode) { - if (!(0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isDigit)(firstCode)) { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - start, - `Invalid number, expected digit but got: ${printCodePointAt( - lexer, - start, - )}.`, - ); - } - - const body = lexer.source.body; - let position = start + 1; // +1 to skip first firstCode - - while ((0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isDigit)(body.charCodeAt(position))) { - ++position; - } - - return position; -} -/** - * Reads a single-quote string token from the source file. - * - * ``` - * StringValue :: - * - `""` [lookahead != `"`] - * - `"` StringCharacter+ `"` - * - * StringCharacter :: - * - SourceCharacter but not `"` or `\` or LineTerminator - * - `\u` EscapedUnicode - * - `\` EscapedCharacter - * - * EscapedUnicode :: - * - `{` HexDigit+ `}` - * - HexDigit HexDigit HexDigit HexDigit - * - * EscapedCharacter :: one of `"` `\` `/` `b` `f` `n` `r` `t` - * ``` - */ - -function readString(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - let chunkStart = position; - let value = ''; - - while (position < bodyLength) { - const code = body.charCodeAt(position); // Closing Quote (") - - if (code === 0x0022) { - value += body.slice(chunkStart, position); - return createToken(lexer, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.STRING, start, position + 1, value); - } // Escape Sequence (\) - - if (code === 0x005c) { - value += body.slice(chunkStart, position); - const escape = - body.charCodeAt(position + 1) === 0x0075 // u - ? body.charCodeAt(position + 2) === 0x007b // { - ? readEscapedUnicodeVariableWidth(lexer, position) - : readEscapedUnicodeFixedWidth(lexer, position) - : readEscapedCharacter(lexer, position); - value += escape.value; - position += escape.size; - chunkStart = position; - continue; - } // LineTerminator (\n | \r) - - if (code === 0x000a || code === 0x000d) { - break; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid character within String: ${printCodePointAt( - lexer, - position, - )}.`, - ); - } - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)(lexer.source, position, 'Unterminated string.'); -} // The string value and lexed size of an escape sequence. - -function readEscapedUnicodeVariableWidth(lexer, position) { - const body = lexer.source.body; - let point = 0; - let size = 3; // Cannot be larger than 12 chars (\u{00000000}). - - while (size < 12) { - const code = body.charCodeAt(position + size++); // Closing Brace (}) - - if (code === 0x007d) { - // Must be at least 5 chars (\u{0}) and encode a Unicode scalar value. - if (size < 5 || !isUnicodeScalarValue(point)) { - break; - } - - return { - value: String.fromCodePoint(point), - size, - }; - } // Append this hex digit to the code point. - - point = (point << 4) | readHexDigit(code); - - if (point < 0) { - break; - } - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid Unicode escape sequence: "${body.slice( - position, - position + size, - )}".`, - ); -} - -function readEscapedUnicodeFixedWidth(lexer, position) { - const body = lexer.source.body; - const code = read16BitHexCode(body, position + 2); - - if (isUnicodeScalarValue(code)) { - return { - value: String.fromCodePoint(code), - size: 6, - }; - } // GraphQL allows JSON-style surrogate pair escape sequences, but only when - // a valid pair is formed. - - if (isLeadingSurrogate(code)) { - // \u - if ( - body.charCodeAt(position + 6) === 0x005c && - body.charCodeAt(position + 7) === 0x0075 - ) { - const trailingCode = read16BitHexCode(body, position + 8); - - if (isTrailingSurrogate(trailingCode)) { - // JavaScript defines strings as a sequence of UTF-16 code units and - // encodes Unicode code points above U+FFFF using a surrogate pair of - // code units. Since this is a surrogate pair escape sequence, just - // include both codes into the JavaScript string value. Had JavaScript - // not been internally based on UTF-16, then this surrogate pair would - // be decoded to retrieve the supplementary code point. - return { - value: String.fromCodePoint(code, trailingCode), - size: 12, - }; - } - } - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`, - ); -} -/** - * Reads four hexadecimal characters and returns the positive integer that 16bit - * hexadecimal string represents. For example, "000f" will return 15, and "dead" - * will return 57005. - * - * Returns a negative number if any char was not a valid hexadecimal digit. - */ - -function read16BitHexCode(body, position) { - // readHexDigit() returns -1 on error. ORing a negative value with any other - // value always produces a negative value. - return ( - (readHexDigit(body.charCodeAt(position)) << 12) | - (readHexDigit(body.charCodeAt(position + 1)) << 8) | - (readHexDigit(body.charCodeAt(position + 2)) << 4) | - readHexDigit(body.charCodeAt(position + 3)) - ); -} -/** - * Reads a hexadecimal character and returns its positive integer value (0-15). - * - * '0' becomes 0, '9' becomes 9 - * 'A' becomes 10, 'F' becomes 15 - * 'a' becomes 10, 'f' becomes 15 - * - * Returns -1 if the provided character code was not a valid hexadecimal digit. - * - * HexDigit :: one of - * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` - * - `A` `B` `C` `D` `E` `F` - * - `a` `b` `c` `d` `e` `f` - */ - -function readHexDigit(code) { - return code >= 0x0030 && code <= 0x0039 // 0-9 - ? code - 0x0030 - : code >= 0x0041 && code <= 0x0046 // A-F - ? code - 0x0037 - : code >= 0x0061 && code <= 0x0066 // a-f - ? code - 0x0057 - : -1; -} -/** - * | Escaped Character | Code Point | Character Name | - * | ----------------- | ---------- | ---------------------------- | - * | `"` | U+0022 | double quote | - * | `\` | U+005C | reverse solidus (back slash) | - * | `/` | U+002F | solidus (forward slash) | - * | `b` | U+0008 | backspace | - * | `f` | U+000C | form feed | - * | `n` | U+000A | line feed (new line) | - * | `r` | U+000D | carriage return | - * | `t` | U+0009 | horizontal tab | - */ - -function readEscapedCharacter(lexer, position) { - const body = lexer.source.body; - const code = body.charCodeAt(position + 1); - - switch (code) { - case 0x0022: - // " - return { - value: '\u0022', - size: 2, - }; - - case 0x005c: - // \ - return { - value: '\u005c', - size: 2, - }; - - case 0x002f: - // / - return { - value: '\u002f', - size: 2, - }; - - case 0x0062: - // b - return { - value: '\u0008', - size: 2, - }; - - case 0x0066: - // f - return { - value: '\u000c', - size: 2, - }; - - case 0x006e: - // n - return { - value: '\u000a', - size: 2, - }; - - case 0x0072: - // r - return { - value: '\u000d', - size: 2, - }; - - case 0x0074: - // t - return { - value: '\u0009', - size: 2, - }; - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid character escape sequence: "${body.slice( - position, - position + 2, - )}".`, - ); -} -/** - * Reads a block string token from the source file. - * - * ``` - * StringValue :: - * - `"""` BlockStringCharacter* `"""` - * - * BlockStringCharacter :: - * - SourceCharacter but not `"""` or `\"""` - * - `\"""` - * ``` - */ - -function readBlockString(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let lineStart = lexer.lineStart; - let position = start + 3; - let chunkStart = position; - let currentLine = ''; - const blockLines = []; - - while (position < bodyLength) { - const code = body.charCodeAt(position); // Closing Triple-Quote (""") - - if ( - code === 0x0022 && - body.charCodeAt(position + 1) === 0x0022 && - body.charCodeAt(position + 2) === 0x0022 - ) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - const token = createToken( - lexer, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.BLOCK_STRING, - start, - position + 3, // Return a string of the lines joined with U+000A. - (0,_blockString_mjs__WEBPACK_IMPORTED_MODULE_4__.dedentBlockStringLines)(blockLines).join('\n'), - ); - lexer.line += blockLines.length - 1; - lexer.lineStart = lineStart; - return token; - } // Escaped Triple-Quote (\""") - - if ( - code === 0x005c && - body.charCodeAt(position + 1) === 0x0022 && - body.charCodeAt(position + 2) === 0x0022 && - body.charCodeAt(position + 3) === 0x0022 - ) { - currentLine += body.slice(chunkStart, position); - chunkStart = position + 1; // skip only slash - - position += 4; - continue; - } // LineTerminator - - if (code === 0x000a || code === 0x000d) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - - if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) { - position += 2; - } else { - ++position; - } - - currentLine = ''; - chunkStart = position; - lineStart = position; - continue; - } // SourceCharacter - - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)( - lexer.source, - position, - `Invalid character within String: ${printCodePointAt( - lexer, - position, - )}.`, - ); - } - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_3__.syntaxError)(lexer.source, position, 'Unterminated string.'); -} -/** - * Reads an alphanumeric + underscore name from the source. - * - * ``` - * Name :: - * - NameStart NameContinue* [lookahead != NameContinue] - * ``` - */ - -function readName(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start + 1; - - while (position < bodyLength) { - const code = body.charCodeAt(position); - - if ((0,_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isNameContinue)(code)) { - ++position; - } else { - break; - } - } - - return createToken( - lexer, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.NAME, - start, - position, - body.slice(start, position), - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/location.mjs": -/*!***********************************************************!*\ - !*** ../../../node_modules/graphql/language/location.mjs ***! - \***********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getLocation": function() { return /* binding */ getLocation; } -/* harmony export */ }); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); - -const LineRegExp = /\r\n|[\n\r]/g; -/** - * Represents a location in a Source. - */ - -/** - * Takes a Source and a UTF-8 character offset, and returns the corresponding - * line and column as a SourceLocation. - */ -function getLocation(source, position) { - let lastLineStart = 0; - let line = 1; - - for (const match of source.body.matchAll(LineRegExp)) { - typeof match.index === 'number' || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.invariant)(false); - - if (match.index >= position) { - break; - } - - lastLineStart = match.index + match[0].length; - line += 1; - } - - return { - line, - column: position + 1 - lastLineStart, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/parser.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/language/parser.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Parser": function() { return /* binding */ Parser; }, -/* harmony export */ "parse": function() { return /* binding */ parse; }, -/* harmony export */ "parseConstValue": function() { return /* binding */ parseConstValue; }, -/* harmony export */ "parseType": function() { return /* binding */ parseType; }, -/* harmony export */ "parseValue": function() { return /* binding */ parseValue; } -/* harmony export */ }); -/* harmony import */ var _error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../error/syntaxError.mjs */ "../../../node_modules/graphql/error/syntaxError.mjs"); -/* harmony import */ var _ast_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -/* harmony import */ var _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _lexer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -/* harmony import */ var _source_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./source.mjs */ "../../../node_modules/graphql/language/source.mjs"); -/* harmony import */ var _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); - - - - - - - -/** - * Configuration options to control parser behavior - */ - -/** - * Given a GraphQL source, parses it into a Document. - * Throws GraphQLError if a syntax error is encountered. - */ -function parse(source, options) { - const parser = new Parser(source, options); - return parser.parseDocument(); -} -/** - * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for - * that value. - * Throws GraphQLError if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Values directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: valueFromAST(). - */ - -function parseValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SOF); - const value = parser.parseValueLiteral(false); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EOF); - return value; -} -/** - * Similar to parseValue(), but raises a parse error if it encounters a - * variable. The return type will be a constant value. - */ - -function parseConstValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SOF); - const value = parser.parseConstValueLiteral(); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EOF); - return value; -} -/** - * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for - * that type. - * Throws GraphQLError if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Types directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: typeFromAST(). - */ - -function parseType(source, options) { - const parser = new Parser(source, options); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SOF); - const type = parser.parseTypeReference(); - parser.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EOF); - return type; -} -/** - * This class is exported only to assist people in implementing their own parsers - * without duplicating too much code and should be used only as last resort for cases - * such as experimental syntax or if certain features could not be contributed upstream. - * - * It is still part of the internal API and is versioned, so any changes to it are never - * considered breaking changes. If you still need to support multiple versions of the - * library, please use the `versionInfo` variable for version detection. - * - * @internal - */ - -class Parser { - constructor(source, options) { - const sourceObj = (0,_source_mjs__WEBPACK_IMPORTED_MODULE_1__.isSource)(source) ? source : new _source_mjs__WEBPACK_IMPORTED_MODULE_1__.Source(source); - this._lexer = new _lexer_mjs__WEBPACK_IMPORTED_MODULE_2__.Lexer(sourceObj); - this._options = options; - } - /** - * Converts a name lex token into a name parse node. - */ - - parseName() { - const token = this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME); - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.NAME, - value: token.value, - }); - } // Implements the parsing rules in the Document section. - - /** - * Document : Definition+ - */ - - parseDocument() { - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.DOCUMENT, - definitions: this.many( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SOF, - this.parseDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EOF, - ), - }); - } - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - * - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - - parseDefinition() { - if (this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L)) { - return this.parseOperationDefinition(); - } // Many definitions begin with a description and require a lookahead. - - const hasDescription = this.peekDescription(); - const keywordToken = hasDescription - ? this._lexer.lookahead() - : this._lexer.token; - - if (keywordToken.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaDefinition(); - - case 'scalar': - return this.parseScalarTypeDefinition(); - - case 'type': - return this.parseObjectTypeDefinition(); - - case 'interface': - return this.parseInterfaceTypeDefinition(); - - case 'union': - return this.parseUnionTypeDefinition(); - - case 'enum': - return this.parseEnumTypeDefinition(); - - case 'input': - return this.parseInputObjectTypeDefinition(); - - case 'directive': - return this.parseDirectiveDefinition(); - } - - if (hasDescription) { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - this._lexer.token.start, - 'Unexpected description, descriptions are supported only on type definitions.', - ); - } - - switch (keywordToken.value) { - case 'query': - case 'mutation': - case 'subscription': - return this.parseOperationDefinition(); - - case 'fragment': - return this.parseFragmentDefinition(); - - case 'extend': - return this.parseTypeSystemExtension(); - } - } - - throw this.unexpected(keywordToken); - } // Implements the parsing rules in the Operations section. - - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - - parseOperationDefinition() { - const start = this._lexer.token; - - if (this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L)) { - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OPERATION_DEFINITION, - operation: _ast_mjs__WEBPACK_IMPORTED_MODULE_5__.OperationTypeNode.QUERY, - name: undefined, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet(), - }); - } - - const operation = this.parseOperationType(); - let name; - - if (this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME)) { - name = this.parseName(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OPERATION_DEFINITION, - operation, - name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - }); - } - /** - * OperationType : one of query mutation subscription - */ - - parseOperationType() { - const operationToken = this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME); - - switch (operationToken.value) { - case 'query': - return _ast_mjs__WEBPACK_IMPORTED_MODULE_5__.OperationTypeNode.QUERY; - - case 'mutation': - return _ast_mjs__WEBPACK_IMPORTED_MODULE_5__.OperationTypeNode.MUTATION; - - case 'subscription': - return _ast_mjs__WEBPACK_IMPORTED_MODULE_5__.OperationTypeNode.SUBSCRIPTION; - } - - throw this.unexpected(operationToken); - } - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - - parseVariableDefinitions() { - return this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_L, - this.parseVariableDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_R, - ); - } - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - - parseVariableDefinition() { - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.VARIABLE_DEFINITION, - variable: this.parseVariable(), - type: (this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EQUALS) - ? this.parseConstValueLiteral() - : undefined, - directives: this.parseConstDirectives(), - }); - } - /** - * Variable : $ Name - */ - - parseVariable() { - const start = this._lexer.token; - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.DOLLAR); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.VARIABLE, - name: this.parseName(), - }); - } - /** - * ``` - * SelectionSet : { Selection+ } - * ``` - */ - - parseSelectionSet() { - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.SELECTION_SET, - selections: this.many( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseSelection, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ), - }); - } - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - - parseSelection() { - return this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SPREAD) - ? this.parseFragment() - : this.parseField(); - } - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - - parseField() { - const start = this._lexer.token; - const nameOrAlias = this.parseName(); - let alias; - let name; - - if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FIELD, - alias, - name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L) - ? this.parseSelectionSet() - : undefined, - }); - } - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - - parseArguments(isConst) { - const item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_L, item, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_R); - } - /** - * Argument[Const] : Name : Value[?Const] - */ - - parseArgument(isConst = false) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.ARGUMENT, - name, - value: this.parseValueLiteral(isConst), - }); - } - - parseConstArgument() { - return this.parseArgument(true); - } // Implements the parsing rules in the Fragments section. - - /** - * Corresponds to both FragmentSpread and InlineFragment in the spec. - * - * FragmentSpread : ... FragmentName Directives? - * - * InlineFragment : ... TypeCondition? Directives? SelectionSet - */ - - parseFragment() { - const start = this._lexer.token; - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.SPREAD); - const hasTypeCondition = this.expectOptionalKeyword('on'); - - if (!hasTypeCondition && this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME)) { - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false), - }); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - }); - } - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - - parseFragmentDefinition() { - var _this$_options; - - const start = this._lexer.token; - this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - - if ( - ((_this$_options = this._options) === null || _this$_options === void 0 - ? void 0 - : _this$_options.allowLegacyFragmentVariables) === true - ) { - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - }); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - }); - } - /** - * FragmentName : Name but not `on` - */ - - parseFragmentName() { - if (this._lexer.token.value === 'on') { - throw this.unexpected(); - } - - return this.parseName(); - } // Implements the parsing rules in the Values section. - - /** - * Value[Const] : - * - [~Const] Variable - * - IntValue - * - FloatValue - * - StringValue - * - BooleanValue - * - NullValue - * - EnumValue - * - ListValue[?Const] - * - ObjectValue[?Const] - * - * BooleanValue : one of `true` `false` - * - * NullValue : `null` - * - * EnumValue : Name but not `true`, `false` or `null` - */ - - parseValueLiteral(isConst) { - const token = this._lexer.token; - - switch (token.kind) { - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACKET_L: - return this.parseList(isConst); - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L: - return this.parseObject(isConst); - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.INT: - this._lexer.advance(); - - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INT, - value: token.value, - }); - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.FLOAT: - this._lexer.advance(); - - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FLOAT, - value: token.value, - }); - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.STRING: - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME: - this._lexer.advance(); - - switch (token.value) { - case 'true': - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.BOOLEAN, - value: true, - }); - - case 'false': - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.BOOLEAN, - value: false, - }); - - case 'null': - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.NULL, - }); - - default: - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.ENUM, - value: token.value, - }); - } - - case _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.DOLLAR: - if (isConst) { - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.DOLLAR); - - if (this._lexer.token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME) { - const varName = this._lexer.token.value; - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - token.start, - `Unexpected variable "$${varName}" in constant value.`, - ); - } else { - throw this.unexpected(token); - } - } - - return this.parseVariable(); - - default: - throw this.unexpected(); - } - } - - parseConstValueLiteral() { - return this.parseValueLiteral(true); - } - - parseStringLiteral() { - const token = this._lexer.token; - - this._lexer.advance(); - - return this.node(token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.STRING, - value: token.value, - block: token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BLOCK_STRING, - }); - } - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - - parseList(isConst) { - const item = () => this.parseValueLiteral(isConst); - - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.LIST, - values: this.any(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACKET_L, item, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACKET_R), - }); - } - /** - * ``` - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - * ``` - */ - - parseObject(isConst) { - const item = () => this.parseObjectField(isConst); - - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT, - fields: this.any(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, item, _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R), - }); - } - /** - * ObjectField[Const] : Name : Value[?Const] - */ - - parseObjectField(isConst) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT_FIELD, - name, - value: this.parseValueLiteral(isConst), - }); - } // Implements the parsing rules in the Directives section. - - /** - * Directives[Const] : Directive[?Const]+ - */ - - parseDirectives(isConst) { - const directives = []; - - while (this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.AT)) { - directives.push(this.parseDirective(isConst)); - } - - return directives; - } - - parseConstDirectives() { - return this.parseDirectives(true); - } - /** - * ``` - * Directive[Const] : @ Name Arguments[?Const]? - * ``` - */ - - parseDirective(isConst) { - const start = this._lexer.token; - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.AT); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.DIRECTIVE, - name: this.parseName(), - arguments: this.parseArguments(isConst), - }); - } // Implements the parsing rules in the Types section. - - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - - parseTypeReference() { - const start = this._lexer.token; - let type; - - if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACKET_L)) { - const innerType = this.parseTypeReference(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACKET_R); - type = this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.LIST_TYPE, - type: innerType, - }); - } else { - type = this.parseNamedType(); - } - - if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BANG)) { - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.NON_NULL_TYPE, - type, - }); - } - - return type; - } - /** - * NamedType : Name - */ - - parseNamedType() { - return this.node(this._lexer.token, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.NAMED_TYPE, - name: this.parseName(), - }); - } // Implements the parsing rules in the Type Definition section. - - peekDescription() { - return this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.STRING) || this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BLOCK_STRING); - } - /** - * Description : StringValue - */ - - parseDescription() { - if (this.peekDescription()) { - return this.parseStringLiteral(); - } - } - /** - * ``` - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - * ``` - */ - - parseSchemaDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('schema'); - const directives = this.parseConstDirectives(); - const operationTypes = this.many( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseOperationTypeDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.SCHEMA_DEFINITION, - description, - directives, - operationTypes, - }); - } - /** - * OperationTypeDefinition : OperationType : NamedType - */ - - parseOperationTypeDefinition() { - const start = this._lexer.token; - const operation = this.parseOperationType(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON); - const type = this.parseNamedType(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OPERATION_TYPE_DEFINITION, - operation, - type, - }); - } - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - - parseScalarTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.SCALAR_TYPE_DEFINITION, - description, - name, - directives, - }); - } - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - - parseObjectTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields, - }); - } - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - - parseImplementsInterfaces() { - return this.expectOptionalKeyword('implements') - ? this.delimitedMany(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.AMP, this.parseNamedType) - : []; - } - /** - * ``` - * FieldsDefinition : { FieldDefinition+ } - * ``` - */ - - parseFieldsDefinition() { - return this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseFieldDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ); - } - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - - parseFieldDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON); - const type = this.parseTypeReference(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FIELD_DEFINITION, - description, - name, - arguments: args, - type, - directives, - }); - } - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - - parseArgumentDefs() { - return this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_L, - this.parseInputValueDef, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PAREN_R, - ); - } - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - - parseInputValueDef() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.COLON); - const type = this.parseTypeReference(); - let defaultValue; - - if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EQUALS)) { - defaultValue = this.parseConstValueLiteral(); - } - - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INPUT_VALUE_DEFINITION, - description, - name, - type, - defaultValue, - directives, - }); - } - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - - parseInterfaceTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INTERFACE_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields, - }); - } - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - - parseUnionTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const types = this.parseUnionMemberTypes(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.UNION_TYPE_DEFINITION, - description, - name, - directives, - types, - }); - } - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - - parseUnionMemberTypes() { - return this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.EQUALS) - ? this.delimitedMany(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PIPE, this.parseNamedType) - : []; - } - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - - parseEnumTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const values = this.parseEnumValuesDefinition(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.ENUM_TYPE_DEFINITION, - description, - name, - directives, - values, - }); - } - /** - * ``` - * EnumValuesDefinition : { EnumValueDefinition+ } - * ``` - */ - - parseEnumValuesDefinition() { - return this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseEnumValueDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ); - } - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - */ - - parseEnumValueDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseEnumValueName(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.ENUM_VALUE_DEFINITION, - description, - name, - directives, - }); - } - /** - * EnumValue : Name but not `true`, `false` or `null` - */ - - parseEnumValueName() { - if ( - this._lexer.token.value === 'true' || - this._lexer.token.value === 'false' || - this._lexer.token.value === 'null' - ) { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - this._lexer.token.start, - `${getTokenDesc( - this._lexer.token, - )} is reserved and cannot be used for an enum value.`, - ); - } - - return this.parseName(); - } - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - - parseInputObjectTypeDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const fields = this.parseInputFieldsDefinition(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INPUT_OBJECT_TYPE_DEFINITION, - description, - name, - directives, - fields, - }); - } - /** - * ``` - * InputFieldsDefinition : { InputValueDefinition+ } - * ``` - */ - - parseInputFieldsDefinition() { - return this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseInputValueDef, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ); - } - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - - parseTypeSystemExtension() { - const keywordToken = this._lexer.lookahead(); - - if (keywordToken.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaExtension(); - - case 'scalar': - return this.parseScalarTypeExtension(); - - case 'type': - return this.parseObjectTypeExtension(); - - case 'interface': - return this.parseInterfaceTypeExtension(); - - case 'union': - return this.parseUnionTypeExtension(); - - case 'enum': - return this.parseEnumTypeExtension(); - - case 'input': - return this.parseInputObjectTypeExtension(); - } - } - - throw this.unexpected(keywordToken); - } - /** - * ``` - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - * ``` - */ - - parseSchemaExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('schema'); - const directives = this.parseConstDirectives(); - const operationTypes = this.optionalMany( - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_L, - this.parseOperationTypeDefinition, - _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.BRACE_R, - ); - - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.SCHEMA_EXTENSION, - directives, - operationTypes, - }); - } - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - - parseScalarTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - - if (directives.length === 0) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.SCALAR_TYPE_EXTENSION, - name, - directives, - }); - } - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - - parseObjectTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - - if ( - interfaces.length === 0 && - directives.length === 0 && - fields.length === 0 - ) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT_TYPE_EXTENSION, - name, - interfaces, - directives, - fields, - }); - } - /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces - */ - - parseInterfaceTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseConstDirectives(); - const fields = this.parseFieldsDefinition(); - - if ( - interfaces.length === 0 && - directives.length === 0 && - fields.length === 0 - ) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INTERFACE_TYPE_EXTENSION, - name, - interfaces, - directives, - fields, - }); - } - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - - parseUnionTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const types = this.parseUnionMemberTypes(); - - if (directives.length === 0 && types.length === 0) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.UNION_TYPE_EXTENSION, - name, - directives, - types, - }); - } - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - - parseEnumTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const values = this.parseEnumValuesDefinition(); - - if (directives.length === 0 && values.length === 0) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.ENUM_TYPE_EXTENSION, - name, - directives, - values, - }); - } - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - - parseInputObjectTypeExtension() { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseConstDirectives(); - const fields = this.parseInputFieldsDefinition(); - - if (directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INPUT_OBJECT_TYPE_EXTENSION, - name, - directives, - fields, - }); - } - /** - * ``` - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - * ``` - */ - - parseDirectiveDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('directive'); - this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.AT); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - const repeatable = this.expectOptionalKeyword('repeatable'); - this.expectKeyword('on'); - const locations = this.parseDirectiveLocations(); - return this.node(start, { - kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.DIRECTIVE_DEFINITION, - description, - name, - arguments: args, - repeatable, - locations, - }); - } - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - - parseDirectiveLocations() { - return this.delimitedMany(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.PIPE, this.parseDirectiveLocation); - } - /* - * DirectiveLocation : - * - ExecutableDirectiveLocation - * - TypeSystemDirectiveLocation - * - * ExecutableDirectiveLocation : one of - * `QUERY` - * `MUTATION` - * `SUBSCRIPTION` - * `FIELD` - * `FRAGMENT_DEFINITION` - * `FRAGMENT_SPREAD` - * `INLINE_FRAGMENT` - * - * TypeSystemDirectiveLocation : one of - * `SCHEMA` - * `SCALAR` - * `OBJECT` - * `FIELD_DEFINITION` - * `ARGUMENT_DEFINITION` - * `INTERFACE` - * `UNION` - * `ENUM` - * `ENUM_VALUE` - * `INPUT_OBJECT` - * `INPUT_FIELD_DEFINITION` - */ - - parseDirectiveLocation() { - const start = this._lexer.token; - const name = this.parseName(); - - if (Object.prototype.hasOwnProperty.call(_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_6__.DirectiveLocation, name.value)) { - return name; - } - - throw this.unexpected(start); - } // Core parsing utility functions - - /** - * Returns a node that, if configured to do so, sets a "loc" field as a - * location object, used to identify the place in the source that created a - * given parsed object. - */ - - node(startToken, node) { - var _this$_options2; - - if ( - ((_this$_options2 = this._options) === null || _this$_options2 === void 0 - ? void 0 - : _this$_options2.noLocation) !== true - ) { - node.loc = new _ast_mjs__WEBPACK_IMPORTED_MODULE_5__.Location( - startToken, - this._lexer.lastToken, - this._lexer.source, - ); - } - - return node; - } - /** - * Determines if the next token is of a given kind - */ - - peek(kind) { - return this._lexer.token.kind === kind; - } - /** - * If the next token is of the given kind, return that token after advancing the lexer. - * Otherwise, do not change the parser state and throw an error. - */ - - expectToken(kind) { - const token = this._lexer.token; - - if (token.kind === kind) { - this._lexer.advance(); - - return token; - } - - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - token.start, - `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`, - ); - } - /** - * If the next token is of the given kind, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - - expectOptionalToken(kind) { - const token = this._lexer.token; - - if (token.kind === kind) { - this._lexer.advance(); - - return true; - } - - return false; - } - /** - * If the next token is a given keyword, advance the lexer. - * Otherwise, do not change the parser state and throw an error. - */ - - expectKeyword(value) { - const token = this._lexer.token; - - if (token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME && token.value === value) { - this._lexer.advance(); - } else { - throw (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - token.start, - `Expected "${value}", found ${getTokenDesc(token)}.`, - ); - } - } - /** - * If the next token is a given keyword, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - - expectOptionalKeyword(value) { - const token = this._lexer.token; - - if (token.kind === _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_0__.TokenKind.NAME && token.value === value) { - this._lexer.advance(); - - return true; - } - - return false; - } - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - - unexpected(atToken) { - const token = - atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; - return (0,_error_syntaxError_mjs__WEBPACK_IMPORTED_MODULE_4__.syntaxError)( - this._lexer.source, - token.start, - `Unexpected ${getTokenDesc(token)}.`, - ); - } - /** - * Returns a possibly empty list of parse nodes, determined by the parseFn. - * This list begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - any(openKind, parseFn, closeKind) { - this.expectToken(openKind); - const nodes = []; - - while (!this.expectOptionalToken(closeKind)) { - nodes.push(parseFn.call(this)); - } - - return nodes; - } - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - optionalMany(openKind, parseFn, closeKind) { - if (this.expectOptionalToken(openKind)) { - const nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - - return []; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list begins with a lex token of openKind and ends with a lex token of closeKind. - * Advances the parser to the next lex token after the closing token. - */ - - many(openKind, parseFn, closeKind) { - this.expectToken(openKind); - const nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - - delimitedMany(delimiterKind, parseFn) { - this.expectOptionalToken(delimiterKind); - const nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (this.expectOptionalToken(delimiterKind)); - - return nodes; - } -} -/** - * A helper function to describe a token as a string for debugging. - */ - -function getTokenDesc(token) { - const value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); -} -/** - * A helper function to describe a token kind as a string for debugging. - */ - -function getTokenKindDesc(kind) { - return (0,_lexer_mjs__WEBPACK_IMPORTED_MODULE_2__.isPunctuatorTokenKind)(kind) ? `"${kind}"` : kind; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/predicates.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/language/predicates.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isConstValueNode": function() { return /* binding */ isConstValueNode; }, -/* harmony export */ "isDefinitionNode": function() { return /* binding */ isDefinitionNode; }, -/* harmony export */ "isExecutableDefinitionNode": function() { return /* binding */ isExecutableDefinitionNode; }, -/* harmony export */ "isSelectionNode": function() { return /* binding */ isSelectionNode; }, -/* harmony export */ "isTypeDefinitionNode": function() { return /* binding */ isTypeDefinitionNode; }, -/* harmony export */ "isTypeExtensionNode": function() { return /* binding */ isTypeExtensionNode; }, -/* harmony export */ "isTypeNode": function() { return /* binding */ isTypeNode; }, -/* harmony export */ "isTypeSystemDefinitionNode": function() { return /* binding */ isTypeSystemDefinitionNode; }, -/* harmony export */ "isTypeSystemExtensionNode": function() { return /* binding */ isTypeSystemExtensionNode; }, -/* harmony export */ "isValueNode": function() { return /* binding */ isValueNode; } -/* harmony export */ }); -/* harmony import */ var _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - -function isDefinitionNode(node) { - return ( - isExecutableDefinitionNode(node) || - isTypeSystemDefinitionNode(node) || - isTypeSystemExtensionNode(node) - ); -} -function isExecutableDefinitionNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OPERATION_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_DEFINITION - ); -} -function isSelectionNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FIELD || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_SPREAD || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INLINE_FRAGMENT - ); -} -function isValueNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INT || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FLOAT || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.STRING || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.BOOLEAN || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NULL || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.ENUM || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT - ); -} -function isConstValueNode(node) { - return ( - isValueNode(node) && - (node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST - ? node.values.some(isConstValueNode) - : node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT - ? node.fields.some((field) => isConstValueNode(field.value)) - : node.kind !== _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE) - ); -} -function isTypeNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NAMED_TYPE || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST_TYPE || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NON_NULL_TYPE - ); -} -function isTypeSystemDefinitionNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.SCHEMA_DEFINITION || - isTypeDefinitionNode(node) || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.DIRECTIVE_DEFINITION - ); -} -function isTypeDefinitionNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.SCALAR_TYPE_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT_TYPE_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INTERFACE_TYPE_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.UNION_TYPE_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.ENUM_TYPE_DEFINITION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INPUT_OBJECT_TYPE_DEFINITION - ); -} -function isTypeSystemExtensionNode(node) { - return node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); -} -function isTypeExtensionNode(node) { - return ( - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.SCALAR_TYPE_EXTENSION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT_TYPE_EXTENSION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INTERFACE_TYPE_EXTENSION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.UNION_TYPE_EXTENSION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.ENUM_TYPE_EXTENSION || - node.kind === _kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INPUT_OBJECT_TYPE_EXTENSION - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printLocation.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/language/printLocation.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "printLocation": function() { return /* binding */ printLocation; }, -/* harmony export */ "printSourceLocation": function() { return /* binding */ printSourceLocation; } -/* harmony export */ }); -/* harmony import */ var _location_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./location.mjs */ "../../../node_modules/graphql/language/location.mjs"); - - -/** - * Render a helpful description of the location in the GraphQL Source document. - */ -function printLocation(location) { - return printSourceLocation( - location.source, - (0,_location_mjs__WEBPACK_IMPORTED_MODULE_0__.getLocation)(location.source, location.start), - ); -} -/** - * Render a helpful description of the location in the GraphQL Source document. - */ - -function printSourceLocation(source, sourceLocation) { - const firstLineColumnOffset = source.locationOffset.column - 1; - const body = ''.padStart(firstLineColumnOffset) + source.body; - const lineIndex = sourceLocation.line - 1; - const lineOffset = source.locationOffset.line - 1; - const lineNum = sourceLocation.line + lineOffset; - const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; - const columnNum = sourceLocation.column + columnOffset; - const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; - const lines = body.split(/\r\n|[\n\r]/g); - const locationLine = lines[lineIndex]; // Special case for minified documents - - if (locationLine.length > 120) { - const subLineIndex = Math.floor(columnNum / 80); - const subLineColumnNum = columnNum % 80; - const subLines = []; - - for (let i = 0; i < locationLine.length; i += 80) { - subLines.push(locationLine.slice(i, i + 80)); - } - - return ( - locationStr + - printPrefixedLines([ - [`${lineNum} |`, subLines[0]], - ...subLines.slice(1, subLineIndex + 1).map((subLine) => ['|', subLine]), - ['|', '^'.padStart(subLineColumnNum)], - ['|', subLines[subLineIndex + 1]], - ]) - ); - } - - return ( - locationStr + - printPrefixedLines([ - // Lines specified like this: ["prefix", "string"], - [`${lineNum - 1} |`, lines[lineIndex - 1]], - [`${lineNum} |`, locationLine], - ['|', '^'.padStart(columnNum)], - [`${lineNum + 1} |`, lines[lineIndex + 1]], - ]) - ); -} - -function printPrefixedLines(lines) { - const existingLines = lines.filter(([_, line]) => line !== undefined); - const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); - return existingLines - .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : '')) - .join('\n'); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printString.mjs": -/*!**************************************************************!*\ - !*** ../../../node_modules/graphql/language/printString.mjs ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "printString": function() { return /* binding */ printString; } -/* harmony export */ }); -/** - * Prints a string as a GraphQL StringValue literal. Replaces control characters - * and excluded characters (" U+0022 and \\ U+005C) with escape sequences. - */ -function printString(str) { - return `"${str.replace(escapedRegExp, escapedReplacer)}"`; -} // eslint-disable-next-line no-control-regex - -const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; - -function escapedReplacer(str) { - return escapeSequences[str.charCodeAt(0)]; -} // prettier-ignore - -const escapeSequences = [ - '\\u0000', - '\\u0001', - '\\u0002', - '\\u0003', - '\\u0004', - '\\u0005', - '\\u0006', - '\\u0007', - '\\b', - '\\t', - '\\n', - '\\u000B', - '\\f', - '\\r', - '\\u000E', - '\\u000F', - '\\u0010', - '\\u0011', - '\\u0012', - '\\u0013', - '\\u0014', - '\\u0015', - '\\u0016', - '\\u0017', - '\\u0018', - '\\u0019', - '\\u001A', - '\\u001B', - '\\u001C', - '\\u001D', - '\\u001E', - '\\u001F', - '', - '', - '\\"', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', // 2F - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', // 3F - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', // 4F - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '\\\\', - '', - '', - '', // 5F - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', // 6F - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '\\u007F', - '\\u0080', - '\\u0081', - '\\u0082', - '\\u0083', - '\\u0084', - '\\u0085', - '\\u0086', - '\\u0087', - '\\u0088', - '\\u0089', - '\\u008A', - '\\u008B', - '\\u008C', - '\\u008D', - '\\u008E', - '\\u008F', - '\\u0090', - '\\u0091', - '\\u0092', - '\\u0093', - '\\u0094', - '\\u0095', - '\\u0096', - '\\u0097', - '\\u0098', - '\\u0099', - '\\u009A', - '\\u009B', - '\\u009C', - '\\u009D', - '\\u009E', - '\\u009F', -]; - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/printer.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/language/printer.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "print": function() { return /* binding */ print; } -/* harmony export */ }); -/* harmony import */ var _blockString_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -/* harmony import */ var _printString_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./printString.mjs */ "../../../node_modules/graphql/language/printString.mjs"); -/* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); - - - -/** - * Converts an AST into a string, using one set of reasonable - * formatting rules. - */ - -function print(ast) { - return (0,_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit)(ast, printDocASTReducer); -} -const MAX_LINE_LENGTH = 80; -const printDocASTReducer = { - Name: { - leave: (node) => node.value, - }, - Variable: { - leave: (node) => '$' + node.name, - }, - // Document - Document: { - leave: (node) => join(node.definitions, '\n\n'), - }, - OperationDefinition: { - leave(node) { - const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); - const prefix = join( - [ - node.operation, - join([node.name, varDefs]), - join(node.directives, ' '), - ], - ' ', - ); // Anonymous queries with no directives or variable definitions can use - // the query short form. - - return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet; - }, - }, - VariableDefinition: { - leave: ({ variable, type, defaultValue, directives }) => - variable + - ': ' + - type + - wrap(' = ', defaultValue) + - wrap(' ', join(directives, ' ')), - }, - SelectionSet: { - leave: ({ selections }) => block(selections), - }, - Field: { - leave({ alias, name, arguments: args, directives, selectionSet }) { - const prefix = wrap('', alias, ': ') + name; - let argsLine = prefix + wrap('(', join(args, ', '), ')'); - - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); - } - - return join([argsLine, join(directives, ' '), selectionSet], ' '); - }, - }, - Argument: { - leave: ({ name, value }) => name + ': ' + value, - }, - // Fragments - FragmentSpread: { - leave: ({ name, directives }) => - '...' + name + wrap(' ', join(directives, ' ')), - }, - InlineFragment: { - leave: ({ typeCondition, directives, selectionSet }) => - join( - [ - '...', - wrap('on ', typeCondition), - join(directives, ' '), - selectionSet, - ], - ' ', - ), - }, - FragmentDefinition: { - leave: ( - { name, typeCondition, variableDefinitions, directives, selectionSet }, // Note: fragment variable definitions are experimental and may be changed - ) => - // or removed in the future. - `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + - `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + - selectionSet, - }, - // Value - IntValue: { - leave: ({ value }) => value, - }, - FloatValue: { - leave: ({ value }) => value, - }, - StringValue: { - leave: ({ value, block: isBlockString }) => - isBlockString ? (0,_blockString_mjs__WEBPACK_IMPORTED_MODULE_1__.printBlockString)(value) : (0,_printString_mjs__WEBPACK_IMPORTED_MODULE_2__.printString)(value), - }, - BooleanValue: { - leave: ({ value }) => (value ? 'true' : 'false'), - }, - NullValue: { - leave: () => 'null', - }, - EnumValue: { - leave: ({ value }) => value, - }, - ListValue: { - leave: ({ values }) => '[' + join(values, ', ') + ']', - }, - ObjectValue: { - leave: ({ fields }) => '{' + join(fields, ', ') + '}', - }, - ObjectField: { - leave: ({ name, value }) => name + ': ' + value, - }, - // Directive - Directive: { - leave: ({ name, arguments: args }) => - '@' + name + wrap('(', join(args, ', '), ')'), - }, - // Type - NamedType: { - leave: ({ name }) => name, - }, - ListType: { - leave: ({ type }) => '[' + type + ']', - }, - NonNullType: { - leave: ({ type }) => type + '!', - }, - // Type System Definitions - SchemaDefinition: { - leave: ({ description, directives, operationTypes }) => - wrap('', description, '\n') + - join(['schema', join(directives, ' '), block(operationTypes)], ' '), - }, - OperationTypeDefinition: { - leave: ({ operation, type }) => operation + ': ' + type, - }, - ScalarTypeDefinition: { - leave: ({ description, name, directives }) => - wrap('', description, '\n') + - join(['scalar', name, join(directives, ' ')], ' '), - }, - ObjectTypeDefinition: { - leave: ({ description, name, interfaces, directives, fields }) => - wrap('', description, '\n') + - join( - [ - 'type', - name, - wrap('implements ', join(interfaces, ' & ')), - join(directives, ' '), - block(fields), - ], - ' ', - ), - }, - FieldDefinition: { - leave: ({ description, name, arguments: args, type, directives }) => - wrap('', description, '\n') + - name + - (hasMultilineItems(args) - ? wrap('(\n', indent(join(args, '\n')), '\n)') - : wrap('(', join(args, ', '), ')')) + - ': ' + - type + - wrap(' ', join(directives, ' ')), - }, - InputValueDefinition: { - leave: ({ description, name, type, defaultValue, directives }) => - wrap('', description, '\n') + - join( - [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], - ' ', - ), - }, - InterfaceTypeDefinition: { - leave: ({ description, name, interfaces, directives, fields }) => - wrap('', description, '\n') + - join( - [ - 'interface', - name, - wrap('implements ', join(interfaces, ' & ')), - join(directives, ' '), - block(fields), - ], - ' ', - ), - }, - UnionTypeDefinition: { - leave: ({ description, name, directives, types }) => - wrap('', description, '\n') + - join( - ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))], - ' ', - ), - }, - EnumTypeDefinition: { - leave: ({ description, name, directives, values }) => - wrap('', description, '\n') + - join(['enum', name, join(directives, ' '), block(values)], ' '), - }, - EnumValueDefinition: { - leave: ({ description, name, directives }) => - wrap('', description, '\n') + join([name, join(directives, ' ')], ' '), - }, - InputObjectTypeDefinition: { - leave: ({ description, name, directives, fields }) => - wrap('', description, '\n') + - join(['input', name, join(directives, ' '), block(fields)], ' '), - }, - DirectiveDefinition: { - leave: ({ description, name, arguments: args, repeatable, locations }) => - wrap('', description, '\n') + - 'directive @' + - name + - (hasMultilineItems(args) - ? wrap('(\n', indent(join(args, '\n')), '\n)') - : wrap('(', join(args, ', '), ')')) + - (repeatable ? ' repeatable' : '') + - ' on ' + - join(locations, ' | '), - }, - SchemaExtension: { - leave: ({ directives, operationTypes }) => - join( - ['extend schema', join(directives, ' '), block(operationTypes)], - ' ', - ), - }, - ScalarTypeExtension: { - leave: ({ name, directives }) => - join(['extend scalar', name, join(directives, ' ')], ' '), - }, - ObjectTypeExtension: { - leave: ({ name, interfaces, directives, fields }) => - join( - [ - 'extend type', - name, - wrap('implements ', join(interfaces, ' & ')), - join(directives, ' '), - block(fields), - ], - ' ', - ), - }, - InterfaceTypeExtension: { - leave: ({ name, interfaces, directives, fields }) => - join( - [ - 'extend interface', - name, - wrap('implements ', join(interfaces, ' & ')), - join(directives, ' '), - block(fields), - ], - ' ', - ), - }, - UnionTypeExtension: { - leave: ({ name, directives, types }) => - join( - [ - 'extend union', - name, - join(directives, ' '), - wrap('= ', join(types, ' | ')), - ], - ' ', - ), - }, - EnumTypeExtension: { - leave: ({ name, directives, values }) => - join(['extend enum', name, join(directives, ' '), block(values)], ' '), - }, - InputObjectTypeExtension: { - leave: ({ name, directives, fields }) => - join(['extend input', name, join(directives, ' '), block(fields)], ' '), - }, -}; -/** - * Given maybeArray, print an empty string if it is null or empty, otherwise - * print all items together separated by separator if provided - */ - -function join(maybeArray, separator = '') { - var _maybeArray$filter$jo; - - return (_maybeArray$filter$jo = - maybeArray === null || maybeArray === void 0 - ? void 0 - : maybeArray.filter((x) => x).join(separator)) !== null && - _maybeArray$filter$jo !== void 0 - ? _maybeArray$filter$jo - : ''; -} -/** - * Given array, print each item on its own line, wrapped in an indented `{ }` block. - */ - -function block(array) { - return wrap('{\n', indent(join(array, '\n')), '\n}'); -} -/** - * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string. - */ - -function wrap(start, maybeString, end = '') { - return maybeString != null && maybeString !== '' - ? start + maybeString + end - : ''; -} - -function indent(str) { - return wrap(' ', str.replace(/\n/g, '\n ')); -} - -function hasMultilineItems(maybeArray) { - var _maybeArray$some; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - return (_maybeArray$some = - maybeArray === null || maybeArray === void 0 - ? void 0 - : maybeArray.some((str) => str.includes('\n'))) !== null && - _maybeArray$some !== void 0 - ? _maybeArray$some - : false; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/source.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/language/source.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Source": function() { return /* binding */ Source; }, -/* harmony export */ "isSource": function() { return /* binding */ isSource; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); - - - - -/** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but they are useful for clients who store GraphQL documents in source files. - * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might - * be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. - */ -class Source { - constructor( - body, - name = 'GraphQL request', - locationOffset = { - line: 1, - column: 1, - }, - ) { - typeof body === 'string' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)(false, `Body must be a string. Received: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(body)}.`); - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - this.locationOffset.line > 0 || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)( - false, - 'line in locationOffset is 1-indexed and must be positive.', - ); - this.locationOffset.column > 0 || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)( - false, - 'column in locationOffset is 1-indexed and must be positive.', - ); - } - - get [Symbol.toStringTag]() { - return 'Source'; - } -} -/** - * Test if the given value is a Source object. - * - * @internal - */ - -function isSource(source) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_2__.instanceOf)(source, Source); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/tokenKind.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/language/tokenKind.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TokenKind": function() { return /* binding */ TokenKind; } -/* harmony export */ }); -/** - * An exported enum describing the different kinds of tokens that the - * lexer emits. - */ -let TokenKind; -/** - * The enum type representing the token kinds values. - * - * @deprecated Please use `TokenKind`. Will be remove in v17. - */ - -(function (TokenKind) { - TokenKind['SOF'] = ''; - TokenKind['EOF'] = ''; - TokenKind['BANG'] = '!'; - TokenKind['DOLLAR'] = '$'; - TokenKind['AMP'] = '&'; - TokenKind['PAREN_L'] = '('; - TokenKind['PAREN_R'] = ')'; - TokenKind['SPREAD'] = '...'; - TokenKind['COLON'] = ':'; - TokenKind['EQUALS'] = '='; - TokenKind['AT'] = '@'; - TokenKind['BRACKET_L'] = '['; - TokenKind['BRACKET_R'] = ']'; - TokenKind['BRACE_L'] = '{'; - TokenKind['PIPE'] = '|'; - TokenKind['BRACE_R'] = '}'; - TokenKind['NAME'] = 'Name'; - TokenKind['INT'] = 'Int'; - TokenKind['FLOAT'] = 'Float'; - TokenKind['STRING'] = 'String'; - TokenKind['BLOCK_STRING'] = 'BlockString'; - TokenKind['COMMENT'] = 'Comment'; -})(TokenKind || (TokenKind = {})); - - -/***/ }), - -/***/ "../../../node_modules/graphql/language/visitor.mjs": -/*!**********************************************************!*\ - !*** ../../../node_modules/graphql/language/visitor.mjs ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "BREAK": function() { return /* binding */ BREAK; }, -/* harmony export */ "getEnterLeaveForKind": function() { return /* binding */ getEnterLeaveForKind; }, -/* harmony export */ "getVisitFn": function() { return /* binding */ getVisitFn; }, -/* harmony export */ "visit": function() { return /* binding */ visit; }, -/* harmony export */ "visitInParallel": function() { return /* binding */ visitInParallel; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _ast_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - - - - -/** - * A visitor is provided to visit, it contains the collection of - * relevant functions to be called during the visitor's traversal. - */ - -const BREAK = Object.freeze({}); -/** - * visit() will walk through an AST using a depth-first traversal, calling - * the visitor's enter function at each node in the traversal, and calling the - * leave function after visiting that node and all of its child nodes. - * - * By returning different values from the enter and leave functions, the - * behavior of the visitor can be altered, including skipping over a sub-tree of - * the AST (by returning false), editing the AST by returning a value or null - * to remove the value, or to stop the whole traversal by returning BREAK. - * - * When using visit() to edit an AST, the original AST will not be modified, and - * a new version of the AST with the changes applied will be returned from the - * visit function. - * - * ```ts - * const editedAST = visit(ast, { - * enter(node, key, parent, path, ancestors) { - * // @return - * // undefined: no action - * // false: skip visiting this node - * // visitor.BREAK: stop visiting altogether - * // null: delete this node - * // any value: replace this node with the returned value - * }, - * leave(node, key, parent, path, ancestors) { - * // @return - * // undefined: no action - * // false: no action - * // visitor.BREAK: stop visiting altogether - * // null: delete this node - * // any value: replace this node with the returned value - * } - * }); - * ``` - * - * Alternatively to providing enter() and leave() functions, a visitor can - * instead provide functions named the same as the kinds of AST nodes, or - * enter/leave visitors at a named key, leading to three permutations of the - * visitor API: - * - * 1) Named visitors triggered when entering a node of a specific kind. - * - * ```ts - * visit(ast, { - * Kind(node) { - * // enter the "Kind" node - * } - * }) - * ``` - * - * 2) Named visitors that trigger upon entering and leaving a node of a specific kind. - * - * ```ts - * visit(ast, { - * Kind: { - * enter(node) { - * // enter the "Kind" node - * } - * leave(node) { - * // leave the "Kind" node - * } - * } - * }) - * ``` - * - * 3) Generic visitors that trigger upon entering and leaving any node. - * - * ```ts - * visit(ast, { - * enter(node) { - * // enter any node - * }, - * leave(node) { - * // leave any node - * } - * }) - * ``` - */ - -function visit(root, visitor, visitorKeys = _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.QueryDocumentKeys) { - const enterLeaveMap = new Map(); - - for (const kind of Object.values(_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind)) { - enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind)); - } - /* eslint-disable no-undef-init */ - - let stack = undefined; - let inArray = Array.isArray(root); - let keys = [root]; - let index = -1; - let edits = []; - let node = root; - let key = undefined; - let parent = undefined; - const path = []; - const ancestors = []; - /* eslint-enable no-undef-init */ - - do { - index++; - const isLeaving = index === keys.length; - const isEdited = isLeaving && edits.length !== 0; - - if (isLeaving) { - key = ancestors.length === 0 ? undefined : path[path.length - 1]; - node = parent; - parent = ancestors.pop(); - - if (isEdited) { - if (inArray) { - node = node.slice(); - let editOffset = 0; - - for (const [editKey, editValue] of edits) { - const arrayKey = editKey - editOffset; - - if (editValue === null) { - node.splice(arrayKey, 1); - editOffset++; - } else { - node[arrayKey] = editValue; - } - } - } else { - node = Object.defineProperties( - {}, - Object.getOwnPropertyDescriptors(node), - ); - - for (const [editKey, editValue] of edits) { - node[editKey] = editValue; - } - } - } - - index = stack.index; - keys = stack.keys; - edits = stack.edits; - inArray = stack.inArray; - stack = stack.prev; - } else if (parent) { - key = inArray ? index : keys[index]; - node = parent[key]; - - if (node === null || node === undefined) { - continue; - } - - path.push(key); - } - - let result; - - if (!Array.isArray(node)) { - var _enterLeaveMap$get, _enterLeaveMap$get2; - - (0,_ast_mjs__WEBPACK_IMPORTED_MODULE_0__.isNode)(node) || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)(false, `Invalid AST Node: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(node)}.`); - const visitFn = isLeaving - ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || - _enterLeaveMap$get === void 0 - ? void 0 - : _enterLeaveMap$get.leave - : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || - _enterLeaveMap$get2 === void 0 - ? void 0 - : _enterLeaveMap$get2.enter; - result = - visitFn === null || visitFn === void 0 - ? void 0 - : visitFn.call(visitor, node, key, parent, path, ancestors); - - if (result === BREAK) { - break; - } - - if (result === false) { - if (!isLeaving) { - path.pop(); - continue; - } - } else if (result !== undefined) { - edits.push([key, result]); - - if (!isLeaving) { - if ((0,_ast_mjs__WEBPACK_IMPORTED_MODULE_0__.isNode)(result)) { - node = result; - } else { - path.pop(); - continue; - } - } - } - } - - if (result === undefined && isEdited) { - edits.push([key, node]); - } - - if (isLeaving) { - path.pop(); - } else { - var _node$kind; - - stack = { - inArray, - index, - keys, - edits, - prev: stack, - }; - inArray = Array.isArray(node); - keys = inArray - ? node - : (_node$kind = visitorKeys[node.kind]) !== null && - _node$kind !== void 0 - ? _node$kind - : []; - index = -1; - edits = []; - - if (parent) { - ancestors.push(parent); - } - - parent = node; - } - } while (stack !== undefined); - - if (edits.length !== 0) { - // New root - return edits[edits.length - 1][1]; - } - - return root; -} -/** - * Creates a new visitor instance which delegates to many visitors to run in - * parallel. Each visitor will be visited for each node before moving on. - * - * If a prior visitor edits a node, no following visitors will see that node. - */ - -function visitInParallel(visitors) { - const skipping = new Array(visitors.length).fill(null); - const mergedVisitor = Object.create(null); - - for (const kind of Object.values(_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind)) { - let hasVisitor = false; - const enterList = new Array(visitors.length).fill(undefined); - const leaveList = new Array(visitors.length).fill(undefined); - - for (let i = 0; i < visitors.length; ++i) { - const { enter, leave } = getEnterLeaveForKind(visitors[i], kind); - hasVisitor || (hasVisitor = enter != null || leave != null); - enterList[i] = enter; - leaveList[i] = leave; - } - - if (!hasVisitor) { - continue; - } - - const mergedEnterLeave = { - enter(...args) { - const node = args[0]; - - for (let i = 0; i < visitors.length; i++) { - if (skipping[i] === null) { - var _enterList$i; - - const result = - (_enterList$i = enterList[i]) === null || _enterList$i === void 0 - ? void 0 - : _enterList$i.apply(visitors[i], args); - - if (result === false) { - skipping[i] = node; - } else if (result === BREAK) { - skipping[i] = BREAK; - } else if (result !== undefined) { - return result; - } - } - } - }, - - leave(...args) { - const node = args[0]; - - for (let i = 0; i < visitors.length; i++) { - if (skipping[i] === null) { - var _leaveList$i; - - const result = - (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0 - ? void 0 - : _leaveList$i.apply(visitors[i], args); - - if (result === BREAK) { - skipping[i] = BREAK; - } else if (result !== undefined && result !== false) { - return result; - } - } else if (skipping[i] === node) { - skipping[i] = null; - } - } - }, - }; - mergedVisitor[kind] = mergedEnterLeave; - } - - return mergedVisitor; -} -/** - * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind. - */ - -function getEnterLeaveForKind(visitor, kind) { - const kindVisitor = visitor[kind]; - - if (typeof kindVisitor === 'object') { - // { Kind: { enter() {}, leave() {} } } - return kindVisitor; - } else if (typeof kindVisitor === 'function') { - // { Kind() {} } - return { - enter: kindVisitor, - leave: undefined, - }; - } // { enter() {}, leave() {} } - - return { - enter: visitor.enter, - leave: visitor.leave, - }; -} -/** - * Given a visitor instance, if it is leaving or not, and a node kind, return - * the function the visitor runtime should call. - * - * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17 - */ - -/* c8 ignore next 8 */ - -function getVisitFn(visitor, kind, isLeaving) { - const { enter, leave } = getEnterLeaveForKind(visitor, kind); - return isLeaving ? leave : enter; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/assertName.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/assertName.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "assertEnumValueName": function() { return /* binding */ assertEnumValueName; }, -/* harmony export */ "assertName": function() { return /* binding */ assertName; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/characterClasses.mjs */ "../../../node_modules/graphql/language/characterClasses.mjs"); - - - -/** - * Upholds the spec rules about naming. - */ - -function assertName(name) { - name != null || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)(false, 'Must provide name.'); - typeof name === 'string' || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)(false, 'Expected name to be a string.'); - - if (name.length === 0) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError('Expected name to be a non-empty string.'); - } - - for (let i = 1; i < name.length; ++i) { - if (!(0,_language_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isNameContinue)(name.charCodeAt(i))) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Names must only contain [_a-zA-Z0-9] but "${name}" does not.`, - ); - } - } - - if (!(0,_language_characterClasses_mjs__WEBPACK_IMPORTED_MODULE_2__.isNameStart)(name.charCodeAt(0))) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Names must start with [_a-zA-Z] but "${name}" does not.`, - ); - } - - return name; -} -/** - * Upholds the spec rules about naming enum values. - * - * @internal - */ - -function assertEnumValueName(name) { - if (name === 'true' || name === 'false' || name === 'null') { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(`Enum values cannot be named: ${name}`); - } - - return assertName(name); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/definition.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/definition.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "GraphQLEnumType": function() { return /* binding */ GraphQLEnumType; }, -/* harmony export */ "GraphQLInputObjectType": function() { return /* binding */ GraphQLInputObjectType; }, -/* harmony export */ "GraphQLInterfaceType": function() { return /* binding */ GraphQLInterfaceType; }, -/* harmony export */ "GraphQLList": function() { return /* binding */ GraphQLList; }, -/* harmony export */ "GraphQLNonNull": function() { return /* binding */ GraphQLNonNull; }, -/* harmony export */ "GraphQLObjectType": function() { return /* binding */ GraphQLObjectType; }, -/* harmony export */ "GraphQLScalarType": function() { return /* binding */ GraphQLScalarType; }, -/* harmony export */ "GraphQLUnionType": function() { return /* binding */ GraphQLUnionType; }, -/* harmony export */ "argsToArgsConfig": function() { return /* binding */ argsToArgsConfig; }, -/* harmony export */ "assertAbstractType": function() { return /* binding */ assertAbstractType; }, -/* harmony export */ "assertCompositeType": function() { return /* binding */ assertCompositeType; }, -/* harmony export */ "assertEnumType": function() { return /* binding */ assertEnumType; }, -/* harmony export */ "assertInputObjectType": function() { return /* binding */ assertInputObjectType; }, -/* harmony export */ "assertInputType": function() { return /* binding */ assertInputType; }, -/* harmony export */ "assertInterfaceType": function() { return /* binding */ assertInterfaceType; }, -/* harmony export */ "assertLeafType": function() { return /* binding */ assertLeafType; }, -/* harmony export */ "assertListType": function() { return /* binding */ assertListType; }, -/* harmony export */ "assertNamedType": function() { return /* binding */ assertNamedType; }, -/* harmony export */ "assertNonNullType": function() { return /* binding */ assertNonNullType; }, -/* harmony export */ "assertNullableType": function() { return /* binding */ assertNullableType; }, -/* harmony export */ "assertObjectType": function() { return /* binding */ assertObjectType; }, -/* harmony export */ "assertOutputType": function() { return /* binding */ assertOutputType; }, -/* harmony export */ "assertScalarType": function() { return /* binding */ assertScalarType; }, -/* harmony export */ "assertType": function() { return /* binding */ assertType; }, -/* harmony export */ "assertUnionType": function() { return /* binding */ assertUnionType; }, -/* harmony export */ "assertWrappingType": function() { return /* binding */ assertWrappingType; }, -/* harmony export */ "defineArguments": function() { return /* binding */ defineArguments; }, -/* harmony export */ "getNamedType": function() { return /* binding */ getNamedType; }, -/* harmony export */ "getNullableType": function() { return /* binding */ getNullableType; }, -/* harmony export */ "isAbstractType": function() { return /* binding */ isAbstractType; }, -/* harmony export */ "isCompositeType": function() { return /* binding */ isCompositeType; }, -/* harmony export */ "isEnumType": function() { return /* binding */ isEnumType; }, -/* harmony export */ "isInputObjectType": function() { return /* binding */ isInputObjectType; }, -/* harmony export */ "isInputType": function() { return /* binding */ isInputType; }, -/* harmony export */ "isInterfaceType": function() { return /* binding */ isInterfaceType; }, -/* harmony export */ "isLeafType": function() { return /* binding */ isLeafType; }, -/* harmony export */ "isListType": function() { return /* binding */ isListType; }, -/* harmony export */ "isNamedType": function() { return /* binding */ isNamedType; }, -/* harmony export */ "isNonNullType": function() { return /* binding */ isNonNullType; }, -/* harmony export */ "isNullableType": function() { return /* binding */ isNullableType; }, -/* harmony export */ "isObjectType": function() { return /* binding */ isObjectType; }, -/* harmony export */ "isOutputType": function() { return /* binding */ isOutputType; }, -/* harmony export */ "isRequiredArgument": function() { return /* binding */ isRequiredArgument; }, -/* harmony export */ "isRequiredInputField": function() { return /* binding */ isRequiredInputField; }, -/* harmony export */ "isScalarType": function() { return /* binding */ isScalarType; }, -/* harmony export */ "isType": function() { return /* binding */ isType; }, -/* harmony export */ "isUnionType": function() { return /* binding */ isUnionType; }, -/* harmony export */ "isWrappingType": function() { return /* binding */ isWrappingType; }, -/* harmony export */ "resolveObjMapThunk": function() { return /* binding */ resolveObjMapThunk; }, -/* harmony export */ "resolveReadonlyArrayThunk": function() { return /* binding */ resolveReadonlyArrayThunk; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_identityFunc_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/identityFunc.mjs */ "../../../node_modules/graphql/jsutils/identityFunc.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -/* harmony import */ var _jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/mapValue.mjs */ "../../../node_modules/graphql/jsutils/mapValue.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _utilities_valueFromASTUntyped_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/valueFromASTUntyped.mjs */ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs"); -/* harmony import */ var _assertName_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); - - - - - - - - - - - - - - - - -function isType(type) { - return ( - isScalarType(type) || - isObjectType(type) || - isInterfaceType(type) || - isUnionType(type) || - isEnumType(type) || - isInputObjectType(type) || - isListType(type) || - isNonNullType(type) - ); -} -function assertType(type) { - if (!isType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL type.`); - } - - return type; -} -/** - * There are predicates for each kind of GraphQL type. - */ - -function isScalarType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLScalarType); -} -function assertScalarType(type) { - if (!isScalarType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Scalar type.`); - } - - return type; -} -function isObjectType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLObjectType); -} -function assertObjectType(type) { - if (!isObjectType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Object type.`); - } - - return type; -} -function isInterfaceType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLInterfaceType); -} -function assertInterfaceType(type) { - if (!isInterfaceType(type)) { - throw new Error( - `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Interface type.`, - ); - } - - return type; -} -function isUnionType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLUnionType); -} -function assertUnionType(type) { - if (!isUnionType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Union type.`); - } - - return type; -} -function isEnumType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLEnumType); -} -function assertEnumType(type) { - if (!isEnumType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Enum type.`); - } - - return type; -} -function isInputObjectType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLInputObjectType); -} -function assertInputObjectType(type) { - if (!isInputObjectType(type)) { - throw new Error( - `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Input Object type.`, - ); - } - - return type; -} -function isListType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLList); -} -function assertListType(type) { - if (!isListType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL List type.`); - } - - return type; -} -function isNonNullType(type) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_1__.instanceOf)(type, GraphQLNonNull); -} -function assertNonNullType(type) { - if (!isNonNullType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL Non-Null type.`); - } - - return type; -} -/** - * These types may be used as input types for arguments and directives. - */ - -function isInputType(type) { - return ( - isScalarType(type) || - isEnumType(type) || - isInputObjectType(type) || - (isWrappingType(type) && isInputType(type.ofType)) - ); -} -function assertInputType(type) { - if (!isInputType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL input type.`); - } - - return type; -} -/** - * These types may be used as output types as the result of fields. - */ - -function isOutputType(type) { - return ( - isScalarType(type) || - isObjectType(type) || - isInterfaceType(type) || - isUnionType(type) || - isEnumType(type) || - (isWrappingType(type) && isOutputType(type.ofType)) - ); -} -function assertOutputType(type) { - if (!isOutputType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL output type.`); - } - - return type; -} -/** - * These types may describe types which may be leaf values. - */ - -function isLeafType(type) { - return isScalarType(type) || isEnumType(type); -} -function assertLeafType(type) { - if (!isLeafType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL leaf type.`); - } - - return type; -} -/** - * These types may describe the parent context of a selection set. - */ - -function isCompositeType(type) { - return isObjectType(type) || isInterfaceType(type) || isUnionType(type); -} -function assertCompositeType(type) { - if (!isCompositeType(type)) { - throw new Error( - `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL composite type.`, - ); - } - - return type; -} -/** - * These types may describe the parent context of a selection set. - */ - -function isAbstractType(type) { - return isInterfaceType(type) || isUnionType(type); -} -function assertAbstractType(type) { - if (!isAbstractType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL abstract type.`); - } - - return type; -} -/** - * List Type Wrapper - * - * A list is a wrapping type which points to another type. - * Lists are often created within the context of defining the fields of - * an object type. - * - * Example: - * - * ```ts - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * parents: { type: new GraphQLList(PersonType) }, - * children: { type: new GraphQLList(PersonType) }, - * }) - * }) - * ``` - */ - -class GraphQLList { - constructor(ofType) { - isType(ofType) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)(false, `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(ofType)} to be a GraphQL type.`); - this.ofType = ofType; - } - - get [Symbol.toStringTag]() { - return 'GraphQLList'; - } - - toString() { - return '[' + String(this.ofType) + ']'; - } - - toJSON() { - return this.toString(); - } -} -/** - * Non-Null Type Wrapper - * - * A non-null is a wrapping type which points to another type. - * Non-null types enforce that their values are never null and can ensure - * an error is raised if this ever occurs during a request. It is useful for - * fields which you can make a strong guarantee on non-nullability, for example - * usually the id field of a database row will never be null. - * - * Example: - * - * ```ts - * const RowType = new GraphQLObjectType({ - * name: 'Row', - * fields: () => ({ - * id: { type: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * ``` - * Note: the enforcement of non-nullability occurs within the executor. - */ - -class GraphQLNonNull { - constructor(ofType) { - isNullableType(ofType) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(ofType)} to be a GraphQL nullable type.`, - ); - this.ofType = ofType; - } - - get [Symbol.toStringTag]() { - return 'GraphQLNonNull'; - } - - toString() { - return String(this.ofType) + '!'; - } - - toJSON() { - return this.toString(); - } -} -/** - * These types wrap and modify other types - */ - -function isWrappingType(type) { - return isListType(type) || isNonNullType(type); -} -function assertWrappingType(type) { - if (!isWrappingType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL wrapping type.`); - } - - return type; -} -/** - * These types can all accept null as a value. - */ - -function isNullableType(type) { - return isType(type) && !isNonNullType(type); -} -function assertNullableType(type) { - if (!isNullableType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL nullable type.`); - } - - return type; -} -function getNullableType(type) { - if (type) { - return isNonNullType(type) ? type.ofType : type; - } -} -/** - * These named types do not include modifiers like List or NonNull. - */ - -function isNamedType(type) { - return ( - isScalarType(type) || - isObjectType(type) || - isInterfaceType(type) || - isUnionType(type) || - isEnumType(type) || - isInputObjectType(type) - ); -} -function assertNamedType(type) { - if (!isNamedType(type)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)} to be a GraphQL named type.`); - } - - return type; -} -function getNamedType(type) { - if (type) { - let unwrappedType = type; - - while (isWrappingType(unwrappedType)) { - unwrappedType = unwrappedType.ofType; - } - - return unwrappedType; - } -} -/** - * Used while defining GraphQL types to allow for circular references in - * otherwise immutable type definitions. - */ - -function resolveReadonlyArrayThunk(thunk) { - return typeof thunk === 'function' ? thunk() : thunk; -} -function resolveObjMapThunk(thunk) { - return typeof thunk === 'function' ? thunk() : thunk; -} -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ - -/** - * Scalar Type Definition - * - * The leaf values of any request and input values to arguments are - * Scalars (or Enums) and are defined with a name and a series of functions - * used to parse input from ast or variables and to ensure validity. - * - * If a type's serialize function returns `null` or does not return a value - * (i.e. it returns `undefined`) then an error will be raised and a `null` - * value will be returned in the response. It is always better to validate - * - * Example: - * - * ```ts - * const OddType = new GraphQLScalarType({ - * name: 'Odd', - * serialize(value) { - * if (!Number.isFinite(value)) { - * throw new Error( - * `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`, - * ); - * } - * - * if (value % 2 === 0) { - * throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`); - * } - * return value; - * } - * }); - * ``` - */ -class GraphQLScalarType { - constructor(config) { - var _config$parseValue, - _config$serialize, - _config$parseLiteral, - _config$extensionASTN; - - const parseValue = - (_config$parseValue = config.parseValue) !== null && - _config$parseValue !== void 0 - ? _config$parseValue - : _jsutils_identityFunc_mjs__WEBPACK_IMPORTED_MODULE_3__.identityFunc; - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.specifiedByURL = config.specifiedByURL; - this.serialize = - (_config$serialize = config.serialize) !== null && - _config$serialize !== void 0 - ? _config$serialize - : _jsutils_identityFunc_mjs__WEBPACK_IMPORTED_MODULE_3__.identityFunc; - this.parseValue = parseValue; - this.parseLiteral = - (_config$parseLiteral = config.parseLiteral) !== null && - _config$parseLiteral !== void 0 - ? _config$parseLiteral - : (node, variables) => parseValue((0,_utilities_valueFromASTUntyped_mjs__WEBPACK_IMPORTED_MODULE_5__.valueFromASTUntyped)(node, variables)); - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN = config.extensionASTNodes) !== null && - _config$extensionASTN !== void 0 - ? _config$extensionASTN - : []; - config.specifiedByURL == null || - typeof config.specifiedByURL === 'string' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide "specifiedByURL" as a string, ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(config.specifiedByURL)}.`, - ); - config.serialize == null || - typeof config.serialize === 'function' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`, - ); - - if (config.parseLiteral) { - (typeof config.parseValue === 'function' && - typeof config.parseLiteral === 'function') || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide both "parseValue" and "parseLiteral" functions.`, - ); - } - } - - get [Symbol.toStringTag]() { - return 'GraphQLScalarType'; - } - - toConfig() { - return { - name: this.name, - description: this.description, - specifiedByURL: this.specifiedByURL, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -/** - * Object Type Definition - * - * Almost all of the GraphQL types you define will be object types. Object types - * have a name, but most importantly describe their fields. - * - * Example: - * - * ```ts - * const AddressType = new GraphQLObjectType({ - * name: 'Address', - * fields: { - * street: { type: GraphQLString }, - * number: { type: GraphQLInt }, - * formatted: { - * type: GraphQLString, - * resolve(obj) { - * return obj.number + ' ' + obj.street - * } - * } - * } - * }); - * ``` - * - * When two types need to refer to each other, or a type needs to refer to - * itself in a field, you can use a function expression (aka a closure or a - * thunk) to supply the fields lazily. - * - * Example: - * - * ```ts - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * name: { type: GraphQLString }, - * bestFriend: { type: PersonType }, - * }) - * }); - * ``` - */ -class GraphQLObjectType { - constructor(config) { - var _config$extensionASTN2; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.isTypeOf = config.isTypeOf; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN2 = config.extensionASTNodes) !== null && - _config$extensionASTN2 !== void 0 - ? _config$extensionASTN2 - : []; - - this._fields = () => defineFieldMap(config); - - this._interfaces = () => defineInterfaces(config); - - config.isTypeOf == null || - typeof config.isTypeOf === 'function' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide "isTypeOf" as a function, ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(config.isTypeOf)}.`, - ); - } - - get [Symbol.toStringTag]() { - return 'GraphQLObjectType'; - } - - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - - return this._fields; - } - - getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - - return this._interfaces; - } - - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -function defineInterfaces(config) { - var _config$interfaces; - - const interfaces = resolveReadonlyArrayThunk( - (_config$interfaces = config.interfaces) !== null && - _config$interfaces !== void 0 - ? _config$interfaces - : [], - ); - Array.isArray(interfaces) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name} interfaces must be an Array or a function which returns an Array.`, - ); - return interfaces; -} - -function defineFieldMap(config) { - const fieldMap = resolveObjMapThunk(config.fields); - isPlainObj(fieldMap) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, - ); - return (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(fieldMap, (fieldConfig, fieldName) => { - var _fieldConfig$args; - - isPlainObj(fieldConfig) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name}.${fieldName} field config must be an object.`, - ); - fieldConfig.resolve == null || - typeof fieldConfig.resolve === 'function' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name}.${fieldName} field resolver must be a function if ` + - `provided, but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(fieldConfig.resolve)}.`, - ); - const argsConfig = - (_fieldConfig$args = fieldConfig.args) !== null && - _fieldConfig$args !== void 0 - ? _fieldConfig$args - : {}; - isPlainObj(argsConfig) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name}.${fieldName} args must be an object with argument names as keys.`, - ); - return { - name: (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - args: defineArguments(argsConfig), - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - deprecationReason: fieldConfig.deprecationReason, - extensions: (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(fieldConfig.extensions), - astNode: fieldConfig.astNode, - }; - }); -} - -function defineArguments(config) { - return Object.entries(config).map(([argName, argConfig]) => ({ - name: (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(argName), - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(argConfig.extensions), - astNode: argConfig.astNode, - })); -} - -function isPlainObj(obj) { - return (0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_8__.isObjectLike)(obj) && !Array.isArray(obj); -} - -function fieldsToFieldsConfig(fields) { - return (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(fields, (field) => ({ - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode, - })); -} -/** - * @internal - */ - -function argsToArgsConfig(args) { - return (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_9__.keyValMap)( - args, - (arg) => arg.name, - (arg) => ({ - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - astNode: arg.astNode, - }), - ); -} -function isRequiredArgument(arg) { - return isNonNullType(arg.type) && arg.defaultValue === undefined; -} - -/** - * Interface Type Definition - * - * When a field can return one of a heterogeneous set of types, a Interface type - * is used to describe what types are possible, what fields are in common across - * all types, as well as a function to determine which type is actually used - * when the field is resolved. - * - * Example: - * - * ```ts - * const EntityType = new GraphQLInterfaceType({ - * name: 'Entity', - * fields: { - * name: { type: GraphQLString } - * } - * }); - * ``` - */ -class GraphQLInterfaceType { - constructor(config) { - var _config$extensionASTN3; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN3 = config.extensionASTNodes) !== null && - _config$extensionASTN3 !== void 0 - ? _config$extensionASTN3 - : []; - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - config.resolveType == null || - typeof config.resolveType === 'function' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide "resolveType" as a function, ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(config.resolveType)}.`, - ); - } - - get [Symbol.toStringTag]() { - return 'GraphQLInterfaceType'; - } - - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - - return this._fields; - } - - getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - - return this._interfaces; - } - - toConfig() { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -/** - * Union Type Definition - * - * When a field can return one of a heterogeneous set of types, a Union type - * is used to describe what types are possible as well as providing a function - * to determine which type is actually used when the field is resolved. - * - * Example: - * - * ```ts - * const PetType = new GraphQLUnionType({ - * name: 'Pet', - * types: [ DogType, CatType ], - * resolveType(value) { - * if (value instanceof Dog) { - * return DogType; - * } - * if (value instanceof Cat) { - * return CatType; - * } - * } - * }); - * ``` - */ -class GraphQLUnionType { - constructor(config) { - var _config$extensionASTN4; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN4 = config.extensionASTNodes) !== null && - _config$extensionASTN4 !== void 0 - ? _config$extensionASTN4 - : []; - this._types = defineTypes.bind(undefined, config); - config.resolveType == null || - typeof config.resolveType === 'function' || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${this.name} must provide "resolveType" as a function, ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(config.resolveType)}.`, - ); - } - - get [Symbol.toStringTag]() { - return 'GraphQLUnionType'; - } - - getTypes() { - if (typeof this._types === 'function') { - this._types = this._types(); - } - - return this._types; - } - - toConfig() { - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -function defineTypes(config) { - const types = resolveReadonlyArrayThunk(config.types); - Array.isArray(types) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `Must provide Array of types or a function which returns such an array for Union ${config.name}.`, - ); - return types; -} - -/** - * Enum Type Definition - * - * Some leaf values of requests and input values are Enums. GraphQL serializes - * Enum values as strings, however internally Enums can be represented by any - * kind of type, often integers. - * - * Example: - * - * ```ts - * const RGBType = new GraphQLEnumType({ - * name: 'RGB', - * values: { - * RED: { value: 0 }, - * GREEN: { value: 1 }, - * BLUE: { value: 2 } - * } - * }); - * ``` - * - * Note: If a value is not provided in a definition, the name of the enum value - * will be used as its internal value. - */ -class GraphQLEnumType { - /* */ - constructor(config) { - var _config$extensionASTN5; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN5 = config.extensionASTNodes) !== null && - _config$extensionASTN5 !== void 0 - ? _config$extensionASTN5 - : []; - this._values = defineEnumValues(this.name, config.values); - this._valueLookup = new Map( - this._values.map((enumValue) => [enumValue.value, enumValue]), - ); - this._nameLookup = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_10__.keyMap)(this._values, (value) => value.name); - } - - get [Symbol.toStringTag]() { - return 'GraphQLEnumType'; - } - - getValues() { - return this._values; - } - - getValue(name) { - return this._nameLookup[name]; - } - - serialize(outputValue) { - const enumValue = this._valueLookup.get(outputValue); - - if (enumValue === undefined) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__.GraphQLError( - `Enum "${this.name}" cannot represent value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(outputValue)}`, - ); - } - - return enumValue.name; - } - - parseValue(inputValue) /* T */ - { - if (typeof inputValue !== 'string') { - const valueStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(inputValue); - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__.GraphQLError( - `Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + - didYouMeanEnumValue(this, valueStr), - ); - } - - const enumValue = this.getValue(inputValue); - - if (enumValue == null) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__.GraphQLError( - `Value "${inputValue}" does not exist in "${this.name}" enum.` + - didYouMeanEnumValue(this, inputValue), - ); - } - - return enumValue.value; - } - - parseLiteral(valueNode, _variables) /* T */ - { - // Note: variables will be resolved to a value before calling this function. - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_12__.Kind.ENUM) { - const valueStr = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_13__.print)(valueNode); - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__.GraphQLError( - `Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + - didYouMeanEnumValue(this, valueStr), - { - nodes: valueNode, - }, - ); - } - - const enumValue = this.getValue(valueNode.value); - - if (enumValue == null) { - const valueStr = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_13__.print)(valueNode); - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_11__.GraphQLError( - `Value "${valueStr}" does not exist in "${this.name}" enum.` + - didYouMeanEnumValue(this, valueStr), - { - nodes: valueNode, - }, - ); - } - - return enumValue.value; - } - - toConfig() { - const values = (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_9__.keyValMap)( - this.getValues(), - (value) => value.name, - (value) => ({ - description: value.description, - value: value.value, - deprecationReason: value.deprecationReason, - extensions: value.extensions, - astNode: value.astNode, - }), - ); - return { - name: this.name, - description: this.description, - values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -function didYouMeanEnumValue(enumType, unknownValueStr) { - const allNames = enumType.getValues().map((value) => value.name); - const suggestedValues = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_14__.suggestionList)(unknownValueStr, allNames); - return (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_15__.didYouMean)('the enum value', suggestedValues); -} - -function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${typeName} values must be an object with value names as keys.`, - ); - return Object.entries(valueMap).map(([valueName, valueConfig]) => { - isPlainObj(valueConfig) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${typeName}.${valueName} must refer to an object with a "value" key ` + - `representing an internal value but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(valueConfig)}.`, - ); - return { - name: (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertEnumValueName)(valueName), - description: valueConfig.description, - value: valueConfig.value !== undefined ? valueConfig.value : valueName, - deprecationReason: valueConfig.deprecationReason, - extensions: (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(valueConfig.extensions), - astNode: valueConfig.astNode, - }; - }); -} - -/** - * Input Object Type Definition - * - * An input object defines a structured collection of fields which may be - * supplied to a field argument. - * - * Using `NonNull` will ensure that a value must be provided by the query - * - * Example: - * - * ```ts - * const GeoPoint = new GraphQLInputObjectType({ - * name: 'GeoPoint', - * fields: { - * lat: { type: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * ``` - */ -class GraphQLInputObjectType { - constructor(config) { - var _config$extensionASTN6; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(config.name); - this.description = config.description; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN6 = config.extensionASTNodes) !== null && - _config$extensionASTN6 !== void 0 - ? _config$extensionASTN6 - : []; - this._fields = defineInputFieldMap.bind(undefined, config); - } - - get [Symbol.toStringTag]() { - return 'GraphQLInputObjectType'; - } - - getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - - return this._fields; - } - - toConfig() { - const fields = (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(this.getFields(), (field) => ({ - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode, - })); - return { - name: this.name, - description: this.description, - fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - }; - } - - toString() { - return this.name; - } - - toJSON() { - return this.toString(); - } -} - -function defineInputFieldMap(config) { - const fieldMap = resolveObjMapThunk(config.fields); - isPlainObj(fieldMap) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, - ); - return (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(fieldMap, (fieldConfig, fieldName) => { - !('resolve' in fieldConfig) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)( - false, - `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`, - ); - return { - name: (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_4__.assertName)(fieldName), - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_6__.toObjMap)(fieldConfig.extensions), - astNode: fieldConfig.astNode, - }; - }); -} - -function isRequiredInputField(field) { - return isNonNullType(field.type) && field.defaultValue === undefined; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/directives.mjs": -/*!*********************************************************!*\ - !*** ../../../node_modules/graphql/type/directives.mjs ***! - \*********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "DEFAULT_DEPRECATION_REASON": function() { return /* binding */ DEFAULT_DEPRECATION_REASON; }, -/* harmony export */ "GraphQLDeprecatedDirective": function() { return /* binding */ GraphQLDeprecatedDirective; }, -/* harmony export */ "GraphQLDirective": function() { return /* binding */ GraphQLDirective; }, -/* harmony export */ "GraphQLIncludeDirective": function() { return /* binding */ GraphQLIncludeDirective; }, -/* harmony export */ "GraphQLSkipDirective": function() { return /* binding */ GraphQLSkipDirective; }, -/* harmony export */ "GraphQLSpecifiedByDirective": function() { return /* binding */ GraphQLSpecifiedByDirective; }, -/* harmony export */ "assertDirective": function() { return /* binding */ assertDirective; }, -/* harmony export */ "isDirective": function() { return /* binding */ isDirective; }, -/* harmony export */ "isSpecifiedDirective": function() { return /* binding */ isSpecifiedDirective; }, -/* harmony export */ "specifiedDirectives": function() { return /* binding */ specifiedDirectives; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -/* harmony import */ var _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -/* harmony import */ var _assertName_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); -/* harmony import */ var _definition_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _scalars_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); - - - - - - - - - -/** - * Test if the given value is a GraphQL directive. - */ - -function isDirective(directive) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_0__.instanceOf)(directive, GraphQLDirective); -} -function assertDirective(directive) { - if (!isDirective(directive)) { - throw new Error( - `Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(directive)} to be a GraphQL directive.`, - ); - } - - return directive; -} -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ - -/** - * Directives are used by the GraphQL runtime as a way of modifying execution - * behavior. Type system creators will usually not create these directly. - */ -class GraphQLDirective { - constructor(config) { - var _config$isRepeatable, _config$args; - - this.name = (0,_assertName_mjs__WEBPACK_IMPORTED_MODULE_2__.assertName)(config.name); - this.description = config.description; - this.locations = config.locations; - this.isRepeatable = - (_config$isRepeatable = config.isRepeatable) !== null && - _config$isRepeatable !== void 0 - ? _config$isRepeatable - : false; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_3__.toObjMap)(config.extensions); - this.astNode = config.astNode; - Array.isArray(config.locations) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_4__.devAssert)(false, `@${config.name} locations must be an Array.`); - const args = - (_config$args = config.args) !== null && _config$args !== void 0 - ? _config$args - : {}; - ((0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(args) && !Array.isArray(args)) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_4__.devAssert)( - false, - `@${config.name} args must be an object with argument names as keys.`, - ); - this.args = (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_6__.defineArguments)(args); - } - - get [Symbol.toStringTag]() { - return 'GraphQLDirective'; - } - - toConfig() { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_6__.argsToArgsConfig)(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode, - }; - } - - toString() { - return '@' + this.name; - } - - toJSON() { - return this.toString(); - } -} - -/** - * Used to conditionally include fields or fragments. - */ -const GraphQLIncludeDirective = new GraphQLDirective({ - name: 'include', - description: - 'Directs the executor to include this field or fragment only when the `if` argument is true.', - locations: [ - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.FIELD, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.FRAGMENT_SPREAD, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.INLINE_FRAGMENT, - ], - args: { - if: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__.GraphQLBoolean), - description: 'Included when true.', - }, - }, -}); -/** - * Used to conditionally skip (exclude) fields or fragments. - */ - -const GraphQLSkipDirective = new GraphQLDirective({ - name: 'skip', - description: - 'Directs the executor to skip this field or fragment when the `if` argument is true.', - locations: [ - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.FIELD, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.FRAGMENT_SPREAD, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.INLINE_FRAGMENT, - ], - args: { - if: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__.GraphQLBoolean), - description: 'Skipped when true.', - }, - }, -}); -/** - * Constant string used for default reason for a deprecation. - */ - -const DEFAULT_DEPRECATION_REASON = 'No longer supported'; -/** - * Used to declare element of a GraphQL schema as deprecated. - */ - -const GraphQLDeprecatedDirective = new GraphQLDirective({ - name: 'deprecated', - description: 'Marks an element of a GraphQL schema as no longer supported.', - locations: [ - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.FIELD_DEFINITION, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.ARGUMENT_DEFINITION, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.INPUT_FIELD_DEFINITION, - _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.ENUM_VALUE, - ], - args: { - reason: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_8__.GraphQLString, - description: - 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', - defaultValue: DEFAULT_DEPRECATION_REASON, - }, - }, -}); -/** - * Used to provide a URL for specifying the behavior of custom scalar definitions. - */ - -const GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: 'specifiedBy', - description: 'Exposes a URL that specifies the behavior of this scalar.', - locations: [_language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_7__.DirectiveLocation.SCALAR], - args: { - url: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__.GraphQLString), - description: 'The URL that specifies the behavior of this scalar.', - }, - }, -}); -/** - * The full list of specified directives. - */ - -const specifiedDirectives = Object.freeze([ - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, -]); -function isSpecifiedDirective(directive) { - return specifiedDirectives.some(({ name }) => name === directive.name); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/introspection.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/type/introspection.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "SchemaMetaFieldDef": function() { return /* binding */ SchemaMetaFieldDef; }, -/* harmony export */ "TypeKind": function() { return /* binding */ TypeKind; }, -/* harmony export */ "TypeMetaFieldDef": function() { return /* binding */ TypeMetaFieldDef; }, -/* harmony export */ "TypeNameMetaFieldDef": function() { return /* binding */ TypeNameMetaFieldDef; }, -/* harmony export */ "__Directive": function() { return /* binding */ __Directive; }, -/* harmony export */ "__DirectiveLocation": function() { return /* binding */ __DirectiveLocation; }, -/* harmony export */ "__EnumValue": function() { return /* binding */ __EnumValue; }, -/* harmony export */ "__Field": function() { return /* binding */ __Field; }, -/* harmony export */ "__InputValue": function() { return /* binding */ __InputValue; }, -/* harmony export */ "__Schema": function() { return /* binding */ __Schema; }, -/* harmony export */ "__Type": function() { return /* binding */ __Type; }, -/* harmony export */ "__TypeKind": function() { return /* binding */ __TypeKind; }, -/* harmony export */ "introspectionTypes": function() { return /* binding */ introspectionTypes; }, -/* harmony export */ "isIntrospectionType": function() { return /* binding */ isIntrospectionType; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _utilities_astFromValue_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -/* harmony import */ var _definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); - - - - - - - -const __Schema = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__Schema', - description: - 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', - fields: () => ({ - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (schema) => schema.description, - }, - types: { - description: 'A list of all types supported by this server.', - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type))), - - resolve(schema) { - return Object.values(schema.getTypeMap()); - }, - }, - queryType: { - description: 'The type that query operations will be rooted at.', - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type), - resolve: (schema) => schema.getQueryType(), - }, - mutationType: { - description: - 'If this server supports mutation, the type that mutation operations will be rooted at.', - type: __Type, - resolve: (schema) => schema.getMutationType(), - }, - subscriptionType: { - description: - 'If this server support subscription, the type that subscription operations will be rooted at.', - type: __Type, - resolve: (schema) => schema.getSubscriptionType(), - }, - directives: { - description: 'A list of all directives supported by this server.', - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull( - new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Directive)), - ), - resolve: (schema) => schema.getDirectives(), - }, - }), -}); -const __Directive = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__Directive', - description: - "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - fields: () => ({ - name: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - resolve: (directive) => directive.name, - }, - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (directive) => directive.description, - }, - isRepeatable: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean), - resolve: (directive) => directive.isRepeatable, - }, - locations: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull( - new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__DirectiveLocation)), - ), - resolve: (directive) => directive.locations, - }, - args: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull( - new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__InputValue)), - ), - args: { - includeDeprecated: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean, - defaultValue: false, - }, - }, - - resolve(field, { includeDeprecated }) { - return includeDeprecated - ? field.args - : field.args.filter((arg) => arg.deprecationReason == null); - }, - }, - }), -}); -const __DirectiveLocation = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLEnumType({ - name: '__DirectiveLocation', - description: - 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', - values: { - QUERY: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.QUERY, - description: 'Location adjacent to a query operation.', - }, - MUTATION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.MUTATION, - description: 'Location adjacent to a mutation operation.', - }, - SUBSCRIPTION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.SUBSCRIPTION, - description: 'Location adjacent to a subscription operation.', - }, - FIELD: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.FIELD, - description: 'Location adjacent to a field.', - }, - FRAGMENT_DEFINITION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.FRAGMENT_DEFINITION, - description: 'Location adjacent to a fragment definition.', - }, - FRAGMENT_SPREAD: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.FRAGMENT_SPREAD, - description: 'Location adjacent to a fragment spread.', - }, - INLINE_FRAGMENT: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.INLINE_FRAGMENT, - description: 'Location adjacent to an inline fragment.', - }, - VARIABLE_DEFINITION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.VARIABLE_DEFINITION, - description: 'Location adjacent to a variable definition.', - }, - SCHEMA: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.SCHEMA, - description: 'Location adjacent to a schema definition.', - }, - SCALAR: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.SCALAR, - description: 'Location adjacent to a scalar definition.', - }, - OBJECT: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.OBJECT, - description: 'Location adjacent to an object type definition.', - }, - FIELD_DEFINITION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.FIELD_DEFINITION, - description: 'Location adjacent to a field definition.', - }, - ARGUMENT_DEFINITION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.ARGUMENT_DEFINITION, - description: 'Location adjacent to an argument definition.', - }, - INTERFACE: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.INTERFACE, - description: 'Location adjacent to an interface definition.', - }, - UNION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.UNION, - description: 'Location adjacent to a union definition.', - }, - ENUM: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.ENUM, - description: 'Location adjacent to an enum definition.', - }, - ENUM_VALUE: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.ENUM_VALUE, - description: 'Location adjacent to an enum value definition.', - }, - INPUT_OBJECT: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.INPUT_OBJECT, - description: 'Location adjacent to an input object type definition.', - }, - INPUT_FIELD_DEFINITION: { - value: _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_2__.DirectiveLocation.INPUT_FIELD_DEFINITION, - description: 'Location adjacent to an input object field definition.', - }, - }, -}); -const __Type = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__Type', - description: - 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', - fields: () => ({ - kind: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__TypeKind), - - resolve(type) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isScalarType)(type)) { - return TypeKind.SCALAR; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(type)) { - return TypeKind.OBJECT; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(type)) { - return TypeKind.INTERFACE; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isUnionType)(type)) { - return TypeKind.UNION; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(type)) { - return TypeKind.ENUM; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(type)) { - return TypeKind.INPUT_OBJECT; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(type)) { - return TypeKind.LIST; - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(type)) { - return TypeKind.NON_NULL; - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered) - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false, `Unexpected type: "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__.inspect)(type)}".`); - }, - }, - name: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (type) => ('name' in type ? type.name : undefined), - }, - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: ( - type, // FIXME: add test case - ) => - /* c8 ignore next */ - 'description' in type ? type.description : undefined, - }, - specifiedByURL: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (obj) => - 'specifiedByURL' in obj ? obj.specifiedByURL : undefined, - }, - fields: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Field)), - args: { - includeDeprecated: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean, - defaultValue: false, - }, - }, - - resolve(type, { includeDeprecated }) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(type) || (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(type)) { - const fields = Object.values(type.getFields()); - return includeDeprecated - ? fields - : fields.filter((field) => field.deprecationReason == null); - } - }, - }, - interfaces: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type)), - - resolve(type) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(type) || (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(type)) { - return type.getInterfaces(); - } - }, - }, - possibleTypes: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type)), - - resolve(type, _args, _context, { schema }) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isAbstractType)(type)) { - return schema.getPossibleTypes(type); - } - }, - }, - enumValues: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean, - defaultValue: false, - }, - }, - - resolve(type, { includeDeprecated }) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(type)) { - const values = type.getValues(); - return includeDeprecated - ? values - : values.filter((field) => field.deprecationReason == null); - } - }, - }, - inputFields: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean, - defaultValue: false, - }, - }, - - resolve(type, { includeDeprecated }) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(type)) { - const values = Object.values(type.getFields()); - return includeDeprecated - ? values - : values.filter((field) => field.deprecationReason == null); - } - }, - }, - ofType: { - type: __Type, - resolve: (type) => ('ofType' in type ? type.ofType : undefined), - }, - }), -}); -const __Field = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__Field', - description: - 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', - fields: () => ({ - name: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - resolve: (field) => field.name, - }, - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (field) => field.description, - }, - args: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull( - new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLList(new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__InputValue)), - ), - args: { - includeDeprecated: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean, - defaultValue: false, - }, - }, - - resolve(field, { includeDeprecated }) { - return includeDeprecated - ? field.args - : field.args.filter((arg) => arg.deprecationReason == null); - }, - }, - type: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type), - resolve: (field) => field.type, - }, - isDeprecated: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean), - resolve: (field) => field.deprecationReason != null, - }, - deprecationReason: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (field) => field.deprecationReason, - }, - }), -}); -const __InputValue = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__InputValue', - description: - 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', - fields: () => ({ - name: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - resolve: (inputValue) => inputValue.name, - }, - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (inputValue) => inputValue.description, - }, - type: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Type), - resolve: (inputValue) => inputValue.type, - }, - defaultValue: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - description: - 'A GraphQL-formatted string representing the default value for this input value.', - - resolve(inputValue) { - const { type, defaultValue } = inputValue; - const valueAST = (0,_utilities_astFromValue_mjs__WEBPACK_IMPORTED_MODULE_5__.astFromValue)(defaultValue, type); - return valueAST ? (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(valueAST) : null; - }, - }, - isDeprecated: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean), - resolve: (field) => field.deprecationReason != null, - }, - deprecationReason: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (obj) => obj.deprecationReason, - }, - }), -}); -const __EnumValue = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLObjectType({ - name: '__EnumValue', - description: - 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', - fields: () => ({ - name: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - resolve: (enumValue) => enumValue.name, - }, - description: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (enumValue) => enumValue.description, - }, - isDeprecated: { - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLBoolean), - resolve: (enumValue) => enumValue.deprecationReason != null, - }, - deprecationReason: { - type: _scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString, - resolve: (enumValue) => enumValue.deprecationReason, - }, - }), -}); -let TypeKind; - -(function (TypeKind) { - TypeKind['SCALAR'] = 'SCALAR'; - TypeKind['OBJECT'] = 'OBJECT'; - TypeKind['INTERFACE'] = 'INTERFACE'; - TypeKind['UNION'] = 'UNION'; - TypeKind['ENUM'] = 'ENUM'; - TypeKind['INPUT_OBJECT'] = 'INPUT_OBJECT'; - TypeKind['LIST'] = 'LIST'; - TypeKind['NON_NULL'] = 'NON_NULL'; -})(TypeKind || (TypeKind = {})); - -const __TypeKind = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLEnumType({ - name: '__TypeKind', - description: 'An enum describing what kind of type a given `__Type` is.', - values: { - SCALAR: { - value: TypeKind.SCALAR, - description: 'Indicates this type is a scalar.', - }, - OBJECT: { - value: TypeKind.OBJECT, - description: - 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', - }, - INTERFACE: { - value: TypeKind.INTERFACE, - description: - 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', - }, - UNION: { - value: TypeKind.UNION, - description: - 'Indicates this type is a union. `possibleTypes` is a valid field.', - }, - ENUM: { - value: TypeKind.ENUM, - description: - 'Indicates this type is an enum. `enumValues` is a valid field.', - }, - INPUT_OBJECT: { - value: TypeKind.INPUT_OBJECT, - description: - 'Indicates this type is an input object. `inputFields` is a valid field.', - }, - LIST: { - value: TypeKind.LIST, - description: 'Indicates this type is a list. `ofType` is a valid field.', - }, - NON_NULL: { - value: TypeKind.NON_NULL, - description: - 'Indicates this type is a non-null. `ofType` is a valid field.', - }, - }, -}); -/** - * Note that these are GraphQLField and not GraphQLFieldConfig, - * so the format for args is different. - */ - -const SchemaMetaFieldDef = { - name: '__schema', - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(__Schema), - description: 'Access the current type schema of this server.', - args: [], - resolve: (_source, _args, _context, { schema }) => schema, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined, -}; -const TypeMetaFieldDef = { - name: '__type', - type: __Type, - description: 'Request the type information of a single type.', - args: [ - { - name: 'name', - description: undefined, - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - defaultValue: undefined, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined, - }, - ], - resolve: (_source, { name }, _context, { schema }) => schema.getType(name), - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined, -}; -const TypeNameMetaFieldDef = { - name: '__typename', - type: new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLNonNull(_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLString), - description: 'The name of the current Object type at runtime.', - args: [], - resolve: (_source, _args, _context, { parentType }) => parentType.name, - deprecationReason: undefined, - extensions: Object.create(null), - astNode: undefined, -}; -const introspectionTypes = Object.freeze([ - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, -]); -function isIntrospectionType(type) { - return introspectionTypes.some(({ name }) => type.name === name); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/scalars.mjs": -/*!******************************************************!*\ - !*** ../../../node_modules/graphql/type/scalars.mjs ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "GRAPHQL_MAX_INT": function() { return /* binding */ GRAPHQL_MAX_INT; }, -/* harmony export */ "GRAPHQL_MIN_INT": function() { return /* binding */ GRAPHQL_MIN_INT; }, -/* harmony export */ "GraphQLBoolean": function() { return /* binding */ GraphQLBoolean; }, -/* harmony export */ "GraphQLFloat": function() { return /* binding */ GraphQLFloat; }, -/* harmony export */ "GraphQLID": function() { return /* binding */ GraphQLID; }, -/* harmony export */ "GraphQLInt": function() { return /* binding */ GraphQLInt; }, -/* harmony export */ "GraphQLString": function() { return /* binding */ GraphQLString; }, -/* harmony export */ "isSpecifiedScalarType": function() { return /* binding */ isSpecifiedScalarType; }, -/* harmony export */ "specifiedScalarTypes": function() { return /* binding */ specifiedScalarTypes; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - - -/** - * Maximum possible Int value as per GraphQL Spec (32-bit signed integer). - * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1 - * */ - -const GRAPHQL_MAX_INT = 2147483647; -/** - * Minimum possible Int value as per GraphQL Spec (32-bit signed integer). - * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1) - * */ - -const GRAPHQL_MIN_INT = -2147483648; -const GraphQLInt = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLScalarType({ - name: 'Int', - description: - 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', - - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - let num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (typeof num !== 'number' || !Number.isInteger(num)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Int cannot represent non-integer value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(coercedValue)}`, - ); - } - - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - 'Int cannot represent non 32-bit signed integer value: ' + - (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(coercedValue), - ); - } - - return num; - }, - - parseValue(inputValue) { - if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Int cannot represent non-integer value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputValue)}`, - ); - } - - if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Int cannot represent non 32-bit signed integer value: ${inputValue}`, - ); - } - - return inputValue; - }, - - parseLiteral(valueNode) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Int cannot represent non-integer value: ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)(valueNode)}`, - { - nodes: valueNode, - }, - ); - } - - const num = parseInt(valueNode.value, 10); - - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, - { - nodes: valueNode, - }, - ); - } - - return num; - }, -}); -const GraphQLFloat = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLScalarType({ - name: 'Float', - description: - 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', - - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - let num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (typeof num !== 'number' || !Number.isFinite(num)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Float cannot represent non numeric value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(coercedValue)}`, - ); - } - - return num; - }, - - parseValue(inputValue) { - if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Float cannot represent non numeric value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputValue)}`, - ); - } - - return inputValue; - }, - - parseLiteral(valueNode) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FLOAT && valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Float cannot represent non numeric value: ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)(valueNode)}`, - valueNode, - ); - } - - return parseFloat(valueNode.value); - }, -}); -const GraphQLString = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLScalarType({ - name: 'String', - description: - 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', - - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not - // attempt to coerce object, function, symbol, or other types as strings. - - if (typeof coercedValue === 'string') { - return coercedValue; - } - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 'true' : 'false'; - } - - if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) { - return coercedValue.toString(); - } - - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `String cannot represent value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(outputValue)}`, - ); - }, - - parseValue(inputValue) { - if (typeof inputValue !== 'string') { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `String cannot represent a non string value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputValue)}`, - ); - } - - return inputValue; - }, - - parseLiteral(valueNode) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.STRING) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `String cannot represent a non string value: ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)(valueNode)}`, - { - nodes: valueNode, - }, - ); - } - - return valueNode.value; - }, -}); -const GraphQLBoolean = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLScalarType({ - name: 'Boolean', - description: 'The `Boolean` scalar type represents `true` or `false`.', - - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue; - } - - if (Number.isFinite(coercedValue)) { - return coercedValue !== 0; - } - - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Boolean cannot represent a non boolean value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(coercedValue)}`, - ); - }, - - parseValue(inputValue) { - if (typeof inputValue !== 'boolean') { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Boolean cannot represent a non boolean value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputValue)}`, - ); - } - - return inputValue; - }, - - parseLiteral(valueNode) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.BOOLEAN) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Boolean cannot represent a non boolean value: ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)(valueNode)}`, - { - nodes: valueNode, - }, - ); - } - - return valueNode.value; - }, -}); -const GraphQLID = new _definition_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLScalarType({ - name: 'ID', - description: - 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', - - serialize(outputValue) { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'string') { - return coercedValue; - } - - if (Number.isInteger(coercedValue)) { - return String(coercedValue); - } - - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `ID cannot represent value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(outputValue)}`, - ); - }, - - parseValue(inputValue) { - if (typeof inputValue === 'string') { - return inputValue; - } - - if (typeof inputValue === 'number' && Number.isInteger(inputValue)) { - return inputValue.toString(); - } - - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(`ID cannot represent value: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputValue)}`); - }, - - parseLiteral(valueNode) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.STRING && valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INT) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - 'ID cannot represent a non-string and non-integer value: ' + - (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)(valueNode), - { - nodes: valueNode, - }, - ); - } - - return valueNode.value; - }, -}); -const specifiedScalarTypes = Object.freeze([ - GraphQLString, - GraphQLInt, - GraphQLFloat, - GraphQLBoolean, - GraphQLID, -]); -function isSpecifiedScalarType(type) { - return specifiedScalarTypes.some(({ name }) => type.name === name); -} // Support serializing objects with custom valueOf() or toJSON() functions - -// a common way to represent a complex value which can be represented as -// a string (ex: MongoDB id objects). - -function serializeObject(outputValue) { - if ((0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(outputValue)) { - if (typeof outputValue.valueOf === 'function') { - const valueOfResult = outputValue.valueOf(); - - if (!(0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectLike)(valueOfResult)) { - return valueOfResult; - } - } - - if (typeof outputValue.toJSON === 'function') { - return outputValue.toJSON(); - } - } - - return outputValue; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/schema.mjs": -/*!*****************************************************!*\ - !*** ../../../node_modules/graphql/type/schema.mjs ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "GraphQLSchema": function() { return /* binding */ GraphQLSchema; }, -/* harmony export */ "assertSchema": function() { return /* binding */ assertSchema; }, -/* harmony export */ "isSchema": function() { return /* binding */ isSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/instanceOf.mjs */ "../../../node_modules/graphql/jsutils/instanceOf.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/toObjMap.mjs */ "../../../node_modules/graphql/jsutils/toObjMap.mjs"); -/* harmony import */ var _language_ast_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _definition_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _directives_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _introspection_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); - - - - - - - - - -/** - * Test if the given value is a GraphQL schema. - */ - -function isSchema(schema) { - return (0,_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_0__.instanceOf)(schema, GraphQLSchema); -} -function assertSchema(schema) { - if (!isSchema(schema)) { - throw new Error(`Expected ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(schema)} to be a GraphQL schema.`); - } - - return schema; -} -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ - -/** - * Schema Definition - * - * A Schema is created by supplying the root types of each type of operation, - * query and mutation (optional). A schema definition is then supplied to the - * validator and executor. - * - * Example: - * - * ```ts - * const MyAppSchema = new GraphQLSchema({ - * query: MyAppQueryRootType, - * mutation: MyAppMutationRootType, - * }) - * ``` - * - * Note: When the schema is constructed, by default only the types that are - * reachable by traversing the root types are included, other types must be - * explicitly referenced. - * - * Example: - * - * ```ts - * const characterInterface = new GraphQLInterfaceType({ - * name: 'Character', - * ... - * }); - * - * const humanType = new GraphQLObjectType({ - * name: 'Human', - * interfaces: [characterInterface], - * ... - * }); - * - * const droidType = new GraphQLObjectType({ - * name: 'Droid', - * interfaces: [characterInterface], - * ... - * }); - * - * const schema = new GraphQLSchema({ - * query: new GraphQLObjectType({ - * name: 'Query', - * fields: { - * hero: { type: characterInterface, ... }, - * } - * }), - * ... - * // Since this schema references only the `Character` interface it's - * // necessary to explicitly list the types that implement it if - * // you want them to be included in the final schema. - * types: [humanType, droidType], - * }) - * ``` - * - * Note: If an array of `directives` are provided to GraphQLSchema, that will be - * the exact list of directives represented and allowed. If `directives` is not - * provided then a default set of the specified directives (e.g. `@include` and - * `@skip`) will be used. If you wish to provide *additional* directives to these - * specified directives, you must explicitly declare them. Example: - * - * ```ts - * const MyAppSchema = new GraphQLSchema({ - * ... - * directives: specifiedDirectives.concat([ myCustomDirective ]), - * }) - * ``` - */ -class GraphQLSchema { - // Used as a cache for validateSchema(). - constructor(config) { - var _config$extensionASTN, _config$directives; - - // If this schema was built from a source known to be valid, then it may be - // marked with assumeValid to avoid an additional type system validation. - this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors. - - (0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectLike)(config) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_3__.devAssert)(false, 'Must provide configuration object.'); - !config.types || - Array.isArray(config.types) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_3__.devAssert)( - false, - `"types" must be Array if provided but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(config.types)}.`, - ); - !config.directives || - Array.isArray(config.directives) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_3__.devAssert)( - false, - '"directives" must be Array if provided but got: ' + - `${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(config.directives)}.`, - ); - this.description = config.description; - this.extensions = (0,_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_4__.toObjMap)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = - (_config$extensionASTN = config.extensionASTNodes) !== null && - _config$extensionASTN !== void 0 - ? _config$extensionASTN - : []; - this._queryType = config.query; - this._mutationType = config.mutation; - this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. - - this._directives = - (_config$directives = config.directives) !== null && - _config$directives !== void 0 - ? _config$directives - : _directives_mjs__WEBPACK_IMPORTED_MODULE_5__.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to - // the set of "collected" types, so `collectReferencedTypes` ignore them. - - const allReferencedTypes = new Set(config.types); - - if (config.types != null) { - for (const type of config.types) { - // When we ready to process this type, we remove it from "collected" types - // and then add it together with all dependent types in the correct position. - allReferencedTypes.delete(type); - collectReferencedTypes(type, allReferencedTypes); - } - } - - if (this._queryType != null) { - collectReferencedTypes(this._queryType, allReferencedTypes); - } - - if (this._mutationType != null) { - collectReferencedTypes(this._mutationType, allReferencedTypes); - } - - if (this._subscriptionType != null) { - collectReferencedTypes(this._subscriptionType, allReferencedTypes); - } - - for (const directive of this._directives) { - // Directives are not validated until validateSchema() is called. - if ((0,_directives_mjs__WEBPACK_IMPORTED_MODULE_5__.isDirective)(directive)) { - for (const arg of directive.args) { - collectReferencedTypes(arg.type, allReferencedTypes); - } - } - } - - collectReferencedTypes(_introspection_mjs__WEBPACK_IMPORTED_MODULE_6__.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema. - - this._typeMap = Object.create(null); - this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name. - - this._implementationsMap = Object.create(null); - - for (const namedType of allReferencedTypes) { - if (namedType == null) { - continue; - } - - const typeName = namedType.name; - typeName || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_3__.devAssert)( - false, - 'One of the provided types for building the Schema is missing a name.', - ); - - if (this._typeMap[typeName] !== undefined) { - throw new Error( - `Schema must contain uniquely named types but contains multiple types named "${typeName}".`, - ); - } - - this._typeMap[typeName] = namedType; - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInterfaceType)(namedType)) { - // Store implementations by interface. - for (const iface of namedType.getInterfaces()) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInterfaceType)(iface)) { - let implementations = this._implementationsMap[iface.name]; - - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [], - }; - } - - implementations.interfaces.push(namedType); - } - } - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isObjectType)(namedType)) { - // Store implementations by objects. - for (const iface of namedType.getInterfaces()) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInterfaceType)(iface)) { - let implementations = this._implementationsMap[iface.name]; - - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [], - }; - } - - implementations.objects.push(namedType); - } - } - } - } - } - - get [Symbol.toStringTag]() { - return 'GraphQLSchema'; - } - - getQueryType() { - return this._queryType; - } - - getMutationType() { - return this._mutationType; - } - - getSubscriptionType() { - return this._subscriptionType; - } - - getRootType(operation) { - switch (operation) { - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_8__.OperationTypeNode.QUERY: - return this.getQueryType(); - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_8__.OperationTypeNode.MUTATION: - return this.getMutationType(); - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_8__.OperationTypeNode.SUBSCRIPTION: - return this.getSubscriptionType(); - } - } - - getTypeMap() { - return this._typeMap; - } - - getType(name) { - return this.getTypeMap()[name]; - } - - getPossibleTypes(abstractType) { - return (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isUnionType)(abstractType) - ? abstractType.getTypes() - : this.getImplementations(abstractType).objects; - } - - getImplementations(interfaceType) { - const implementations = this._implementationsMap[interfaceType.name]; - return implementations !== null && implementations !== void 0 - ? implementations - : { - objects: [], - interfaces: [], - }; - } - - isSubType(abstractType, maybeSubType) { - let map = this._subTypeMap[abstractType.name]; - - if (map === undefined) { - map = Object.create(null); - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isUnionType)(abstractType)) { - for (const type of abstractType.getTypes()) { - map[type.name] = true; - } - } else { - const implementations = this.getImplementations(abstractType); - - for (const type of implementations.objects) { - map[type.name] = true; - } - - for (const type of implementations.interfaces) { - map[type.name] = true; - } - } - - this._subTypeMap[abstractType.name] = map; - } - - return map[maybeSubType.name] !== undefined; - } - - getDirectives() { - return this._directives; - } - - getDirective(name) { - return this.getDirectives().find((directive) => directive.name === name); - } - - toConfig() { - return { - description: this.description, - query: this.getQueryType(), - mutation: this.getMutationType(), - subscription: this.getSubscriptionType(), - types: Object.values(this.getTypeMap()), - directives: this.getDirectives(), - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes, - assumeValid: this.__validationErrors !== undefined, - }; - } -} - -function collectReferencedTypes(type, typeSet) { - const namedType = (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.getNamedType)(type); - - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isUnionType)(namedType)) { - for (const memberType of namedType.getTypes()) { - collectReferencedTypes(memberType, typeSet); - } - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isObjectType)(namedType) || (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInterfaceType)(namedType)) { - for (const interfaceType of namedType.getInterfaces()) { - collectReferencedTypes(interfaceType, typeSet); - } - - for (const field of Object.values(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - - for (const arg of field.args) { - collectReferencedTypes(arg.type, typeSet); - } - } - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInputObjectType)(namedType)) { - for (const field of Object.values(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - } - } - } - - return typeSet; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/type/validate.mjs": -/*!*******************************************************!*\ - !*** ../../../node_modules/graphql/type/validate.mjs ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "assertValidSchema": function() { return /* binding */ assertValidSchema; }, -/* harmony export */ "validateSchema": function() { return /* binding */ validateSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_ast_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -/* harmony import */ var _definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _directives_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _introspection_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _schema_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); - - - - - - - - -/** - * Implements the "Type Validation" sub-sections of the specification's - * "Type System" section. - * - * Validation runs synchronously, returning an array of encountered errors, or - * an empty array if no errors were encountered and the Schema is valid. - */ - -function validateSchema(schema) { - // First check to ensure the provided value is in fact a GraphQLSchema. - (0,_schema_mjs__WEBPACK_IMPORTED_MODULE_0__.assertSchema)(schema); // If this Schema has already been validated, return the previous results. - - if (schema.__validationErrors) { - return schema.__validationErrors; - } // Validate the schema, producing a list of errors. - - const context = new SchemaValidationContext(schema); - validateRootTypes(context); - validateDirectives(context); - validateTypes(context); // Persist the results of validation before returning to ensure validation - // does not run multiple times for this schema. - - const errors = context.getErrors(); - schema.__validationErrors = errors; - return errors; -} -/** - * Utility function which asserts a schema is valid by throwing an error if - * it is invalid. - */ - -function assertValidSchema(schema) { - const errors = validateSchema(schema); - - if (errors.length !== 0) { - throw new Error(errors.map((error) => error.message).join('\n\n')); - } -} - -class SchemaValidationContext { - constructor(schema) { - this._errors = []; - this.schema = schema; - } - - reportError(message, nodes) { - const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; - - this._errors.push( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(message, { - nodes: _nodes, - }), - ); - } - - getErrors() { - return this._errors; - } -} - -function validateRootTypes(context) { - const schema = context.schema; - const queryType = schema.getQueryType(); - - if (!queryType) { - context.reportError('Query root type must be provided.', schema.astNode); - } else if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(queryType)) { - var _getOperationTypeNode; - - context.reportError( - `Query root type must be Object type, it cannot be ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)( - queryType, - )}.`, - (_getOperationTypeNode = getOperationTypeNode( - schema, - _language_ast_mjs__WEBPACK_IMPORTED_MODULE_4__.OperationTypeNode.QUERY, - )) !== null && _getOperationTypeNode !== void 0 - ? _getOperationTypeNode - : queryType.astNode, - ); - } - - const mutationType = schema.getMutationType(); - - if (mutationType && !(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(mutationType)) { - var _getOperationTypeNode2; - - context.reportError( - 'Mutation root type must be Object type if provided, it cannot be ' + - `${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(mutationType)}.`, - (_getOperationTypeNode2 = getOperationTypeNode( - schema, - _language_ast_mjs__WEBPACK_IMPORTED_MODULE_4__.OperationTypeNode.MUTATION, - )) !== null && _getOperationTypeNode2 !== void 0 - ? _getOperationTypeNode2 - : mutationType.astNode, - ); - } - - const subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType && !(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(subscriptionType)) { - var _getOperationTypeNode3; - - context.reportError( - 'Subscription root type must be Object type if provided, it cannot be ' + - `${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(subscriptionType)}.`, - (_getOperationTypeNode3 = getOperationTypeNode( - schema, - _language_ast_mjs__WEBPACK_IMPORTED_MODULE_4__.OperationTypeNode.SUBSCRIPTION, - )) !== null && _getOperationTypeNode3 !== void 0 - ? _getOperationTypeNode3 - : subscriptionType.astNode, - ); - } -} - -function getOperationTypeNode(schema, operation) { - var _flatMap$find; - - return (_flatMap$find = [schema.astNode, ...schema.extensionASTNodes] - .flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - (schemaNode) => { - var _schemaNode$operation; - - return ( - /* c8 ignore next */ - (_schemaNode$operation = - schemaNode === null || schemaNode === void 0 - ? void 0 - : schemaNode.operationTypes) !== null && - _schemaNode$operation !== void 0 - ? _schemaNode$operation - : [] - ); - }, - ) - .find((operationNode) => operationNode.operation === operation)) === null || - _flatMap$find === void 0 - ? void 0 - : _flatMap$find.type; -} - -function validateDirectives(context) { - for (const directive of context.schema.getDirectives()) { - // Ensure all directives are in fact GraphQL directives. - if (!(0,_directives_mjs__WEBPACK_IMPORTED_MODULE_5__.isDirective)(directive)) { - context.reportError( - `Expected directive but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(directive)}.`, - directive === null || directive === void 0 ? void 0 : directive.astNode, - ); - continue; - } // Ensure they are named correctly. - - validateName(context, directive); // TODO: Ensure proper locations. - // Ensure the arguments are valid. - - for (const arg of directive.args) { - // Ensure they are named correctly. - validateName(context, arg); // Ensure the type is an input type. - - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputType)(arg.type)) { - context.reportError( - `The type of @${directive.name}(${arg.name}:) must be Input Type ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(arg.type)}.`, - arg.astNode, - ); - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode; - - context.reportError( - `Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(arg.astNode), - (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 - ? void 0 - : _arg$astNode.type, - ], - ); - } - } - } -} - -function validateName(context, node) { - // Ensure names are valid, however introspection types opt out. - if (node.name.startsWith('__')) { - context.reportError( - `Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, - node.astNode, - ); - } -} - -function validateTypes(context) { - const validateInputObjectCircularRefs = - createInputObjectCircularRefsValidator(context); - const typeMap = context.schema.getTypeMap(); - - for (const type of Object.values(typeMap)) { - // Ensure all provided types are in fact GraphQL type. - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNamedType)(type)) { - context.reportError( - `Expected GraphQL named type but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(type)}.`, - type.astNode, - ); - continue; - } // Ensure it is named correctly (excluding introspection types). - - if (!(0,_introspection_mjs__WEBPACK_IMPORTED_MODULE_6__.isIntrospectionType)(type)) { - validateName(context, type); - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(type)) { - // Ensure fields are valid - validateFields(context, type); // Ensure objects implement the interfaces they claim to. - - validateInterfaces(context, type); - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(type)) { - // Ensure fields are valid. - validateFields(context, type); // Ensure interfaces implement the interfaces they claim to. - - validateInterfaces(context, type); - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isUnionType)(type)) { - // Ensure Unions include valid member types. - validateUnionMembers(context, type); - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isEnumType)(type)) { - // Ensure Enums have valid values. - validateEnumValues(context, type); - } else if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType)(type)) { - // Ensure Input Object fields are valid. - validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references - - validateInputObjectCircularRefs(type); - } - } -} - -function validateFields(context, type) { - const fields = Object.values(type.getFields()); // Objects and Interfaces both must define one or more fields. - - if (fields.length === 0) { - context.reportError(`Type ${type.name} must define one or more fields.`, [ - type.astNode, - ...type.extensionASTNodes, - ]); - } - - for (const field of fields) { - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an output type - - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isOutputType)(field.type)) { - var _field$astNode; - - context.reportError( - `The type of ${type.name}.${field.name} must be Output Type ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(field.type)}.`, - (_field$astNode = field.astNode) === null || _field$astNode === void 0 - ? void 0 - : _field$astNode.type, - ); - } // Ensure the arguments are valid - - for (const arg of field.args) { - const argName = arg.name; // Ensure they are named correctly. - - validateName(context, arg); // Ensure the type is an input type - - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputType)(arg.type)) { - var _arg$astNode2; - - context.reportError( - `The type of ${type.name}.${field.name}(${argName}:) must be Input ` + - `Type but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(arg.type)}.`, - (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 - ? void 0 - : _arg$astNode2.type, - ); - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode3; - - context.reportError( - `Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(arg.astNode), - (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 - ? void 0 - : _arg$astNode3.type, - ], - ); - } - } - } -} - -function validateInterfaces(context, type) { - const ifaceTypeNames = Object.create(null); - - for (const iface of type.getInterfaces()) { - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(iface)) { - context.reportError( - `Type ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(type)} must only implement Interface types, ` + - `it cannot implement ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(iface)}.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - if (type === iface) { - context.reportError( - `Type ${type.name} cannot implement itself because it would create a circular reference.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - if (ifaceTypeNames[iface.name]) { - context.reportError( - `Type ${type.name} can only implement ${iface.name} once.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - ifaceTypeNames[iface.name] = true; - validateTypeImplementsAncestors(context, type, iface); - validateTypeImplementsInterface(context, type, iface); - } -} - -function validateTypeImplementsInterface(context, type, iface) { - const typeFieldMap = type.getFields(); // Assert each interface field is implemented. - - for (const ifaceField of Object.values(iface.getFields())) { - const fieldName = ifaceField.name; - const typeField = typeFieldMap[fieldName]; // Assert interface field exists on type. - - if (!typeField) { - context.reportError( - `Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, - [ifaceField.astNode, type.astNode, ...type.extensionASTNodes], - ); - continue; - } // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - - if (!(0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_7__.isTypeSubTypeOf)(context.schema, typeField.type, ifaceField.type)) { - var _ifaceField$astNode, _typeField$astNode; - - context.reportError( - `Interface field ${iface.name}.${fieldName} expects type ` + - `${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(ifaceField.type)} but ${type.name}.${fieldName} ` + - `is type ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(typeField.type)}.`, - [ - (_ifaceField$astNode = ifaceField.astNode) === null || - _ifaceField$astNode === void 0 - ? void 0 - : _ifaceField$astNode.type, - (_typeField$astNode = typeField.astNode) === null || - _typeField$astNode === void 0 - ? void 0 - : _typeField$astNode.type, - ], - ); - } // Assert each interface field arg is implemented. - - for (const ifaceArg of ifaceField.args) { - const argName = ifaceArg.name; - const typeArg = typeField.args.find((arg) => arg.name === argName); // Assert interface field arg exists on object field. - - if (!typeArg) { - context.reportError( - `Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`, - [ifaceArg.astNode, typeField.astNode], - ); - continue; - } // Assert interface field arg type matches object field arg type. - // (invariant) - // TODO: change to contravariant? - - if (!(0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_7__.isEqualType)(ifaceArg.type, typeArg.type)) { - var _ifaceArg$astNode, _typeArg$astNode; - - context.reportError( - `Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + - `expects type ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(ifaceArg.type)} but ` + - `${type.name}.${fieldName}(${argName}:) is type ` + - `${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(typeArg.type)}.`, - [ - (_ifaceArg$astNode = ifaceArg.astNode) === null || - _ifaceArg$astNode === void 0 - ? void 0 - : _ifaceArg$astNode.type, - (_typeArg$astNode = typeArg.astNode) === null || - _typeArg$astNode === void 0 - ? void 0 - : _typeArg$astNode.type, - ], - ); - } // TODO: validate default values? - } // Assert additional arguments must not be required. - - for (const typeArg of typeField.args) { - const argName = typeArg.name; - const ifaceArg = ifaceField.args.find((arg) => arg.name === argName); - - if (!ifaceArg && (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredArgument)(typeArg)) { - context.reportError( - `Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, - [typeArg.astNode, ifaceField.astNode], - ); - } - } - } -} - -function validateTypeImplementsAncestors(context, type, iface) { - const ifaceInterfaces = type.getInterfaces(); - - for (const transitive of iface.getInterfaces()) { - if (!ifaceInterfaces.includes(transitive)) { - context.reportError( - transitive === type - ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.` - : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`, - [ - ...getAllImplementsInterfaceNodes(iface, transitive), - ...getAllImplementsInterfaceNodes(type, iface), - ], - ); - } - } -} - -function validateUnionMembers(context, union) { - const memberTypes = union.getTypes(); - - if (memberTypes.length === 0) { - context.reportError( - `Union type ${union.name} must define one or more member types.`, - [union.astNode, ...union.extensionASTNodes], - ); - } - - const includedTypeNames = Object.create(null); - - for (const memberType of memberTypes) { - if (includedTypeNames[memberType.name]) { - context.reportError( - `Union type ${union.name} can only include type ${memberType.name} once.`, - getUnionMemberTypeNodes(union, memberType.name), - ); - continue; - } - - includedTypeNames[memberType.name] = true; - - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(memberType)) { - context.reportError( - `Union type ${union.name} can only include Object types, ` + - `it cannot include ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(memberType)}.`, - getUnionMemberTypeNodes(union, String(memberType)), - ); - } - } -} - -function validateEnumValues(context, enumType) { - const enumValues = enumType.getValues(); - - if (enumValues.length === 0) { - context.reportError( - `Enum type ${enumType.name} must define one or more values.`, - [enumType.astNode, ...enumType.extensionASTNodes], - ); - } - - for (const enumValue of enumValues) { - // Ensure valid name. - validateName(context, enumValue); - } -} - -function validateInputFields(context, inputObj) { - const fields = Object.values(inputObj.getFields()); - - if (fields.length === 0) { - context.reportError( - `Input Object type ${inputObj.name} must define one or more fields.`, - [inputObj.astNode, ...inputObj.extensionASTNodes], - ); - } // Ensure the arguments are valid - - for (const field of fields) { - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an input type - - if (!(0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputType)(field.type)) { - var _field$astNode2; - - context.reportError( - `The type of ${inputObj.name}.${field.name} must be Input Type ` + - `but got: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(field.type)}.`, - (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 - ? void 0 - : _field$astNode2.type, - ); - } - - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isRequiredInputField)(field) && field.deprecationReason != null) { - var _field$astNode3; - - context.reportError( - `Required input field ${inputObj.name}.${field.name} cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(field.astNode), - (_field$astNode3 = field.astNode) === null || - _field$astNode3 === void 0 - ? void 0 - : _field$astNode3.type, - ], - ); - } - } -} - -function createInputObjectCircularRefsValidator(context) { - // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. - // Tracks already visited types to maintain O(N) and to ensure that cycles - // are not redundantly reported. - const visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors - - const fieldPath = []; // Position in the type path - - const fieldPathIndexByTypeName = Object.create(null); - return detectCycleRecursive; // This does a straight-forward DFS to find cycles. - // It does not terminate when a cycle was found but continues to explore - // the graph to find all possible cycles. - - function detectCycleRecursive(inputObj) { - if (visitedTypes[inputObj.name]) { - return; - } - - visitedTypes[inputObj.name] = true; - fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; - const fields = Object.values(inputObj.getFields()); - - for (const field of fields) { - if ((0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(field.type) && (0,_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType)(field.type.ofType)) { - const fieldType = field.type.ofType; - const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; - fieldPath.push(field); - - if (cycleIndex === undefined) { - detectCycleRecursive(fieldType); - } else { - const cyclePath = fieldPath.slice(cycleIndex); - const pathStr = cyclePath.map((fieldObj) => fieldObj.name).join('.'); - context.reportError( - `Cannot reference Input Object "${fieldType.name}" within itself through a series of non-null fields: "${pathStr}".`, - cyclePath.map((fieldObj) => fieldObj.astNode), - ); - } - - fieldPath.pop(); - } - } - - fieldPathIndexByTypeName[inputObj.name] = undefined; - } -} - -function getAllImplementsInterfaceNodes(type, iface) { - const { astNode, extensionASTNodes } = type; - const nodes = - astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - return nodes - .flatMap((typeNode) => { - var _typeNode$interfaces; - - return ( - /* c8 ignore next */ - (_typeNode$interfaces = typeNode.interfaces) !== null && - _typeNode$interfaces !== void 0 - ? _typeNode$interfaces - : [] - ); - }) - .filter((ifaceNode) => ifaceNode.name.value === iface.name); -} - -function getUnionMemberTypeNodes(union, typeName) { - const { astNode, extensionASTNodes } = union; - const nodes = - astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - return nodes - .flatMap((unionNode) => { - var _unionNode$types; - - return ( - /* c8 ignore next */ - (_unionNode$types = unionNode.types) !== null && - _unionNode$types !== void 0 - ? _unionNode$types - : [] - ); - }) - .filter((typeNode) => typeNode.name.value === typeName); -} - -function getDeprecatedDirectiveNode(definitionNode) { - var _definitionNode$direc; - - return definitionNode === null || definitionNode === void 0 - ? void 0 - : (_definitionNode$direc = definitionNode.directives) === null || - _definitionNode$direc === void 0 - ? void 0 - : _definitionNode$direc.find( - (node) => node.name.value === _directives_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLDeprecatedDirective.name, - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/TypeInfo.mjs": -/*!************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/TypeInfo.mjs ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TypeInfo": function() { return /* binding */ TypeInfo; }, -/* harmony export */ "visitWithTypeInfo": function() { return /* binding */ visitWithTypeInfo; } -/* harmony export */ }); -/* harmony import */ var _language_ast_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_visitor_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - - -/** - * TypeInfo is a utility class which, given a GraphQL schema, can keep track - * of the current field and type definitions at any point in a GraphQL document - * AST during a recursive descent by calling `enter(node)` and `leave(node)`. - */ - -class TypeInfo { - constructor( - schema, - /** - * Initial type may be provided in rare cases to facilitate traversals - * beginning somewhere other than documents. - */ - initialType, - /** @deprecated will be removed in 17.0.0 */ - getFieldDefFn, - ) { - this._schema = schema; - this._typeStack = []; - this._parentTypeStack = []; - this._inputTypeStack = []; - this._fieldDefStack = []; - this._defaultValueStack = []; - this._directive = null; - this._argument = null; - this._enumValue = null; - this._getFieldDef = - getFieldDefFn !== null && getFieldDefFn !== void 0 - ? getFieldDefFn - : getFieldDef; - - if (initialType) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputType)(initialType)) { - this._inputTypeStack.push(initialType); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(initialType)) { - this._parentTypeStack.push(initialType); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isOutputType)(initialType)) { - this._typeStack.push(initialType); - } - } - } - - get [Symbol.toStringTag]() { - return 'TypeInfo'; - } - - getType() { - if (this._typeStack.length > 0) { - return this._typeStack[this._typeStack.length - 1]; - } - } - - getParentType() { - if (this._parentTypeStack.length > 0) { - return this._parentTypeStack[this._parentTypeStack.length - 1]; - } - } - - getInputType() { - if (this._inputTypeStack.length > 0) { - return this._inputTypeStack[this._inputTypeStack.length - 1]; - } - } - - getParentInputType() { - if (this._inputTypeStack.length > 1) { - return this._inputTypeStack[this._inputTypeStack.length - 2]; - } - } - - getFieldDef() { - if (this._fieldDefStack.length > 0) { - return this._fieldDefStack[this._fieldDefStack.length - 1]; - } - } - - getDefaultValue() { - if (this._defaultValueStack.length > 0) { - return this._defaultValueStack[this._defaultValueStack.length - 1]; - } - } - - getDirective() { - return this._directive; - } - - getArgument() { - return this._argument; - } - - getEnumValue() { - return this._enumValue; - } - - enter(node) { - const schema = this._schema; // Note: many of the types below are explicitly typed as "unknown" to drop - // any assumptions of a valid schema to ensure runtime types are properly - // checked before continuing since TypeInfo is used as part of validation - // which occurs before guarantees of schema and document validity. - - switch (node.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SELECTION_SET: { - const namedType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(this.getType()); - - this._parentTypeStack.push( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(namedType) ? namedType : undefined, - ); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FIELD: { - const parentType = this.getParentType(); - let fieldDef; - let fieldType; - - if (parentType) { - fieldDef = this._getFieldDef(schema, parentType, node); - - if (fieldDef) { - fieldType = fieldDef.type; - } - } - - this._fieldDefStack.push(fieldDef); - - this._typeStack.push((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isOutputType)(fieldType) ? fieldType : undefined); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DIRECTIVE: - this._directive = schema.getDirective(node.name.value); - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OPERATION_DEFINITION: { - const rootType = schema.getRootType(node.operation); - - this._typeStack.push((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(rootType) ? rootType : undefined); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INLINE_FRAGMENT: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FRAGMENT_DEFINITION: { - const typeConditionAST = node.typeCondition; - const outputType = typeConditionAST - ? (0,_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_2__.typeFromAST)(schema, typeConditionAST) - : (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(this.getType()); - - this._typeStack.push((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isOutputType)(outputType) ? outputType : undefined); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.VARIABLE_DEFINITION: { - const inputType = (0,_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_2__.typeFromAST)(schema, node.type); - - this._inputTypeStack.push( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputType)(inputType) ? inputType : undefined, - ); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ARGUMENT: { - var _this$getDirective; - - let argDef; - let argType; - const fieldOrDirective = - (_this$getDirective = this.getDirective()) !== null && - _this$getDirective !== void 0 - ? _this$getDirective - : this.getFieldDef(); - - if (fieldOrDirective) { - argDef = fieldOrDirective.args.find( - (arg) => arg.name === node.name.value, - ); - - if (argDef) { - argType = argDef.type; - } - } - - this._argument = argDef; - - this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); - - this._inputTypeStack.push((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputType)(argType) ? argType : undefined); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.LIST: { - const listType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNullableType)(this.getInputType()); - const itemType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value. - - this._defaultValueStack.push(undefined); - - this._inputTypeStack.push((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputType)(itemType) ? itemType : undefined); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_FIELD: { - const objectType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(this.getInputType()); - let inputFieldType; - let inputField; - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(objectType)) { - inputField = objectType.getFields()[node.name.value]; - - if (inputField) { - inputFieldType = inputField.type; - } - } - - this._defaultValueStack.push( - inputField ? inputField.defaultValue : undefined, - ); - - this._inputTypeStack.push( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputType)(inputFieldType) ? inputFieldType : undefined, - ); - - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM: { - const enumType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(this.getInputType()); - let enumValue; - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(enumType)) { - enumValue = enumType.getValue(node.value); - } - - this._enumValue = enumValue; - break; - } - - default: // Ignore other nodes - } - } - - leave(node) { - switch (node.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SELECTION_SET: - this._parentTypeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FIELD: - this._fieldDefStack.pop(); - - this._typeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DIRECTIVE: - this._directive = null; - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OPERATION_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INLINE_FRAGMENT: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FRAGMENT_DEFINITION: - this._typeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.VARIABLE_DEFINITION: - this._inputTypeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ARGUMENT: - this._argument = null; - - this._defaultValueStack.pop(); - - this._inputTypeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.LIST: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_FIELD: - this._defaultValueStack.pop(); - - this._inputTypeStack.pop(); - - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM: - this._enumValue = null; - break; - - default: // Ignore other nodes - } - } -} - -/** - * Not exactly the same as the executor's definition of getFieldDef, in this - * statically evaluated environment we do not always have an Object type, - * and need to handle Interface and Union types. - */ -function getFieldDef(schema, parentType, fieldNode) { - const name = fieldNode.name.value; - - if ( - name === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.SchemaMetaFieldDef.name && - schema.getQueryType() === parentType - ) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.SchemaMetaFieldDef; - } - - if (name === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.TypeMetaFieldDef; - } - - if (name === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.TypeNameMetaFieldDef.name && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(parentType)) { - return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_3__.TypeNameMetaFieldDef; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(parentType) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(parentType)) { - return parentType.getFields()[name]; - } -} -/** - * Creates a new visitor instance which maintains a provided TypeInfo instance - * along with visiting visitor. - */ - -function visitWithTypeInfo(typeInfo, visitor) { - return { - enter(...args) { - const node = args[0]; - typeInfo.enter(node); - const fn = (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_4__.getEnterLeaveForKind)(visitor, node.kind).enter; - - if (fn) { - const result = fn.apply(visitor, args); - - if (result !== undefined) { - typeInfo.leave(node); - - if ((0,_language_ast_mjs__WEBPACK_IMPORTED_MODULE_5__.isNode)(result)) { - typeInfo.enter(result); - } - } - - return result; - } - }, - - leave(...args) { - const node = args[0]; - const fn = (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_4__.getEnterLeaveForKind)(visitor, node.kind).leave; - let result; - - if (fn) { - result = fn.apply(visitor, args); - } - - typeInfo.leave(node); - return result; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/assertValidName.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/assertValidName.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "assertValidName": function() { return /* binding */ assertValidName; }, -/* harmony export */ "isValidNameError": function() { return /* binding */ isValidNameError; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_assertName_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/assertName.mjs */ "../../../node_modules/graphql/type/assertName.mjs"); - - - -/* c8 ignore start */ - -/** - * Upholds the spec rules about naming. - * @deprecated Please use `assertName` instead. Will be removed in v17 - */ - -function assertValidName(name) { - const error = isValidNameError(name); - - if (error) { - throw error; - } - - return name; -} -/** - * Returns an Error if a name is invalid. - * @deprecated Please use `assertName` instead. Will be removed in v17 - */ - -function isValidNameError(name) { - typeof name === 'string' || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_0__.devAssert)(false, 'Expected name to be a string.'); - - if (name.startsWith('__')) { - return new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`, - ); - } - - try { - (0,_type_assertName_mjs__WEBPACK_IMPORTED_MODULE_2__.assertName)(name); - } catch (error) { - return error; - } -} -/* c8 ignore stop */ - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/astFromValue.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/astFromValue.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "astFromValue": function() { return /* binding */ astFromValue; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); - - - - - - - -/** - * Produces a GraphQL Value AST given a JavaScript object. - * Function will match JavaScript/JSON values to GraphQL AST schema format - * by using suggested GraphQLInputType. For example: - * - * astFromValue("value", GraphQLString) - * - * A GraphQL type must be provided, which will be used to interpret different - * JavaScript values. - * - * | JSON Value | GraphQL Value | - * | ------------- | -------------------- | - * | Object | Input Object | - * | Array | List | - * | Boolean | Boolean | - * | String | String / Enum Value | - * | Number | Int / Float | - * | Unknown | Enum Value | - * | null | NullValue | - * - */ - -function astFromValue(value, type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(type)) { - const astValue = astFromValue(value, type.ofType); - - if ( - (astValue === null || astValue === void 0 ? void 0 : astValue.kind) === - _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.NULL - ) { - return null; - } - - return astValue; - } // only explicit null, not undefined, NaN - - if (value === null) { - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.NULL, - }; - } // undefined - - if (value === undefined) { - return null; - } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but - // the value is not an array, convert the value using the list's item type. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(type)) { - const itemType = type.ofType; - - if ((0,_jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_2__.isIterableObject)(value)) { - const valuesNodes = []; - - for (const item of value) { - const itemNode = astFromValue(item, itemType); - - if (itemNode != null) { - valuesNodes.push(itemNode); - } - } - - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.LIST, - values: valuesNodes, - }; - } - - return astFromValue(value, itemType); - } // Populate the fields of the input object by creating ASTs from each value - // in the JavaScript object according to the fields in the input type. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(type)) { - if (!(0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_3__.isObjectLike)(value)) { - return null; - } - - const fieldNodes = []; - - for (const field of Object.values(type.getFields())) { - const fieldValue = astFromValue(value[field.name], field.type); - - if (fieldValue) { - fieldNodes.push({ - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_FIELD, - name: { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.NAME, - value: field.name, - }, - value: fieldValue, - }); - } - } - - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT, - fields: fieldNodes, - }; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isLeafType)(type)) { - // Since value is an internally represented value, it must be serialized - // to an externally represented value before converting into an AST. - const serialized = type.serialize(value); - - if (serialized == null) { - return null; - } // Others serialize based on their corresponding JavaScript scalar types. - - if (typeof serialized === 'boolean') { - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.BOOLEAN, - value: serialized, - }; - } // JavaScript numbers can be Int or Float values. - - if (typeof serialized === 'number' && Number.isFinite(serialized)) { - const stringNum = String(serialized); - return integerStringRegExp.test(stringNum) - ? { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INT, - value: stringNum, - } - : { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FLOAT, - value: stringNum, - }; - } - - if (typeof serialized === 'string') { - // Enum types use Enum literals. - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(type)) { - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM, - value: serialized, - }; - } // ID types can use Int literals. - - if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLID && integerStringRegExp.test(serialized)) { - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INT, - value: serialized, - }; - } - - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.STRING, - value: serialized, - }; - } - - throw new TypeError(`Cannot convert value to AST: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(serialized)}.`); - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_6__.invariant)(false, 'Unexpected input type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(type)); -} -/** - * IntValue: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit ( Digit+ )? - */ - -const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/buildASTSchema.mjs": -/*!******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/buildASTSchema.mjs ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "buildASTSchema": function() { return /* binding */ buildASTSchema; }, -/* harmony export */ "buildSchema": function() { return /* binding */ buildSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_parser_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_schema_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -/* harmony import */ var _validation_validate_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -/* harmony import */ var _extendSchema_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extendSchema.mjs */ "../../../node_modules/graphql/utilities/extendSchema.mjs"); - - - - - - - - -/** - * This takes the ast of a schema document produced by the parse function in - * src/language/parser.js. - * - * If no schema definition is provided, then it will look for types named Query, - * Mutation and Subscription. - * - * Given that AST it constructs a GraphQLSchema. The resulting schema - * has no resolve methods, so execution will use default resolvers. - */ -function buildASTSchema(documentAST, options) { - (documentAST != null && documentAST.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.DOCUMENT) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__.devAssert)(false, 'Must provide valid Document AST.'); - - if ( - (options === null || options === void 0 ? void 0 : options.assumeValid) !== - true && - (options === null || options === void 0 - ? void 0 - : options.assumeValidSDL) !== true - ) { - (0,_validation_validate_mjs__WEBPACK_IMPORTED_MODULE_2__.assertValidSDL)(documentAST); - } - - const emptySchemaConfig = { - description: undefined, - types: [], - directives: [], - extensions: Object.create(null), - extensionASTNodes: [], - assumeValid: false, - }; - const config = (0,_extendSchema_mjs__WEBPACK_IMPORTED_MODULE_3__.extendSchemaImpl)(emptySchemaConfig, documentAST, options); - - if (config.astNode == null) { - for (const type of config.types) { - switch (type.name) { - // Note: While this could make early assertions to get the correctly - // typed values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - case 'Query': - // @ts-expect-error validated in `validateSchema` - config.query = type; - break; - - case 'Mutation': - // @ts-expect-error validated in `validateSchema` - config.mutation = type; - break; - - case 'Subscription': - // @ts-expect-error validated in `validateSchema` - config.subscription = type; - break; - } - } - } - - const directives = [ - ...config.directives, // If specified directives were not explicitly declared, add them. - ..._type_directives_mjs__WEBPACK_IMPORTED_MODULE_4__.specifiedDirectives.filter((stdDirective) => - config.directives.every( - (directive) => directive.name !== stdDirective.name, - ), - ), - ]; - return new _type_schema_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLSchema({ ...config, directives }); -} -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ - -function buildSchema(source, options) { - const document = (0,_language_parser_mjs__WEBPACK_IMPORTED_MODULE_6__.parse)(source, { - noLocation: - options === null || options === void 0 ? void 0 : options.noLocation, - allowLegacyFragmentVariables: - options === null || options === void 0 - ? void 0 - : options.allowLegacyFragmentVariables, - }); - return buildASTSchema(document, { - assumeValidSDL: - options === null || options === void 0 ? void 0 : options.assumeValidSDL, - assumeValid: - options === null || options === void 0 ? void 0 : options.assumeValid, - }); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/buildClientSchema.mjs": -/*!*********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/buildClientSchema.mjs ***! - \*********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "buildClientSchema": function() { return /* binding */ buildClientSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -/* harmony import */ var _language_parser_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/* harmony import */ var _type_schema_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -/* harmony import */ var _valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); - - - - - - - - - - - -/** - * Build a GraphQLSchema for use by client tools. - * - * Given the result of a client running the introspection query, creates and - * returns a GraphQLSchema instance which can be then used with all graphql-js - * tools, but cannot be used to execute a query, as introspection does not - * represent the "resolver", "parse" or "serialize" functions or any other - * server-internal mechanisms. - * - * This function expects a complete introspection result. Don't forget to check - * the "errors" field of a server response before calling this function. - */ - -function buildClientSchema(introspection, options) { - ((0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectLike)(introspection) && (0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectLike)(introspection.__schema)) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_1__.devAssert)( - false, - `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)( - introspection, - )}.`, - ); // Get the schema from the introspection result. - - const schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. - - const typeMap = (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_3__.keyValMap)( - schemaIntrospection.types, - (typeIntrospection) => typeIntrospection.name, - (typeIntrospection) => buildType(typeIntrospection), - ); // Include standard types only if they are used. - - for (const stdType of [..._type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__.specifiedScalarTypes, ..._type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.introspectionTypes]) { - if (typeMap[stdType.name]) { - typeMap[stdType.name] = stdType; - } - } // Get the root Query, Mutation, and Subscription types. - - const queryType = schemaIntrospection.queryType - ? getObjectType(schemaIntrospection.queryType) - : null; - const mutationType = schemaIntrospection.mutationType - ? getObjectType(schemaIntrospection.mutationType) - : null; - const subscriptionType = schemaIntrospection.subscriptionType - ? getObjectType(schemaIntrospection.subscriptionType) - : null; // Get the directives supported by Introspection, assuming empty-set if - // directives were not queried for. - - const directives = schemaIntrospection.directives - ? schemaIntrospection.directives.map(buildDirective) - : []; // Then produce and return a Schema with these types. - - return new _type_schema_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLSchema({ - description: schemaIntrospection.description, - query: queryType, - mutation: mutationType, - subscription: subscriptionType, - types: Object.values(typeMap), - directives, - assumeValid: - options === null || options === void 0 ? void 0 : options.assumeValid, - }); // Given a type reference in introspection, return the GraphQLType instance. - // preferring cached instances before building new instances. - - function getType(typeRef) { - if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.LIST) { - const itemRef = typeRef.ofType; - - if (!itemRef) { - throw new Error('Decorated type deeper than introspection query.'); - } - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLList(getType(itemRef)); - } - - if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.NON_NULL) { - const nullableRef = typeRef.ofType; - - if (!nullableRef) { - throw new Error('Decorated type deeper than introspection query.'); - } - - const nullableType = getType(nullableRef); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLNonNull((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.assertNullableType)(nullableType)); - } - - return getNamedType(typeRef); - } - - function getNamedType(typeRef) { - const typeName = typeRef.name; - - if (!typeName) { - throw new Error(`Unknown type reference: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(typeRef)}.`); - } - - const type = typeMap[typeName]; - - if (!type) { - throw new Error( - `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`, - ); - } - - return type; - } - - function getObjectType(typeRef) { - return (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.assertObjectType)(getNamedType(typeRef)); - } - - function getInterfaceType(typeRef) { - return (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.assertInterfaceType)(getNamedType(typeRef)); - } // Given a type's introspection result, construct the correct - // GraphQLType instance. - - function buildType(type) { - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain - if (type != null && type.name != null && type.kind != null) { - // FIXME: Properly type IntrospectionType, it's a breaking change so fix in v17 - // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check - switch (type.kind) { - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.SCALAR: - return buildScalarDef(type); - - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.OBJECT: - return buildObjectDef(type); - - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.INTERFACE: - return buildInterfaceDef(type); - - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.UNION: - return buildUnionDef(type); - - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.ENUM: - return buildEnumDef(type); - - case _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.INPUT_OBJECT: - return buildInputObjectDef(type); - } - } - - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(type); - throw new Error( - `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`, - ); - } - - function buildScalarDef(scalarIntrospection) { - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByURL: scalarIntrospection.specifiedByURL, - }); - } - - function buildImplementationsList(implementingIntrospection) { - // TODO: Temporary workaround until GraphQL ecosystem will fully support - // 'interfaces' on interface types. - if ( - implementingIntrospection.interfaces === null && - implementingIntrospection.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.TypeKind.INTERFACE - ) { - return []; - } - - if (!implementingIntrospection.interfaces) { - const implementingIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(implementingIntrospection); - throw new Error( - `Introspection result missing interfaces: ${implementingIntrospectionStr}.`, - ); - } - - return implementingIntrospection.interfaces.map(getInterfaceType); - } - - function buildObjectDef(objectIntrospection) { - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: () => buildImplementationsList(objectIntrospection), - fields: () => buildFieldDefMap(objectIntrospection), - }); - } - - function buildInterfaceDef(interfaceIntrospection) { - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: () => buildImplementationsList(interfaceIntrospection), - fields: () => buildFieldDefMap(interfaceIntrospection), - }); - } - - function buildUnionDef(unionIntrospection) { - if (!unionIntrospection.possibleTypes) { - const unionIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(unionIntrospection); - throw new Error( - `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`, - ); - } - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: () => unionIntrospection.possibleTypes.map(getObjectType), - }); - } - - function buildEnumDef(enumIntrospection) { - if (!enumIntrospection.enumValues) { - const enumIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(enumIntrospection); - throw new Error( - `Introspection result missing enumValues: ${enumIntrospectionStr}.`, - ); - } - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLEnumType({ - name: enumIntrospection.name, - description: enumIntrospection.description, - values: (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_3__.keyValMap)( - enumIntrospection.enumValues, - (valueIntrospection) => valueIntrospection.name, - (valueIntrospection) => ({ - description: valueIntrospection.description, - deprecationReason: valueIntrospection.deprecationReason, - }), - ), - }); - } - - function buildInputObjectDef(inputObjectIntrospection) { - if (!inputObjectIntrospection.inputFields) { - const inputObjectIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(inputObjectIntrospection); - throw new Error( - `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`, - ); - } - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.GraphQLInputObjectType({ - name: inputObjectIntrospection.name, - description: inputObjectIntrospection.description, - fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), - }); - } - - function buildFieldDefMap(typeIntrospection) { - if (!typeIntrospection.fields) { - throw new Error( - `Introspection result missing fields: ${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(typeIntrospection)}.`, - ); - } - - return (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_3__.keyValMap)( - typeIntrospection.fields, - (fieldIntrospection) => fieldIntrospection.name, - buildField, - ); - } - - function buildField(fieldIntrospection) { - const type = getType(fieldIntrospection.type); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isOutputType)(type)) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(type); - throw new Error( - `Introspection must provide output type for fields, but received: ${typeStr}.`, - ); - } - - if (!fieldIntrospection.args) { - const fieldIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(fieldIntrospection); - throw new Error( - `Introspection result missing field args: ${fieldIntrospectionStr}.`, - ); - } - - return { - description: fieldIntrospection.description, - deprecationReason: fieldIntrospection.deprecationReason, - type, - args: buildInputValueDefMap(fieldIntrospection.args), - }; - } - - function buildInputValueDefMap(inputValueIntrospections) { - return (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_3__.keyValMap)( - inputValueIntrospections, - (inputValue) => inputValue.name, - buildInputValue, - ); - } - - function buildInputValue(inputValueIntrospection) { - const type = getType(inputValueIntrospection.type); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__.isInputType)(type)) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(type); - throw new Error( - `Introspection must provide input type for arguments, but received: ${typeStr}.`, - ); - } - - const defaultValue = - inputValueIntrospection.defaultValue != null - ? (0,_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_8__.valueFromAST)((0,_language_parser_mjs__WEBPACK_IMPORTED_MODULE_9__.parseValue)(inputValueIntrospection.defaultValue), type) - : undefined; - return { - description: inputValueIntrospection.description, - type, - defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason, - }; - } - - function buildDirective(directiveIntrospection) { - if (!directiveIntrospection.args) { - const directiveIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(directiveIntrospection); - throw new Error( - `Introspection result missing directive args: ${directiveIntrospectionStr}.`, - ); - } - - if (!directiveIntrospection.locations) { - const directiveIntrospectionStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(directiveIntrospection); - throw new Error( - `Introspection result missing directive locations: ${directiveIntrospectionStr}.`, - ); - } - - return new _type_directives_mjs__WEBPACK_IMPORTED_MODULE_10__.GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args), - }); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/coerceInputValue.mjs": -/*!********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/coerceInputValue.mjs ***! - \********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "coerceInputValue": function() { return /* binding */ coerceInputValue; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/isIterableObject.mjs */ "../../../node_modules/graphql/jsutils/isIterableObject.mjs"); -/* harmony import */ var _jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../jsutils/isObjectLike.mjs */ "../../../node_modules/graphql/jsutils/isObjectLike.mjs"); -/* harmony import */ var _jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/Path.mjs */ "../../../node_modules/graphql/jsutils/Path.mjs"); -/* harmony import */ var _jsutils_printPathArray_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/printPathArray.mjs */ "../../../node_modules/graphql/jsutils/printPathArray.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - - - - - - - -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -function coerceInputValue(inputValue, type, onError = defaultOnError) { - return coerceInputValueImpl(inputValue, type, onError, undefined); -} - -function defaultOnError(path, invalidValue, error) { - let errorPrefix = 'Invalid value ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(invalidValue); - - if (path.length > 0) { - errorPrefix += ` at "value${(0,_jsutils_printPathArray_mjs__WEBPACK_IMPORTED_MODULE_1__.printPathArray)(path)}"`; - } - - error.message = errorPrefix + ': ' + error.message; - throw error; -} - -function coerceInputValueImpl(inputValue, type, onError, path) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError( - `Expected non-nullable type "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)}" not to be null.`, - ), - ); - return; - } - - if (inputValue == null) { - // Explicitly return the value null. - return null; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isListType)(type)) { - const itemType = type.ofType; - - if ((0,_jsutils_isIterableObject_mjs__WEBPACK_IMPORTED_MODULE_5__.isIterableObject)(inputValue)) { - return Array.from(inputValue, (itemValue, index) => { - const itemPath = (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.addPath)(path, index, undefined); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - } // Lists accept a non-list value as a list of one. - - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType)(type)) { - if (!(0,_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_6__.isObjectLike)(inputValue)) { - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError(`Expected type "${type.name}" to be an object.`), - ); - return; - } - - const coercedValue = {}; - const fieldDefs = type.getFields(); - - for (const field of Object.values(fieldDefs)) { - const fieldValue = inputValue[field.name]; - - if (fieldValue === undefined) { - if (field.defaultValue !== undefined) { - coercedValue[field.name] = field.defaultValue; - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(field.type)) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(field.type); - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError( - `Field "${field.name}" of required type "${typeStr}" was not provided.`, - ), - ); - } - - continue; - } - - coercedValue[field.name] = coerceInputValueImpl( - fieldValue, - field.type, - onError, - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.addPath)(path, field.name, type.name), - ); - } // Ensure every provided field is defined. - - for (const fieldName of Object.keys(inputValue)) { - if (!fieldDefs[fieldName]) { - const suggestions = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_7__.suggestionList)( - fieldName, - Object.keys(type.getFields()), - ); - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError( - `Field "${fieldName}" is not defined by type "${type.name}".` + - (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_8__.didYouMean)(suggestions), - ), - ); - } - } - - return coercedValue; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isLeafType)(type)) { - let parseResult; // Scalars and Enums determine if a input value is valid via parseValue(), - // which can throw to indicate failure. If it throws, maintain a reference - // to the original error. - - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError) { - onError((0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), inputValue, error); - } else { - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError(`Expected type "${type.name}". ` + error.message, { - originalError: error, - }), - ); - } - - return; - } - - if (parseResult === undefined) { - onError( - (0,_jsutils_Path_mjs__WEBPACK_IMPORTED_MODULE_3__.pathToArray)(path), - inputValue, - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__.GraphQLError(`Expected type "${type.name}".`), - ); - } - - return parseResult; - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_9__.invariant)(false, 'Unexpected input type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__.inspect)(type)); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/concatAST.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/concatAST.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "concatAST": function() { return /* binding */ concatAST; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - -/** - * Provided a collection of ASTs, presumably each from different files, - * concatenate the ASTs together into batched AST, useful for validating many - * GraphQL source files which together represent one conceptual application. - */ - -function concatAST(documents) { - const definitions = []; - - for (const doc of documents) { - definitions.push(...doc.definitions); - } - - return { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.DOCUMENT, - definitions, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/extendSchema.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/extendSchema.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "extendSchema": function() { return /* binding */ extendSchema; }, -/* harmony export */ "extendSchemaImpl": function() { return /* binding */ extendSchemaImpl; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/mapValue.mjs */ "../../../node_modules/graphql/jsutils/mapValue.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/* harmony import */ var _type_schema_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); -/* harmony import */ var _validation_validate_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../validation/validate.mjs */ "../../../node_modules/graphql/validation/validate.mjs"); -/* harmony import */ var _execution_values_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../execution/values.mjs */ "../../../node_modules/graphql/execution/values.mjs"); -/* harmony import */ var _valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueFromAST.mjs */ "../../../node_modules/graphql/utilities/valueFromAST.mjs"); - - - - - - - - - - - - - - - - -/** - * Produces a new schema given an existing schema and a document which may - * contain GraphQL type extensions and definitions. The original schema will - * remain unaltered. - * - * Because a schema represents a graph of references, a schema cannot be - * extended without effectively making an entire copy. We do not know until it's - * too late if subgraphs remain unchanged. - * - * This algorithm copies the provided schema, applying extensions while - * producing the copy. The original schema remains unaltered. - */ -function extendSchema(schema, documentAST, options) { - (0,_type_schema_mjs__WEBPACK_IMPORTED_MODULE_0__.assertSchema)(schema); - (documentAST != null && documentAST.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DOCUMENT) || - (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)(false, 'Must provide valid Document AST.'); - - if ( - (options === null || options === void 0 ? void 0 : options.assumeValid) !== - true && - (options === null || options === void 0 - ? void 0 - : options.assumeValidSDL) !== true - ) { - (0,_validation_validate_mjs__WEBPACK_IMPORTED_MODULE_3__.assertValidSDLExtension)(documentAST, schema); - } - - const schemaConfig = schema.toConfig(); - const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig - ? schema - : new _type_schema_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLSchema(extendedConfig); -} -/** - * @internal - */ - -function extendSchemaImpl(schemaConfig, documentAST, options) { - var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid; - - // Collect the type definitions and extensions found in the document. - const typeDefs = []; - const typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can - // have the same name. For example, a type named "skip". - - const directiveDefs = []; - let schemaDef; // Schema extensions are collected which may add additional operation types. - - const schemaExtensions = []; - - for (const def of documentAST.definitions) { - if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isTypeDefinitionNode)(def)) { - typeDefs.push(def); - } else if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isTypeExtensionNode)(def)) { - const extendedTypeName = def.name.value; - const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions - ? existingTypeExtensions.concat([def]) - : [def]; - } else if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DIRECTIVE_DEFINITION) { - directiveDefs.push(def); - } - } // If this document contains no new types, extensions, or directives then - // return the same unmodified GraphQLSchema instance. - - if ( - Object.keys(typeExtensionsMap).length === 0 && - typeDefs.length === 0 && - directiveDefs.length === 0 && - schemaExtensions.length === 0 && - schemaDef == null - ) { - return schemaConfig; - } - - const typeMap = Object.create(null); - - for (const existingType of schemaConfig.types) { - typeMap[existingType.name] = extendNamedType(existingType); - } - - for (const typeNode of typeDefs) { - var _stdTypeMap$name; - - const name = typeNode.name.value; - typeMap[name] = - (_stdTypeMap$name = stdTypeMap[name]) !== null && - _stdTypeMap$name !== void 0 - ? _stdTypeMap$name - : buildType(typeNode); - } - - const operationTypes = { - // Get the extended root operation types. - query: schemaConfig.query && replaceNamedType(schemaConfig.query), - mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), - subscription: - schemaConfig.subscription && replaceNamedType(schemaConfig.subscription), - // Then, incorporate schema definition and all schema extensions. - ...(schemaDef && getOperationTypes([schemaDef])), - ...getOperationTypes(schemaExtensions), - }; // Then produce and return a Schema config with these types. - - return { - description: - (_schemaDef = schemaDef) === null || _schemaDef === void 0 - ? void 0 - : (_schemaDef$descriptio = _schemaDef.description) === null || - _schemaDef$descriptio === void 0 - ? void 0 - : _schemaDef$descriptio.value, - ...operationTypes, - types: Object.values(typeMap), - directives: [ - ...schemaConfig.directives.map(replaceDirective), - ...directiveDefs.map(buildDirective), - ], - extensions: Object.create(null), - astNode: - (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 - ? _schemaDef2 - : schemaConfig.astNode, - extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), - assumeValid: - (_options$assumeValid = - options === null || options === void 0 - ? void 0 - : options.assumeValid) !== null && _options$assumeValid !== void 0 - ? _options$assumeValid - : false, - }; // Below are functions used for producing this schema that have closed over - // this scope and have access to the schema, cache, and newly defined types. - - function replaceType(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isListType)(type)) { - // @ts-expect-error - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLList(replaceType(type.ofType)); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isNonNullType)(type)) { - // @ts-expect-error - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLNonNull(replaceType(type.ofType)); - } // @ts-expect-error FIXME - - return replaceNamedType(type); - } - - function replaceNamedType(type) { - // Note: While this could make early assertions to get the correctly - // typed values, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - return typeMap[type.name]; - } - - function replaceDirective(directive) { - const config = directive.toConfig(); - return new _type_directives_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLDirective({ - ...config, - args: (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(config.args, extendArg), - }); - } - - function extendNamedType(type) { - if ((0,_type_introspection_mjs__WEBPACK_IMPORTED_MODULE_8__.isIntrospectionType)(type) || (0,_type_scalars_mjs__WEBPACK_IMPORTED_MODULE_9__.isSpecifiedScalarType)(type)) { - // Builtin types are not extended. - return type; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isScalarType)(type)) { - return extendScalarType(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectType)(type)) { - return extendObjectType(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isInterfaceType)(type)) { - return extendInterfaceType(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isUnionType)(type)) { - return extendUnionType(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isEnumType)(type)) { - return extendEnumType(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isInputObjectType)(type)) { - return extendInputObjectType(type); - } - /* c8 ignore next 3 */ - // Not reachable, all possible type definition nodes have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_10__.invariant)(false, 'Unexpected type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_11__.inspect)(type)); - } - - function extendInputObjectType(type) { - var _typeExtensionsMap$co; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && - _typeExtensionsMap$co !== void 0 - ? _typeExtensionsMap$co - : []; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLInputObjectType({ - ...config, - fields: () => ({ - ...(0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(config.fields, (field) => ({ - ...field, - type: replaceType(field.type), - })), - ...buildInputFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendEnumType(type) { - var _typeExtensionsMap$ty; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && - _typeExtensionsMap$ty !== void 0 - ? _typeExtensionsMap$ty - : []; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLEnumType({ - ...config, - values: { ...config.values, ...buildEnumValueMap(extensions) }, - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendScalarType(type) { - var _typeExtensionsMap$co2; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && - _typeExtensionsMap$co2 !== void 0 - ? _typeExtensionsMap$co2 - : []; - let specifiedByURL = config.specifiedByURL; - - for (const extensionNode of extensions) { - var _getSpecifiedByURL; - - specifiedByURL = - (_getSpecifiedByURL = getSpecifiedByURL(extensionNode)) !== null && - _getSpecifiedByURL !== void 0 - ? _getSpecifiedByURL - : specifiedByURL; - } - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLScalarType({ - ...config, - specifiedByURL, - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendObjectType(type) { - var _typeExtensionsMap$co3; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && - _typeExtensionsMap$co3 !== void 0 - ? _typeExtensionsMap$co3 - : []; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLObjectType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions), - ], - fields: () => ({ - ...(0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(config.fields, extendField), - ...buildFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendInterfaceType(type) { - var _typeExtensionsMap$co4; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && - _typeExtensionsMap$co4 !== void 0 - ? _typeExtensionsMap$co4 - : []; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLInterfaceType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions), - ], - fields: () => ({ - ...(0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(config.fields, extendField), - ...buildFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendUnionType(type) { - var _typeExtensionsMap$co5; - - const config = type.toConfig(); - const extensions = - (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && - _typeExtensionsMap$co5 !== void 0 - ? _typeExtensionsMap$co5 - : []; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLUnionType({ - ...config, - types: () => [ - ...type.getTypes().map(replaceNamedType), - ...buildUnionTypes(extensions), - ], - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendField(field) { - return { - ...field, - type: replaceType(field.type), - args: field.args && (0,_jsutils_mapValue_mjs__WEBPACK_IMPORTED_MODULE_7__.mapValue)(field.args, extendArg), - }; - } - - function extendArg(arg) { - return { ...arg, type: replaceType(arg.type) }; - } - - function getOperationTypes(nodes) { - const opTypes = {}; - - for (const node of nodes) { - var _node$operationTypes; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const operationTypesNodes = - /* c8 ignore next */ - (_node$operationTypes = node.operationTypes) !== null && - _node$operationTypes !== void 0 - ? _node$operationTypes - : []; - - for (const operationType of operationTypesNodes) { - // Note: While this could make early assertions to get the correctly - // typed values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - opTypes[operationType.operation] = getNamedType(operationType.type); - } - } - - return opTypes; - } - - function getNamedType(node) { - var _stdTypeMap$name2; - - const name = node.name.value; - const type = - (_stdTypeMap$name2 = stdTypeMap[name]) !== null && - _stdTypeMap$name2 !== void 0 - ? _stdTypeMap$name2 - : typeMap[name]; - - if (type === undefined) { - throw new Error(`Unknown type: "${name}".`); - } - - return type; - } - - function getWrappedType(node) { - if (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.LIST_TYPE) { - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLList(getWrappedType(node.type)); - } - - if (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.NON_NULL_TYPE) { - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLNonNull(getWrappedType(node.type)); - } - - return getNamedType(node); - } - - function buildDirective(node) { - var _node$description; - - return new _type_directives_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLDirective({ - name: node.name.value, - description: - (_node$description = node.description) === null || - _node$description === void 0 - ? void 0 - : _node$description.value, - // @ts-expect-error - locations: node.locations.map(({ value }) => value), - isRepeatable: node.repeatable, - args: buildArgumentMap(node.arguments), - astNode: node, - }); - } - - function buildFieldMap(nodes) { - const fieldConfigMap = Object.create(null); - - for (const node of nodes) { - var _node$fields; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const nodeFields = - /* c8 ignore next */ - (_node$fields = node.fields) !== null && _node$fields !== void 0 - ? _node$fields - : []; - - for (const field of nodeFields) { - var _field$description; - - fieldConfigMap[field.name.value] = { - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - type: getWrappedType(field.type), - description: - (_field$description = field.description) === null || - _field$description === void 0 - ? void 0 - : _field$description.value, - args: buildArgumentMap(field.arguments), - deprecationReason: getDeprecationReason(field), - astNode: field, - }; - } - } - - return fieldConfigMap; - } - - function buildArgumentMap(args) { - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const argsNodes = - /* c8 ignore next */ - args !== null && args !== void 0 ? args : []; - const argConfigMap = Object.create(null); - - for (const arg of argsNodes) { - var _arg$description; - - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - const type = getWrappedType(arg.type); - argConfigMap[arg.name.value] = { - type, - description: - (_arg$description = arg.description) === null || - _arg$description === void 0 - ? void 0 - : _arg$description.value, - defaultValue: (0,_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_12__.valueFromAST)(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg, - }; - } - - return argConfigMap; - } - - function buildInputFieldMap(nodes) { - const inputFieldMap = Object.create(null); - - for (const node of nodes) { - var _node$fields2; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const fieldsNodes = - /* c8 ignore next */ - (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 - ? _node$fields2 - : []; - - for (const field of fieldsNodes) { - var _field$description2; - - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - const type = getWrappedType(field.type); - inputFieldMap[field.name.value] = { - type, - description: - (_field$description2 = field.description) === null || - _field$description2 === void 0 - ? void 0 - : _field$description2.value, - defaultValue: (0,_valueFromAST_mjs__WEBPACK_IMPORTED_MODULE_12__.valueFromAST)(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field, - }; - } - } - - return inputFieldMap; - } - - function buildEnumValueMap(nodes) { - const enumValueMap = Object.create(null); - - for (const node of nodes) { - var _node$values; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - const valuesNodes = - /* c8 ignore next */ - (_node$values = node.values) !== null && _node$values !== void 0 - ? _node$values - : []; - - for (const value of valuesNodes) { - var _value$description; - - enumValueMap[value.name.value] = { - description: - (_value$description = value.description) === null || - _value$description === void 0 - ? void 0 - : _value$description.value, - deprecationReason: getDeprecationReason(value), - astNode: value, - }; - } - } - - return enumValueMap; - } - - function buildInterfaces(nodes) { - // Note: While this could make assertions to get the correctly typed - // values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - return nodes.flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - (node) => { - var _node$interfaces$map, _node$interfaces; - - return ( - /* c8 ignore next */ - (_node$interfaces$map = - (_node$interfaces = node.interfaces) === null || - _node$interfaces === void 0 - ? void 0 - : _node$interfaces.map(getNamedType)) !== null && - _node$interfaces$map !== void 0 - ? _node$interfaces$map - : [] - ); - }, - ); - } - - function buildUnionTypes(nodes) { - // Note: While this could make assertions to get the correctly typed - // values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - // @ts-expect-error - return nodes.flatMap( - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - (node) => { - var _node$types$map, _node$types; - - return ( - /* c8 ignore next */ - (_node$types$map = - (_node$types = node.types) === null || _node$types === void 0 - ? void 0 - : _node$types.map(getNamedType)) !== null && - _node$types$map !== void 0 - ? _node$types$map - : [] - ); - }, - ); - } - - function buildType(astNode) { - var _typeExtensionsMap$na; - - const name = astNode.name.value; - const extensionASTNodes = - (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && - _typeExtensionsMap$na !== void 0 - ? _typeExtensionsMap$na - : []; - - switch (astNode.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_TYPE_DEFINITION: { - var _astNode$description; - - const allNodes = [astNode, ...extensionASTNodes]; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLObjectType({ - name, - description: - (_astNode$description = astNode.description) === null || - _astNode$description === void 0 - ? void 0 - : _astNode$description.value, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INTERFACE_TYPE_DEFINITION: { - var _astNode$description2; - - const allNodes = [astNode, ...extensionASTNodes]; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLInterfaceType({ - name, - description: - (_astNode$description2 = astNode.description) === null || - _astNode$description2 === void 0 - ? void 0 - : _astNode$description2.value, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM_TYPE_DEFINITION: { - var _astNode$description3; - - const allNodes = [astNode, ...extensionASTNodes]; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLEnumType({ - name, - description: - (_astNode$description3 = astNode.description) === null || - _astNode$description3 === void 0 - ? void 0 - : _astNode$description3.value, - values: buildEnumValueMap(allNodes), - astNode, - extensionASTNodes, - }); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.UNION_TYPE_DEFINITION: { - var _astNode$description4; - - const allNodes = [astNode, ...extensionASTNodes]; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLUnionType({ - name, - description: - (_astNode$description4 = astNode.description) === null || - _astNode$description4 === void 0 - ? void 0 - : _astNode$description4.value, - types: () => buildUnionTypes(allNodes), - astNode, - extensionASTNodes, - }); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCALAR_TYPE_DEFINITION: { - var _astNode$description5; - - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLScalarType({ - name, - description: - (_astNode$description5 = astNode.description) === null || - _astNode$description5 === void 0 - ? void 0 - : _astNode$description5.value, - specifiedByURL: getSpecifiedByURL(astNode), - astNode, - extensionASTNodes, - }); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INPUT_OBJECT_TYPE_DEFINITION: { - var _astNode$description6; - - const allNodes = [astNode, ...extensionASTNodes]; - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLInputObjectType({ - name, - description: - (_astNode$description6 = astNode.description) === null || - _astNode$description6 === void 0 - ? void 0 - : _astNode$description6.value, - fields: () => buildInputFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - } - } -} -const stdTypeMap = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_13__.keyMap)( - [..._type_scalars_mjs__WEBPACK_IMPORTED_MODULE_9__.specifiedScalarTypes, ..._type_introspection_mjs__WEBPACK_IMPORTED_MODULE_8__.introspectionTypes], - (type) => type.name, -); -/** - * Given a field or enum value node, returns the string value for the - * deprecation reason. - */ - -function getDeprecationReason(node) { - const deprecated = (0,_execution_values_mjs__WEBPACK_IMPORTED_MODULE_14__.getDirectiveValues)(_type_directives_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLDeprecatedDirective, node); // @ts-expect-error validated by `getDirectiveValues` - - return deprecated === null || deprecated === void 0 - ? void 0 - : deprecated.reason; -} -/** - * Given a scalar node, returns the string value for the specifiedByURL. - */ - -function getSpecifiedByURL(node) { - const specifiedBy = (0,_execution_values_mjs__WEBPACK_IMPORTED_MODULE_14__.getDirectiveValues)(_type_directives_mjs__WEBPACK_IMPORTED_MODULE_6__.GraphQLSpecifiedByDirective, node); // @ts-expect-error validated by `getDirectiveValues` - - return specifiedBy === null || specifiedBy === void 0 - ? void 0 - : specifiedBy.url; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/findBreakingChanges.mjs": -/*!***********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/findBreakingChanges.mjs ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "BreakingChangeType": function() { return /* binding */ BreakingChangeType; }, -/* harmony export */ "DangerousChangeType": function() { return /* binding */ DangerousChangeType; }, -/* harmony export */ "findBreakingChanges": function() { return /* binding */ findBreakingChanges; }, -/* harmony export */ "findDangerousChanges": function() { return /* binding */ findDangerousChanges; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/* harmony import */ var _astFromValue_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); -/* harmony import */ var _sortValueNode_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); - - - - - - - - -let BreakingChangeType; - -(function (BreakingChangeType) { - BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED'; - BreakingChangeType['TYPE_CHANGED_KIND'] = 'TYPE_CHANGED_KIND'; - BreakingChangeType['TYPE_REMOVED_FROM_UNION'] = 'TYPE_REMOVED_FROM_UNION'; - BreakingChangeType['VALUE_REMOVED_FROM_ENUM'] = 'VALUE_REMOVED_FROM_ENUM'; - BreakingChangeType['REQUIRED_INPUT_FIELD_ADDED'] = - 'REQUIRED_INPUT_FIELD_ADDED'; - BreakingChangeType['IMPLEMENTED_INTERFACE_REMOVED'] = - 'IMPLEMENTED_INTERFACE_REMOVED'; - BreakingChangeType['FIELD_REMOVED'] = 'FIELD_REMOVED'; - BreakingChangeType['FIELD_CHANGED_KIND'] = 'FIELD_CHANGED_KIND'; - BreakingChangeType['REQUIRED_ARG_ADDED'] = 'REQUIRED_ARG_ADDED'; - BreakingChangeType['ARG_REMOVED'] = 'ARG_REMOVED'; - BreakingChangeType['ARG_CHANGED_KIND'] = 'ARG_CHANGED_KIND'; - BreakingChangeType['DIRECTIVE_REMOVED'] = 'DIRECTIVE_REMOVED'; - BreakingChangeType['DIRECTIVE_ARG_REMOVED'] = 'DIRECTIVE_ARG_REMOVED'; - BreakingChangeType['REQUIRED_DIRECTIVE_ARG_ADDED'] = - 'REQUIRED_DIRECTIVE_ARG_ADDED'; - BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] = - 'DIRECTIVE_REPEATABLE_REMOVED'; - BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] = - 'DIRECTIVE_LOCATION_REMOVED'; -})(BreakingChangeType || (BreakingChangeType = {})); - -let DangerousChangeType; - -(function (DangerousChangeType) { - DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM'; - DangerousChangeType['TYPE_ADDED_TO_UNION'] = 'TYPE_ADDED_TO_UNION'; - DangerousChangeType['OPTIONAL_INPUT_FIELD_ADDED'] = - 'OPTIONAL_INPUT_FIELD_ADDED'; - DangerousChangeType['OPTIONAL_ARG_ADDED'] = 'OPTIONAL_ARG_ADDED'; - DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] = - 'IMPLEMENTED_INTERFACE_ADDED'; - DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE'; -})(DangerousChangeType || (DangerousChangeType = {})); - -/** - * Given two schemas, returns an Array containing descriptions of all the types - * of breaking changes covered by the other functions down below. - */ -function findBreakingChanges(oldSchema, newSchema) { - // @ts-expect-error - return findSchemaChanges(oldSchema, newSchema).filter( - (change) => change.type in BreakingChangeType, - ); -} -/** - * Given two schemas, returns an Array containing descriptions of all the types - * of potentially dangerous changes covered by the other functions down below. - */ - -function findDangerousChanges(oldSchema, newSchema) { - // @ts-expect-error - return findSchemaChanges(oldSchema, newSchema).filter( - (change) => change.type in DangerousChangeType, - ); -} - -function findSchemaChanges(oldSchema, newSchema) { - return [ - ...findTypeChanges(oldSchema, newSchema), - ...findDirectiveChanges(oldSchema, newSchema), - ]; -} - -function findDirectiveChanges(oldSchema, newSchema) { - const schemaChanges = []; - const directivesDiff = diff( - oldSchema.getDirectives(), - newSchema.getDirectives(), - ); - - for (const oldDirective of directivesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REMOVED, - description: `${oldDirective.name} was removed.`, - }); - } - - for (const [oldDirective, newDirective] of directivesDiff.persisted) { - const argsDiff = diff(oldDirective.args, newDirective.args); - - for (const newArg of argsDiff.added) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredArgument)(newArg)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, - description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.`, - }); - } - } - - for (const oldArg of argsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: `${oldArg.name} was removed from ${oldDirective.name}.`, - }); - } - - if (oldDirective.isRepeatable && !newDirective.isRepeatable) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, - description: `Repeatable flag was removed from ${oldDirective.name}.`, - }); - } - - for (const location of oldDirective.locations) { - if (!newDirective.locations.includes(location)) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: `${location} was removed from ${oldDirective.name}.`, - }); - } - } - } - - return schemaChanges; -} - -function findTypeChanges(oldSchema, newSchema) { - const schemaChanges = []; - const typesDiff = diff( - Object.values(oldSchema.getTypeMap()), - Object.values(newSchema.getTypeMap()), - ); - - for (const oldType of typesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED, - description: (0,_type_scalars_mjs__WEBPACK_IMPORTED_MODULE_1__.isSpecifiedScalarType)(oldType) - ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.` - : `${oldType.name} was removed.`, - }); - } - - for (const [oldType, newType] of typesDiff.persisted) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(oldType) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(newType)) { - schemaChanges.push(...findEnumTypeChanges(oldType, newType)); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isUnionType)(oldType) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isUnionType)(newType)) { - schemaChanges.push(...findUnionTypeChanges(oldType, newType)); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(oldType) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(newType)) { - schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(oldType) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(newType)) { - schemaChanges.push( - ...findFieldChanges(oldType, newType), - ...findImplementedInterfacesChanges(oldType, newType), - ); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(oldType) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(newType)) { - schemaChanges.push( - ...findFieldChanges(oldType, newType), - ...findImplementedInterfacesChanges(oldType, newType), - ); - } else if (oldType.constructor !== newType.constructor) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_CHANGED_KIND, - description: - `${oldType.name} changed from ` + - `${typeKindName(oldType)} to ${typeKindName(newType)}.`, - }); - } - } - - return schemaChanges; -} - -function findInputObjectTypeChanges(oldType, newType) { - const schemaChanges = []; - const fieldsDiff = diff( - Object.values(oldType.getFields()), - Object.values(newType.getFields()), - ); - - for (const newField of fieldsDiff.added) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredInputField)(newField)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, - description: `A required field ${newField.name} on input type ${oldType.name} was added.`, - }); - } else { - schemaChanges.push({ - type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, - description: `An optional field ${newField.name} on input type ${oldType.name} was added.`, - }); - } - } - - for (const oldField of fieldsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: `${oldType.name}.${oldField.name} was removed.`, - }); - } - - for (const [oldField, newField] of fieldsDiff.persisted) { - const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( - oldField.type, - newField.type, - ); - - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_CHANGED_KIND, - description: - `${oldType.name}.${oldField.name} changed type from ` + - `${String(oldField.type)} to ${String(newField.type)}.`, - }); - } - } - - return schemaChanges; -} - -function findUnionTypeChanges(oldType, newType) { - const schemaChanges = []; - const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); - - for (const newPossibleType of possibleTypesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.TYPE_ADDED_TO_UNION, - description: `${newPossibleType.name} was added to union type ${oldType.name}.`, - }); - } - - for (const oldPossibleType of possibleTypesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, - description: `${oldPossibleType.name} was removed from union type ${oldType.name}.`, - }); - } - - return schemaChanges; -} - -function findEnumTypeChanges(oldType, newType) { - const schemaChanges = []; - const valuesDiff = diff(oldType.getValues(), newType.getValues()); - - for (const newValue of valuesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.VALUE_ADDED_TO_ENUM, - description: `${newValue.name} was added to enum type ${oldType.name}.`, - }); - } - - for (const oldValue of valuesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, - description: `${oldValue.name} was removed from enum type ${oldType.name}.`, - }); - } - - return schemaChanges; -} - -function findImplementedInterfacesChanges(oldType, newType) { - const schemaChanges = []; - const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); - - for (const newInterface of interfacesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, - description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`, - }); - } - - for (const oldInterface of interfacesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, - description: `${oldType.name} no longer implements interface ${oldInterface.name}.`, - }); - } - - return schemaChanges; -} - -function findFieldChanges(oldType, newType) { - const schemaChanges = []; - const fieldsDiff = diff( - Object.values(oldType.getFields()), - Object.values(newType.getFields()), - ); - - for (const oldField of fieldsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: `${oldType.name}.${oldField.name} was removed.`, - }); - } - - for (const [oldField, newField] of fieldsDiff.persisted) { - schemaChanges.push(...findArgChanges(oldType, oldField, newField)); - const isSafe = isChangeSafeForObjectOrInterfaceField( - oldField.type, - newField.type, - ); - - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.FIELD_CHANGED_KIND, - description: - `${oldType.name}.${oldField.name} changed type from ` + - `${String(oldField.type)} to ${String(newField.type)}.`, - }); - } - } - - return schemaChanges; -} - -function findArgChanges(oldType, oldField, newField) { - const schemaChanges = []; - const argsDiff = diff(oldField.args, newField.args); - - for (const oldArg of argsDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.ARG_REMOVED, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.`, - }); - } - - for (const [oldArg, newArg] of argsDiff.persisted) { - const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( - oldArg.type, - newArg.type, - ); - - if (!isSafe) { - schemaChanges.push({ - type: BreakingChangeType.ARG_CHANGED_KIND, - description: - `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` + - `${String(oldArg.type)} to ${String(newArg.type)}.`, - }); - } else if (oldArg.defaultValue !== undefined) { - if (newArg.defaultValue === undefined) { - schemaChanges.push({ - type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.`, - }); - } else { - // Since we looking only for client's observable changes we should - // compare default values in the same representation as they are - // represented inside introspection. - const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type); - const newValueStr = stringifyValue(newArg.defaultValue, newArg.type); - - if (oldValueStr !== newValueStr) { - schemaChanges.push({ - type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.`, - }); - } - } - } - } - - for (const newArg of argsDiff.added) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredArgument)(newArg)) { - schemaChanges.push({ - type: BreakingChangeType.REQUIRED_ARG_ADDED, - description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, - }); - } else { - schemaChanges.push({ - type: DangerousChangeType.OPTIONAL_ARG_ADDED, - description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, - }); - } - } - - return schemaChanges; -} - -function isChangeSafeForObjectOrInterfaceField(oldType, newType) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(oldType)) { - return ( - // if they're both lists, make sure the underlying types are compatible - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(newType) && - isChangeSafeForObjectOrInterfaceField( - oldType.ofType, - newType.ofType, - )) || // moving from nullable to non-null of the same underlying type is safe - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(newType) && - isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) - ); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(oldType)) { - // if they're both non-null, make sure the underlying types are compatible - return ( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(newType) && - isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) - ); - } - - return ( - // if they're both named types, see if their names are equivalent - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNamedType)(newType) && oldType.name === newType.name) || // moving from nullable to non-null of the same underlying type is safe - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(newType) && - isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) - ); -} - -function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(oldType)) { - // if they're both lists, make sure the underlying types are compatible - return ( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(newType) && - isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) - ); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(oldType)) { - return ( - // if they're both non-null, make sure the underlying types are - // compatible - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(newType) && - isChangeSafeForInputObjectFieldOrFieldArg( - oldType.ofType, - newType.ofType, - )) || // moving from non-null to nullable of the same underlying type is safe - (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(newType) && - isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType)) - ); - } // if they're both named types, see if their names are equivalent - - return (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNamedType)(newType) && oldType.name === newType.name; -} - -function typeKindName(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isScalarType)(type)) { - return 'a Scalar type'; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(type)) { - return 'an Object type'; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(type)) { - return 'an Interface type'; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isUnionType)(type)) { - return 'a Union type'; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(type)) { - return 'an Enum type'; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(type)) { - return 'an Input type'; - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_2__.invariant)(false, 'Unexpected type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__.inspect)(type)); -} - -function stringifyValue(value, type) { - const ast = (0,_astFromValue_mjs__WEBPACK_IMPORTED_MODULE_4__.astFromValue)(value, type); - ast != null || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_2__.invariant)(false); - return (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_5__.print)((0,_sortValueNode_mjs__WEBPACK_IMPORTED_MODULE_6__.sortValueNode)(ast)); -} - -function diff(oldArray, newArray) { - const added = []; - const removed = []; - const persisted = []; - const oldMap = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_7__.keyMap)(oldArray, ({ name }) => name); - const newMap = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_7__.keyMap)(newArray, ({ name }) => name); - - for (const oldItem of oldArray) { - const newItem = newMap[oldItem.name]; - - if (newItem === undefined) { - removed.push(oldItem); - } else { - persisted.push([oldItem, newItem]); - } - } - - for (const newItem of newArray) { - if (oldMap[newItem.name] === undefined) { - added.push(newItem); - } - } - - return { - added, - persisted, - removed, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs": -/*!*************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs ***! - \*************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getIntrospectionQuery": function() { return /* binding */ getIntrospectionQuery; } -/* harmony export */ }); -/** - * Produce the GraphQL query recommended for a full schema introspection. - * Accepts optional IntrospectionOptions. - */ -function getIntrospectionQuery(options) { - const optionsWithDefault = { - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false, - ...options, - }; - const descriptions = optionsWithDefault.descriptions ? 'description' : ''; - const specifiedByUrl = optionsWithDefault.specifiedByUrl - ? 'specifiedByURL' - : ''; - const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable - ? 'isRepeatable' - : ''; - const schemaDescription = optionsWithDefault.schemaDescription - ? descriptions - : ''; - - function inputDeprecation(str) { - return optionsWithDefault.inputValueDeprecation ? str : ''; - } - - return ` - query IntrospectionQuery { - __schema { - ${schemaDescription} - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - ${descriptions} - ${directiveIsRepeatable} - locations - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - } - } - } - - fragment FullType on __Type { - kind - name - ${descriptions} - ${specifiedByUrl} - fields(includeDeprecated: true) { - name - ${descriptions} - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - ${descriptions} - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } - } - - fragment InputValue on __InputValue { - name - ${descriptions} - type { ...TypeRef } - defaultValue - ${inputDeprecation('isDeprecated')} - ${inputDeprecation('deprecationReason')} - } - - fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } - } - `; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getOperationAST.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getOperationAST.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getOperationAST": function() { return /* binding */ getOperationAST; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - -/** - * Returns an operation AST given a document AST and optionally an operation - * name. If a name is not provided, an operation is only returned if only one is - * provided in the document. - */ - -function getOperationAST(documentAST, operationName) { - let operation = null; - - for (const definition of documentAST.definitions) { - if (definition.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OPERATION_DEFINITION) { - var _definition$name; - - if (operationName == null) { - // If no operation name was provided, only return an Operation if there - // is one defined in the document. Upon encountering the second, return - // null. - if (operation) { - return null; - } - - operation = definition; - } else if ( - ((_definition$name = definition.name) === null || - _definition$name === void 0 - ? void 0 - : _definition$name.value) === operationName - ) { - return definition; - } - } - } - - return operation; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/getOperationRootType.mjs": -/*!************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/getOperationRootType.mjs ***! - \************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getOperationRootType": function() { return /* binding */ getOperationRootType; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Extracts the root type of the operation from the schema. - * - * @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17 - */ -function getOperationRootType(schema, operation) { - if (operation.operation === 'query') { - const queryType = schema.getQueryType(); - - if (!queryType) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - 'Schema does not define the required query root type.', - { - nodes: operation, - }, - ); - } - - return queryType; - } - - if (operation.operation === 'mutation') { - const mutationType = schema.getMutationType(); - - if (!mutationType) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError('Schema is not configured for mutations.', { - nodes: operation, - }); - } - - return mutationType; - } - - if (operation.operation === 'subscription') { - const subscriptionType = schema.getSubscriptionType(); - - if (!subscriptionType) { - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError('Schema is not configured for subscriptions.', { - nodes: operation, - }); - } - - return subscriptionType; - } - - throw new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - 'Can only have query, mutation and subscription operations.', - { - nodes: operation, - }, - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/introspectionFromSchema.mjs": -/*!***************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/introspectionFromSchema.mjs ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "introspectionFromSchema": function() { return /* binding */ introspectionFromSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _language_parser_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/parser.mjs */ "../../../node_modules/graphql/language/parser.mjs"); -/* harmony import */ var _execution_execute_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../execution/execute.mjs */ "../../../node_modules/graphql/execution/execute.mjs"); -/* harmony import */ var _getIntrospectionQuery_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getIntrospectionQuery.mjs */ "../../../node_modules/graphql/utilities/getIntrospectionQuery.mjs"); - - - - -/** - * Build an IntrospectionQuery from a GraphQLSchema - * - * IntrospectionQuery is useful for utilities that care about type and field - * relationships, but do not need to traverse through those relationships. - * - * This is the inverse of buildClientSchema. The primary use case is outside - * of the server context, for instance when doing schema comparisons. - */ - -function introspectionFromSchema(schema, options) { - const optionsWithDefaults = { - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true, - ...options, - }; - const document = (0,_language_parser_mjs__WEBPACK_IMPORTED_MODULE_0__.parse)((0,_getIntrospectionQuery_mjs__WEBPACK_IMPORTED_MODULE_1__.getIntrospectionQuery)(optionsWithDefaults)); - const result = (0,_execution_execute_mjs__WEBPACK_IMPORTED_MODULE_2__.executeSync)({ - schema, - document, - }); - (!result.errors && result.data) || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false); - return result.data; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs": -/*!***************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/lexicographicSortSchema.mjs ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "lexicographicSortSchema": function() { return /* binding */ lexicographicSortSchema; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -/* harmony import */ var _jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_schema_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../type/schema.mjs */ "../../../node_modules/graphql/type/schema.mjs"); - - - - - - - - -/** - * Sort GraphQLSchema. - * - * This function returns a sorted copy of the given GraphQLSchema. - */ - -function lexicographicSortSchema(schema) { - const schemaConfig = schema.toConfig(); - const typeMap = (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_0__.keyValMap)( - sortByName(schemaConfig.types), - (type) => type.name, - sortNamedType, - ); - return new _type_schema_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLSchema({ - ...schemaConfig, - types: Object.values(typeMap), - directives: sortByName(schemaConfig.directives).map(sortDirective), - query: replaceMaybeType(schemaConfig.query), - mutation: replaceMaybeType(schemaConfig.mutation), - subscription: replaceMaybeType(schemaConfig.subscription), - }); - - function replaceType(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isListType)(type)) { - // @ts-expect-error - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLList(replaceType(type.ofType)); - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isNonNullType)(type)) { - // @ts-expect-error - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLNonNull(replaceType(type.ofType)); - } // @ts-expect-error FIXME: TS Conversion - - return replaceNamedType(type); - } - - function replaceNamedType(type) { - return typeMap[type.name]; - } - - function replaceMaybeType(maybeType) { - return maybeType && replaceNamedType(maybeType); - } - - function sortDirective(directive) { - const config = directive.toConfig(); - return new _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLDirective({ - ...config, - locations: sortBy(config.locations, (x) => x), - args: sortArgs(config.args), - }); - } - - function sortArgs(args) { - return sortObjMap(args, (arg) => ({ ...arg, type: replaceType(arg.type) })); - } - - function sortFields(fieldsMap) { - return sortObjMap(fieldsMap, (field) => ({ - ...field, - type: replaceType(field.type), - args: field.args && sortArgs(field.args), - })); - } - - function sortInputFields(fieldsMap) { - return sortObjMap(fieldsMap, (field) => ({ - ...field, - type: replaceType(field.type), - })); - } - - function sortTypes(array) { - return sortByName(array).map(replaceNamedType); - } - - function sortNamedType(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isScalarType)(type) || (0,_type_introspection_mjs__WEBPACK_IMPORTED_MODULE_4__.isIntrospectionType)(type)) { - return type; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(type)) { - const config = type.toConfig(); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLObjectType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields), - }); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(type)) { - const config = type.toConfig(); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLInterfaceType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields), - }); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isUnionType)(type)) { - const config = type.toConfig(); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLUnionType({ - ...config, - types: () => sortTypes(config.types), - }); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isEnumType)(type)) { - const config = type.toConfig(); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLEnumType({ - ...config, - values: sortObjMap(config.values, (value) => value), - }); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType)(type)) { - const config = type.toConfig(); - return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLInputObjectType({ - ...config, - fields: () => sortInputFields(config.fields), - }); - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_5__.invariant)(false, 'Unexpected type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_6__.inspect)(type)); - } -} - -function sortObjMap(map, sortValueFn) { - const sortedMap = Object.create(null); - - for (const key of Object.keys(map).sort(_jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_7__.naturalCompare)) { - sortedMap[key] = sortValueFn(map[key]); - } - - return sortedMap; -} - -function sortByName(array) { - return sortBy(array, (obj) => obj.name); -} - -function sortBy(array, mapToKey) { - return array.slice().sort((obj1, obj2) => { - const key1 = mapToKey(obj1); - const key2 = mapToKey(obj2); - return (0,_jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_7__.naturalCompare)(key1, key2); - }); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/printSchema.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/printSchema.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "printIntrospectionSchema": function() { return /* binding */ printIntrospectionSchema; }, -/* harmony export */ "printSchema": function() { return /* binding */ printSchema; }, -/* harmony export */ "printType": function() { return /* binding */ printType; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _language_blockString_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); -/* harmony import */ var _astFromValue_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); - - - - - - - - - - -function printSchema(schema) { - return printFilteredSchema( - schema, - (n) => !(0,_type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__.isSpecifiedDirective)(n), - isDefinedType, - ); -} -function printIntrospectionSchema(schema) { - return printFilteredSchema(schema, _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__.isSpecifiedDirective, _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_1__.isIntrospectionType); -} - -function isDefinedType(type) { - return !(0,_type_scalars_mjs__WEBPACK_IMPORTED_MODULE_2__.isSpecifiedScalarType)(type) && !(0,_type_introspection_mjs__WEBPACK_IMPORTED_MODULE_1__.isIntrospectionType)(type); -} - -function printFilteredSchema(schema, directiveFilter, typeFilter) { - const directives = schema.getDirectives().filter(directiveFilter); - const types = Object.values(schema.getTypeMap()).filter(typeFilter); - return [ - printSchemaDefinition(schema), - ...directives.map((directive) => printDirective(directive)), - ...types.map((type) => printType(type)), - ] - .filter(Boolean) - .join('\n\n'); -} - -function printSchemaDefinition(schema) { - if (schema.description == null && isSchemaOfCommonNames(schema)) { - return; - } - - const operationTypes = []; - const queryType = schema.getQueryType(); - - if (queryType) { - operationTypes.push(` query: ${queryType.name}`); - } - - const mutationType = schema.getMutationType(); - - if (mutationType) { - operationTypes.push(` mutation: ${mutationType.name}`); - } - - const subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType) { - operationTypes.push(` subscription: ${subscriptionType.name}`); - } - - return printDescription(schema) + `schema {\n${operationTypes.join('\n')}\n}`; -} -/** - * GraphQL schema define root types for each type of operation. These types are - * the same as any other type and can be named in any manner, however there is - * a common naming convention: - * - * ```graphql - * schema { - * query: Query - * mutation: Mutation - * subscription: Subscription - * } - * ``` - * - * When using this naming convention, the schema description can be omitted. - */ - -function isSchemaOfCommonNames(schema) { - const queryType = schema.getQueryType(); - - if (queryType && queryType.name !== 'Query') { - return false; - } - - const mutationType = schema.getMutationType(); - - if (mutationType && mutationType.name !== 'Mutation') { - return false; - } - - const subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType && subscriptionType.name !== 'Subscription') { - return false; - } - - return true; -} - -function printType(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isScalarType)(type)) { - return printScalar(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isObjectType)(type)) { - return printObject(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isInterfaceType)(type)) { - return printInterface(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isUnionType)(type)) { - return printUnion(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isEnumType)(type)) { - return printEnum(type); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isInputObjectType)(type)) { - return printInputObject(type); - } - /* c8 ignore next 3 */ - // Not reachable, all possible types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__.invariant)(false, 'Unexpected type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(type)); -} - -function printScalar(type) { - return ( - printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type) - ); -} - -function printImplementedInterfaces(type) { - const interfaces = type.getInterfaces(); - return interfaces.length - ? ' implements ' + interfaces.map((i) => i.name).join(' & ') - : ''; -} - -function printObject(type) { - return ( - printDescription(type) + - `type ${type.name}` + - printImplementedInterfaces(type) + - printFields(type) - ); -} - -function printInterface(type) { - return ( - printDescription(type) + - `interface ${type.name}` + - printImplementedInterfaces(type) + - printFields(type) - ); -} - -function printUnion(type) { - const types = type.getTypes(); - const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; - return printDescription(type) + 'union ' + type.name + possibleTypes; -} - -function printEnum(type) { - const values = type - .getValues() - .map( - (value, i) => - printDescription(value, ' ', !i) + - ' ' + - value.name + - printDeprecated(value.deprecationReason), - ); - return printDescription(type) + `enum ${type.name}` + printBlock(values); -} - -function printInputObject(type) { - const fields = Object.values(type.getFields()).map( - (f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f), - ); - return printDescription(type) + `input ${type.name}` + printBlock(fields); -} - -function printFields(type) { - const fields = Object.values(type.getFields()).map( - (f, i) => - printDescription(f, ' ', !i) + - ' ' + - f.name + - printArgs(f.args, ' ') + - ': ' + - String(f.type) + - printDeprecated(f.deprecationReason), - ); - return printBlock(fields); -} - -function printBlock(items) { - return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; -} - -function printArgs(args, indentation = '') { - if (args.length === 0) { - return ''; - } // If every arg does not have a description, print them on one line. - - if (args.every((arg) => !arg.description)) { - return '(' + args.map(printInputValue).join(', ') + ')'; - } - - return ( - '(\n' + - args - .map( - (arg, i) => - printDescription(arg, ' ' + indentation, !i) + - ' ' + - indentation + - printInputValue(arg), - ) - .join('\n') + - '\n' + - indentation + - ')' - ); -} - -function printInputValue(arg) { - const defaultAST = (0,_astFromValue_mjs__WEBPACK_IMPORTED_MODULE_6__.astFromValue)(arg.defaultValue, arg.type); - let argDecl = arg.name + ': ' + String(arg.type); - - if (defaultAST) { - argDecl += ` = ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_7__.print)(defaultAST)}`; - } - - return argDecl + printDeprecated(arg.deprecationReason); -} - -function printDirective(directive) { - return ( - printDescription(directive) + - 'directive @' + - directive.name + - printArgs(directive.args) + - (directive.isRepeatable ? ' repeatable' : '') + - ' on ' + - directive.locations.join(' | ') - ); -} - -function printDeprecated(reason) { - if (reason == null) { - return ''; - } - - if (reason !== _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_DEPRECATION_REASON) { - const astValue = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_7__.print)({ - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_8__.Kind.STRING, - value: reason, - }); - return ` @deprecated(reason: ${astValue})`; - } - - return ' @deprecated'; -} - -function printSpecifiedByURL(scalar) { - if (scalar.specifiedByURL == null) { - return ''; - } - - const astValue = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_7__.print)({ - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_8__.Kind.STRING, - value: scalar.specifiedByURL, - }); - return ` @specifiedBy(url: ${astValue})`; -} - -function printDescription(def, indentation = '', firstInBlock = true) { - const { description } = def; - - if (description == null) { - return ''; - } - - const blockString = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_7__.print)({ - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_8__.Kind.STRING, - value: description, - block: (0,_language_blockString_mjs__WEBPACK_IMPORTED_MODULE_9__.isPrintableAsBlockString)(description), - }); - const prefix = - indentation && !firstInBlock ? '\n' + indentation : indentation; - return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/separateOperations.mjs": -/*!**********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/separateOperations.mjs ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "separateOperations": function() { return /* binding */ separateOperations; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_visitor_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); - - -/** - * separateOperations accepts a single AST document which may contain many - * operations and fragments and returns a collection of AST documents each of - * which contains a single operation as well the fragment definitions it - * refers to. - */ - -function separateOperations(documentAST) { - const operations = []; - const depGraph = Object.create(null); // Populate metadata and build a dependency graph. - - for (const definitionNode of documentAST.definitions) { - switch (definitionNode.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies( - definitionNode.selectionSet, - ); - break; - - default: // ignore non-executable definitions - } - } // For each operation, produce a new synthesized AST which includes only what - // is necessary for completing that operation. - - const separatedDocumentASTs = Object.create(null); - - for (const operation of operations) { - const dependencies = new Set(); - - for (const fragmentName of collectDependencies(operation.selectionSet)) { - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } // Provides the empty string for anonymous operations. - - const operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted - // to retain the same order as the original document. - - separatedDocumentASTs[operationName] = { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.DOCUMENT, - definitions: documentAST.definitions.filter( - (node) => - node === operation || - (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_DEFINITION && - dependencies.has(node.name.value)), - ), - }; - } - - return separatedDocumentASTs; -} - -// From a dependency graph, collects a list of transitive dependencies by -// recursing through a dependency graph. -function collectTransitiveDependencies(collected, depGraph, fromName) { - if (!collected.has(fromName)) { - collected.add(fromName); - const immediateDeps = depGraph[fromName]; - - if (immediateDeps !== undefined) { - for (const toName of immediateDeps) { - collectTransitiveDependencies(collected, depGraph, toName); - } - } - } -} - -function collectDependencies(selectionSet) { - const dependencies = []; - (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_1__.visit)(selectionSet, { - FragmentSpread(node) { - dependencies.push(node.name.value); - }, - }); - return dependencies; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/sortValueNode.mjs": -/*!*****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/sortValueNode.mjs ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "sortValueNode": function() { return /* binding */ sortValueNode; } -/* harmony export */ }); -/* harmony import */ var _jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - - -/** - * Sort ValueNode. - * - * This function returns a sorted copy of the given ValueNode. - * - * @internal - */ - -function sortValueNode(valueNode) { - switch (valueNode.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT: - return { ...valueNode, fields: sortFields(valueNode.fields) }; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST: - return { ...valueNode, values: valueNode.values.map(sortValueNode) }; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INT: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FLOAT: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.STRING: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.BOOLEAN: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NULL: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.ENUM: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE: - return valueNode; - } -} - -function sortFields(fields) { - return fields - .map((fieldNode) => ({ - ...fieldNode, - value: sortValueNode(fieldNode.value), - })) - .sort((fieldA, fieldB) => - (0,_jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_1__.naturalCompare)(fieldA.name.value, fieldB.name.value), - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs": -/*!**************************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/stripIgnoredCharacters.mjs ***! - \**************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "stripIgnoredCharacters": function() { return /* binding */ stripIgnoredCharacters; } -/* harmony export */ }); -/* harmony import */ var _language_blockString_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../language/blockString.mjs */ "../../../node_modules/graphql/language/blockString.mjs"); -/* harmony import */ var _language_lexer_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/lexer.mjs */ "../../../node_modules/graphql/language/lexer.mjs"); -/* harmony import */ var _language_source_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/source.mjs */ "../../../node_modules/graphql/language/source.mjs"); -/* harmony import */ var _language_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/tokenKind.mjs */ "../../../node_modules/graphql/language/tokenKind.mjs"); - - - - -/** - * Strips characters that are not significant to the validity or execution - * of a GraphQL document: - * - UnicodeBOM - * - WhiteSpace - * - LineTerminator - * - Comment - * - Comma - * - BlockString indentation - * - * Note: It is required to have a delimiter character between neighboring - * non-punctuator tokens and this function always uses single space as delimiter. - * - * It is guaranteed that both input and output documents if parsed would result - * in the exact same AST except for nodes location. - * - * Warning: It is guaranteed that this function will always produce stable results. - * However, it's not guaranteed that it will stay the same between different - * releases due to bugfixes or changes in the GraphQL specification. - * - * Query example: - * - * ```graphql - * query SomeQuery($foo: String!, $bar: String) { - * someField(foo: $foo, bar: $bar) { - * a - * b { - * c - * d - * } - * } - * } - * ``` - * - * Becomes: - * - * ```graphql - * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} - * ``` - * - * SDL example: - * - * ```graphql - * """ - * Type description - * """ - * type Foo { - * """ - * Field description - * """ - * bar: String - * } - * ``` - * - * Becomes: - * - * ```graphql - * """Type description""" type Foo{"""Field description""" bar:String} - * ``` - */ - -function stripIgnoredCharacters(source) { - const sourceObj = (0,_language_source_mjs__WEBPACK_IMPORTED_MODULE_0__.isSource)(source) ? source : new _language_source_mjs__WEBPACK_IMPORTED_MODULE_0__.Source(source); - const body = sourceObj.body; - const lexer = new _language_lexer_mjs__WEBPACK_IMPORTED_MODULE_1__.Lexer(sourceObj); - let strippedBody = ''; - let wasLastAddedTokenNonPunctuator = false; - - while (lexer.advance().kind !== _language_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__.TokenKind.EOF) { - const currentToken = lexer.token; - const tokenKind = currentToken.kind; - /** - * Every two non-punctuator tokens should have space between them. - * Also prevent case of non-punctuator token following by spread resulting - * in invalid token (e.g. `1...` is invalid Float token). - */ - - const isNonPunctuator = !(0,_language_lexer_mjs__WEBPACK_IMPORTED_MODULE_1__.isPunctuatorTokenKind)(currentToken.kind); - - if (wasLastAddedTokenNonPunctuator) { - if (isNonPunctuator || currentToken.kind === _language_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__.TokenKind.SPREAD) { - strippedBody += ' '; - } - } - - const tokenBody = body.slice(currentToken.start, currentToken.end); - - if (tokenKind === _language_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__.TokenKind.BLOCK_STRING) { - strippedBody += (0,_language_blockString_mjs__WEBPACK_IMPORTED_MODULE_3__.printBlockString)(currentToken.value, { - minimize: true, - }); - } else { - strippedBody += tokenBody; - } - - wasLastAddedTokenNonPunctuator = isNonPunctuator; - } - - return strippedBody; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/typeComparators.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/typeComparators.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "doTypesOverlap": function() { return /* binding */ doTypesOverlap; }, -/* harmony export */ "isEqualType": function() { return /* binding */ isEqualType; }, -/* harmony export */ "isTypeSubTypeOf": function() { return /* binding */ isTypeSubTypeOf; } -/* harmony export */ }); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - -/** - * Provided two types, return true if the types are equal (invariant). - */ -function isEqualType(typeA, typeB) { - // Equivalent types are equal. - if (typeA === typeB) { - return true; - } // If either type is non-null, the other must also be non-null. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(typeA) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } // If either type is a list, the other must also be a list. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(typeA) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } // Otherwise the types are not equal. - - return false; -} -/** - * Provided a type and a super type, return true if the first type is either - * equal or a subset of the second super type (covariant). - */ - -function isTypeSubTypeOf(schema, maybeSubType, superType) { - // Equivalent type is a valid subtype - if (maybeSubType === superType) { - return true; - } // If superType is non-null, maybeSubType must also be non-null. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(superType)) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); - } - - return false; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(maybeSubType)) { - // If superType is nullable, maybeSubType may be non-null or nullable. - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); - } // If superType type is a list, maybeSubType type must also be a list. - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(superType)) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); - } - - return false; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(maybeSubType)) { - // If superType is not a list, maybeSubType must also be not a list. - return false; - } // If superType type is an abstract type, check if it is super type of maybeSubType. - // Otherwise, the child type is not a valid subtype of the parent type. - - return ( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isAbstractType)(superType) && - ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInterfaceType)(maybeSubType) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isObjectType)(maybeSubType)) && - schema.isSubType(superType, maybeSubType) - ); -} -/** - * Provided two composite types, determine if they "overlap". Two composite - * types overlap when the Sets of possible concrete types for each intersect. - * - * This is often used to determine if a fragment of a given type could possibly - * be visited in a context of another type. - * - * This function is commutative. - */ - -function doTypesOverlap(schema, typeA, typeB) { - // Equivalent types overlap - if (typeA === typeB) { - return true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isAbstractType)(typeA)) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isAbstractType)(typeB)) { - // If both types are abstract, then determine if there is any intersection - // between possible concrete types of each. - return schema - .getPossibleTypes(typeA) - .some((type) => schema.isSubType(typeB, type)); - } // Determine if the latter type is a possible concrete type of the former. - - return schema.isSubType(typeA, typeB); - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isAbstractType)(typeB)) { - // Determine if the former type is a possible concrete type of the latter. - return schema.isSubType(typeB, typeA); - } // Otherwise the types do not overlap. - - return false; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/typeFromAST.mjs": -/*!***************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/typeFromAST.mjs ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "typeFromAST": function() { return /* binding */ typeFromAST; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - -function typeFromAST(schema, typeNode) { - switch (typeNode.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST_TYPE: { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLList(innerType); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NON_NULL_TYPE: { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLNonNull(innerType); - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NAMED_TYPE: - return schema.getType(typeNode.name.value); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/valueFromAST.mjs": -/*!****************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/valueFromAST.mjs ***! - \****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "valueFromAST": function() { return /* binding */ valueFromAST; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - -/** - * Produces a JavaScript value given a GraphQL Value AST. - * - * A GraphQL type must be provided, which will be used to interpret different - * GraphQL Value literals. - * - * Returns `undefined` when the value could not be validly coerced according to - * the provided type. - * - * | GraphQL Value | JSON Value | - * | -------------------- | ------------- | - * | Input Object | Object | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Number | - * | Enum Value | Unknown | - * | NullValue | null | - * - */ - -function valueFromAST(valueNode, type, variables) { - if (!valueNode) { - // When there is no node, then there is also no value. - // Importantly, this is different from returning the value null. - return; - } - - if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE) { - const variableName = valueNode.name.value; - - if (variables == null || variables[variableName] === undefined) { - // No valid return value. - return; - } - - const variableValue = variables[variableName]; - - if (variableValue === null && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(type)) { - return; // Invalid: intentionally return no value. - } // Note: This does no further checking that this variable is correct. - // This assumes that this query has been validated and the variable - // usage here is of the correct type. - - return variableValue; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(type)) { - if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NULL) { - return; // Invalid: intentionally return no value. - } - - return valueFromAST(valueNode, type.ofType, variables); - } - - if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NULL) { - // This is explicitly returning the value null. - return null; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isListType)(type)) { - const itemType = type.ofType; - - if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST) { - const coercedValues = []; - - for (const itemNode of valueNode.values) { - if (isMissingVariable(itemNode, variables)) { - // If an array contains a missing variable, it is either coerced to - // null or if the item type is non-null, it considered invalid. - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(itemType)) { - return; // Invalid: intentionally return no value. - } - - coercedValues.push(null); - } else { - const itemValue = valueFromAST(itemNode, itemType, variables); - - if (itemValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedValues.push(itemValue); - } - } - - return coercedValues; - } - - const coercedValue = valueFromAST(valueNode, itemType, variables); - - if (coercedValue === undefined) { - return; // Invalid: intentionally return no value. - } - - return [coercedValue]; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isInputObjectType)(type)) { - if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT) { - return; // Invalid: intentionally return no value. - } - - const coercedObj = Object.create(null); - const fieldNodes = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_2__.keyMap)(valueNode.fields, (field) => field.name.value); - - for (const field of Object.values(type.getFields())) { - const fieldNode = fieldNodes[field.name]; - - if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { - if (field.defaultValue !== undefined) { - coercedObj[field.name] = field.defaultValue; - } else if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(field.type)) { - return; // Invalid: intentionally return no value. - } - - continue; - } - - const fieldValue = valueFromAST(fieldNode.value, field.type, variables); - - if (fieldValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedObj[field.name] = fieldValue; - } - - return coercedObj; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isLeafType)(type)) { - // Scalars and Enums fulfill parsing a literal value via parseLiteral(). - // Invalid values represent a failure to parse correctly, in which case - // no value is returned. - let result; - - try { - result = type.parseLiteral(valueNode, variables); - } catch (_error) { - return; // Invalid: intentionally return no value. - } - - if (result === undefined) { - return; // Invalid: intentionally return no value. - } - - return result; - } - /* c8 ignore next 3 */ - // Not reachable, all possible input types have been considered. - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false, 'Unexpected input type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__.inspect)(type)); -} // Returns true if the provided valueNode is a variable which is not defined -// in the set of variables. - -function isMissingVariable(valueNode, variables) { - return ( - valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE && - (variables == null || variables[valueNode.name.value] === undefined) - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs": -/*!***********************************************************************!*\ - !*** ../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs ***! - \***********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "valueFromASTUntyped": function() { return /* binding */ valueFromASTUntyped; } -/* harmony export */ }); -/* harmony import */ var _jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsutils/keyValMap.mjs */ "../../../node_modules/graphql/jsutils/keyValMap.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - - -/** - * Produces a JavaScript value given a GraphQL Value AST. - * - * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value - * will reflect the provided GraphQL value AST. - * - * | GraphQL Value | JavaScript Value | - * | -------------------- | ---------------- | - * | Input Object | Object | - * | List | Array | - * | Boolean | Boolean | - * | String / Enum | String | - * | Int / Float | Number | - * | Null | null | - * - */ - -function valueFromASTUntyped(valueNode, variables) { - switch (valueNode.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.NULL: - return null; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.INT: - return parseInt(valueNode.value, 10); - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FLOAT: - return parseFloat(valueNode.value); - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.STRING: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.ENUM: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.BOOLEAN: - return valueNode.value; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.LIST: - return valueNode.values.map((node) => - valueFromASTUntyped(node, variables), - ); - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OBJECT: - return (0,_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_1__.keyValMap)( - valueNode.fields, - (field) => field.name.value, - (field) => valueFromASTUntyped(field.value, variables), - ); - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.VARIABLE: - return variables === null || variables === void 0 - ? void 0 - : variables[valueNode.name.value]; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/ValidationContext.mjs": -/*!**********************************************************************!*\ - !*** ../../../node_modules/graphql/validation/ValidationContext.mjs ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ASTValidationContext": function() { return /* binding */ ASTValidationContext; }, -/* harmony export */ "SDLValidationContext": function() { return /* binding */ SDLValidationContext; }, -/* harmony export */ "ValidationContext": function() { return /* binding */ ValidationContext; } -/* harmony export */ }); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -/* harmony import */ var _utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); - - - - -/** - * An instance of this class is passed as the "this" context to all validators, - * allowing access to commonly useful contextual information from within a - * validation rule. - */ -class ASTValidationContext { - constructor(ast, onError) { - this._ast = ast; - this._fragments = undefined; - this._fragmentSpreads = new Map(); - this._recursivelyReferencedFragments = new Map(); - this._onError = onError; - } - - get [Symbol.toStringTag]() { - return 'ASTValidationContext'; - } - - reportError(error) { - this._onError(error); - } - - getDocument() { - return this._ast; - } - - getFragment(name) { - let fragments; - - if (this._fragments) { - fragments = this._fragments; - } else { - fragments = Object.create(null); - - for (const defNode of this.getDocument().definitions) { - if (defNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_DEFINITION) { - fragments[defNode.name.value] = defNode; - } - } - - this._fragments = fragments; - } - - return fragments[name]; - } - - getFragmentSpreads(node) { - let spreads = this._fragmentSpreads.get(node); - - if (!spreads) { - spreads = []; - const setsToVisit = [node]; - let set; - - while ((set = setsToVisit.pop())) { - for (const selection of set.selections) { - if (selection.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_SPREAD) { - spreads.push(selection); - } else if (selection.selectionSet) { - setsToVisit.push(selection.selectionSet); - } - } - } - - this._fragmentSpreads.set(node, spreads); - } - - return spreads; - } - - getRecursivelyReferencedFragments(operation) { - let fragments = this._recursivelyReferencedFragments.get(operation); - - if (!fragments) { - fragments = []; - const collectedNames = Object.create(null); - const nodesToVisit = [operation.selectionSet]; - let node; - - while ((node = nodesToVisit.pop())) { - for (const spread of this.getFragmentSpreads(node)) { - const fragName = spread.name.value; - - if (collectedNames[fragName] !== true) { - collectedNames[fragName] = true; - const fragment = this.getFragment(fragName); - - if (fragment) { - fragments.push(fragment); - nodesToVisit.push(fragment.selectionSet); - } - } - } - } - - this._recursivelyReferencedFragments.set(operation, fragments); - } - - return fragments; - } -} -class SDLValidationContext extends ASTValidationContext { - constructor(ast, schema, onError) { - super(ast, onError); - this._schema = schema; - } - - get [Symbol.toStringTag]() { - return 'SDLValidationContext'; - } - - getSchema() { - return this._schema; - } -} -class ValidationContext extends ASTValidationContext { - constructor(schema, ast, typeInfo, onError) { - super(ast, onError); - this._schema = schema; - this._typeInfo = typeInfo; - this._variableUsages = new Map(); - this._recursiveVariableUsages = new Map(); - } - - get [Symbol.toStringTag]() { - return 'ValidationContext'; - } - - getSchema() { - return this._schema; - } - - getVariableUsages(node) { - let usages = this._variableUsages.get(node); - - if (!usages) { - const newUsages = []; - const typeInfo = new _utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__.TypeInfo(this._schema); - (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__.visit)( - node, - (0,_utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__.visitWithTypeInfo)(typeInfo, { - VariableDefinition: () => false, - - Variable(variable) { - newUsages.push({ - node: variable, - type: typeInfo.getInputType(), - defaultValue: typeInfo.getDefaultValue(), - }); - }, - }), - ); - usages = newUsages; - - this._variableUsages.set(node, usages); - } - - return usages; - } - - getRecursiveVariableUsages(operation) { - let usages = this._recursiveVariableUsages.get(operation); - - if (!usages) { - usages = this.getVariableUsages(operation); - - for (const frag of this.getRecursivelyReferencedFragments(operation)) { - usages = usages.concat(this.getVariableUsages(frag)); - } - - this._recursiveVariableUsages.set(operation, usages); - } - - return usages; - } - - getType() { - return this._typeInfo.getType(); - } - - getParentType() { - return this._typeInfo.getParentType(); - } - - getInputType() { - return this._typeInfo.getInputType(); - } - - getParentInputType() { - return this._typeInfo.getParentInputType(); - } - - getFieldDef() { - return this._typeInfo.getFieldDef(); - } - - getDirective() { - return this._typeInfo.getDirective(); - } - - getArgument() { - return this._typeInfo.getArgument(); - } - - getEnumValue() { - return this._typeInfo.getEnumValue(); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs": -/*!************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs ***! - \************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ExecutableDefinitionsRule": function() { return /* binding */ ExecutableDefinitionsRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); - - - - -/** - * Executable definitions - * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. - * - * See https://spec.graphql.org/draft/#sec-Executable-Definitions - */ -function ExecutableDefinitionsRule(context) { - return { - Document(node) { - for (const definition of node.definitions) { - if (!(0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isExecutableDefinitionNode)(definition)) { - const defName = - definition.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_DEFINITION || - definition.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_EXTENSION - ? 'schema' - : '"' + definition.name.value + '"'; - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError(`The ${defName} definition is not executable.`, { - nodes: definition, - }), - ); - } - } - - return false; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "FieldsOnCorrectTypeRule": function() { return /* binding */ FieldsOnCorrectTypeRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../jsutils/naturalCompare.mjs */ "../../../node_modules/graphql/jsutils/naturalCompare.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - - -/** - * Fields on correct type - * - * A GraphQL document is only valid if all fields selected are defined by the - * parent type, or are an allowed meta field such as __typename. - * - * See https://spec.graphql.org/draft/#sec-Field-Selections - */ -function FieldsOnCorrectTypeRule(context) { - return { - Field(node) { - const type = context.getParentType(); - - if (type) { - const fieldDef = context.getFieldDef(); - - if (!fieldDef) { - // This field doesn't exist, lets look for suggestions. - const schema = context.getSchema(); - const fieldName = node.name.value; // First determine if there are any suggested types to condition on. - - let suggestion = (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__.didYouMean)( - 'to use an inline fragment on', - getSuggestedTypeNames(schema, type, fieldName), - ); // If there are no suggested types, then perhaps this was a typo? - - if (suggestion === '') { - suggestion = (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__.didYouMean)(getSuggestedFieldNames(type, fieldName)); - } // Report an error, including helpful suggestions. - - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Cannot query field "${fieldName}" on type "${type.name}".` + - suggestion, - { - nodes: node, - }, - ), - ); - } - } - }, - }; -} -/** - * Go through all of the implementations of type, as well as the interfaces that - * they implement. If any of those types include the provided field, suggest them, - * sorted by how often the type is referenced. - */ - -function getSuggestedTypeNames(schema, type, fieldName) { - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isAbstractType)(type)) { - // Must be an Object type, which does not have possible fields. - return []; - } - - const suggestedTypes = new Set(); - const usageCount = Object.create(null); - - for (const possibleType of schema.getPossibleTypes(type)) { - if (!possibleType.getFields()[fieldName]) { - continue; - } // This object type defines this field. - - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - - for (const possibleInterface of possibleType.getInterfaces()) { - var _usageCount$possibleI; - - if (!possibleInterface.getFields()[fieldName]) { - continue; - } // This interface type defines this field. - - suggestedTypes.add(possibleInterface); - usageCount[possibleInterface.name] = - ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== - null && _usageCount$possibleI !== void 0 - ? _usageCount$possibleI - : 0) + 1; - } - } - - return [...suggestedTypes] - .sort((typeA, typeB) => { - // Suggest both interface and object types based on how common they are. - const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - - if (usageCountDiff !== 0) { - return usageCountDiff; - } // Suggest super types first followed by subtypes - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - - return (0,_jsutils_naturalCompare_mjs__WEBPACK_IMPORTED_MODULE_3__.naturalCompare)(typeA.name, typeB.name); - }) - .map((x) => x.name); -} -/** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - */ - -function getSuggestedFieldNames(type, fieldName) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isObjectType)(type) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInterfaceType)(type)) { - const possibleFieldNames = Object.keys(type.getFields()); - return (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__.suggestionList)(fieldName, possibleFieldNames); - } // Otherwise, must be a Union type, which does not define fields. - - return []; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "FragmentsOnCompositeTypesRule": function() { return /* binding */ FragmentsOnCompositeTypesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - -/** - * Fragments on composite type - * - * Fragments use a type condition to determine if they apply, since fragments - * can only be spread into a composite type (object, interface, or union), the - * type condition must also be a composite type. - * - * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types - */ -function FragmentsOnCompositeTypesRule(context) { - return { - InlineFragment(node) { - const typeCondition = node.typeCondition; - - if (typeCondition) { - const type = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__.typeFromAST)(context.getSchema(), typeCondition); - - if (type && !(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isCompositeType)(type)) { - const typeStr = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_2__.print)(typeCondition); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Fragment cannot condition on non composite type "${typeStr}".`, - { - nodes: typeCondition, - }, - ), - ); - } - } - }, - - FragmentDefinition(node) { - const type = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__.typeFromAST)(context.getSchema(), node.typeCondition); - - if (type && !(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isCompositeType)(type)) { - const typeStr = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_2__.print)(node.typeCondition); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, - { - nodes: node.typeCondition, - }, - ), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs": -/*!*********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "KnownArgumentNamesOnDirectivesRule": function() { return /* binding */ KnownArgumentNamesOnDirectivesRule; }, -/* harmony export */ "KnownArgumentNamesRule": function() { return /* binding */ KnownArgumentNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); - - - - - - -/** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - * - * See https://spec.graphql.org/draft/#sec-Argument-Names - * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations - */ -function KnownArgumentNamesRule(context) { - return { - // eslint-disable-next-line new-cap - ...KnownArgumentNamesOnDirectivesRule(context), - - Argument(argNode) { - const argDef = context.getArgument(); - const fieldDef = context.getFieldDef(); - const parentType = context.getParentType(); - - if (!argDef && fieldDef && parentType) { - const argName = argNode.name.value; - const knownArgsNames = fieldDef.args.map((arg) => arg.name); - const suggestions = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_0__.suggestionList)(argName, knownArgsNames); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + - (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_2__.didYouMean)(suggestions), - { - nodes: argNode, - }, - ), - ); - } - }, - }; -} -/** - * @internal - */ - -function KnownArgumentNamesOnDirectivesRule(context) { - const directiveArgs = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema - ? schema.getDirectives() - : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__.specifiedDirectives; - - for (const directive of definedDirectives) { - directiveArgs[directive.name] = directive.args.map((arg) => arg.name); - } - - const astDefinitions = context.getDocument().definitions; - - for (const def of astDefinitions) { - if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argsNodes = - (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 - ? _def$arguments - : []; - directiveArgs[def.name.value] = argsNodes.map((arg) => arg.name.value); - } - } - - return { - Directive(directiveNode) { - const directiveName = directiveNode.name.value; - const knownArgs = directiveArgs[directiveName]; - - if (directiveNode.arguments && knownArgs) { - for (const argNode of directiveNode.arguments) { - const argName = argNode.name.value; - - if (!knownArgs.includes(argName)) { - const suggestions = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_0__.suggestionList)(argName, knownArgs); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Unknown argument "${argName}" on directive "@${directiveName}".` + - (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_2__.didYouMean)(suggestions), - { - nodes: argNode, - }, - ), - ); - } - } - } - - return false; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs": -/*!******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs ***! - \******************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "KnownDirectivesRule": function() { return /* binding */ KnownDirectivesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_ast_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../language/ast.mjs */ "../../../node_modules/graphql/language/ast.mjs"); -/* harmony import */ var _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../language/directiveLocation.mjs */ "../../../node_modules/graphql/language/directiveLocation.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); - - - - - - - - -/** - * Known directives - * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. - * - * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined - */ -function KnownDirectivesRule(context) { - const locationsMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema - ? schema.getDirectives() - : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__.specifiedDirectives; - - for (const directive of definedDirectives) { - locationsMap[directive.name] = directive.locations; - } - - const astDefinitions = context.getDocument().definitions; - - for (const def of astDefinitions) { - if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DIRECTIVE_DEFINITION) { - locationsMap[def.name.value] = def.locations.map((name) => name.value); - } - } - - return { - Directive(node, _key, _parent, _path, ancestors) { - const name = node.name.value; - const locations = locationsMap[name]; - - if (!locations) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError(`Unknown directive "@${name}".`, { - nodes: node, - }), - ); - return; - } - - const candidateLocation = getDirectiveLocationForASTPath(ancestors); - - if (candidateLocation && !locations.includes(candidateLocation)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Directive "@${name}" may not be used on ${candidateLocation}.`, - { - nodes: node, - }, - ), - ); - } - }, - }; -} - -function getDirectiveLocationForASTPath(ancestors) { - const appliedTo = ancestors[ancestors.length - 1]; - 'kind' in appliedTo || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false); - - switch (appliedTo.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FIELD: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.FIELD; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FRAGMENT_SPREAD: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.FRAGMENT_SPREAD; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INLINE_FRAGMENT: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.INLINE_FRAGMENT; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FRAGMENT_DEFINITION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.FRAGMENT_DEFINITION; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.VARIABLE_DEFINITION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.VARIABLE_DEFINITION; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.SCHEMA; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCALAR_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCALAR_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.SCALAR; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.OBJECT_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.OBJECT; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.FIELD_DEFINITION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.FIELD_DEFINITION; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INTERFACE_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INTERFACE_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.INTERFACE; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.UNION_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.UNION_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.UNION; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.ENUM; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.ENUM_VALUE_DEFINITION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.ENUM_VALUE; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INPUT_OBJECT_TYPE_DEFINITION: - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INPUT_OBJECT_TYPE_EXTENSION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.INPUT_OBJECT; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INPUT_VALUE_DEFINITION: { - const parentNode = ancestors[ancestors.length - 3]; - 'kind' in parentNode || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false); - return parentNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.INPUT_OBJECT_TYPE_DEFINITION - ? _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.INPUT_FIELD_DEFINITION - : _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.ARGUMENT_DEFINITION; - } - // Not reachable, all possible types have been considered. - - /* c8 ignore next */ - - default: - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__.invariant)(false, 'Unexpected kind: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_5__.inspect)(appliedTo.kind)); - } -} - -function getDirectiveLocationForOperation(operation) { - switch (operation) { - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_6__.OperationTypeNode.QUERY: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.QUERY; - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_6__.OperationTypeNode.MUTATION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.MUTATION; - - case _language_ast_mjs__WEBPACK_IMPORTED_MODULE_6__.OperationTypeNode.SUBSCRIPTION: - return _language_directiveLocation_mjs__WEBPACK_IMPORTED_MODULE_4__.DirectiveLocation.SUBSCRIPTION; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs": -/*!*********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "KnownFragmentNamesRule": function() { return /* binding */ KnownFragmentNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. - * - * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined - */ -function KnownFragmentNamesRule(context) { - return { - FragmentSpread(node) { - const fragmentName = node.name.value; - const fragment = context.getFragment(fragmentName); - - if (!fragment) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError(`Unknown fragment "${fragmentName}".`, { - nodes: node.name, - }), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs": -/*!*****************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs ***! - \*****************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "KnownTypeNamesRule": function() { return /* binding */ KnownTypeNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); -/* harmony import */ var _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); - - - - - - - -/** - * Known type names - * - * A GraphQL document is only valid if referenced types (specifically - * variable definitions and fragment conditions) are defined by the type schema. - * - * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence - */ -function KnownTypeNamesRule(context) { - const schema = context.getSchema(); - const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); - const definedTypes = Object.create(null); - - for (const def of context.getDocument().definitions) { - if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = true; - } - } - - const typeNames = [ - ...Object.keys(existingTypesMap), - ...Object.keys(definedTypes), - ]; - return { - NamedType(node, _1, parent, _2, ancestors) { - const typeName = node.name.value; - - if (!existingTypesMap[typeName] && !definedTypes[typeName]) { - var _ancestors$; - - const definitionNode = - (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 - ? _ancestors$ - : parent; - const isSDL = definitionNode != null && isSDLNode(definitionNode); - - if (isSDL && standardTypeNames.includes(typeName)) { - return; - } - - const suggestedTypes = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__.suggestionList)( - typeName, - isSDL ? standardTypeNames.concat(typeNames) : typeNames, - ); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Unknown type "${typeName}".` + (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__.didYouMean)(suggestedTypes), - { - nodes: node, - }, - ), - ); - } - }, - }; -} -const standardTypeNames = [..._type_scalars_mjs__WEBPACK_IMPORTED_MODULE_4__.specifiedScalarTypes, ..._type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__.introspectionTypes].map( - (type) => type.name, -); - -function isSDLNode(value) { - return ( - 'kind' in value && - ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isTypeSystemDefinitionNode)(value) || (0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isTypeSystemExtensionNode)(value)) - ); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "LoneAnonymousOperationRule": function() { return /* binding */ LoneAnonymousOperationRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); - - - -/** - * Lone anonymous operation - * - * A GraphQL document is only valid if when it contains an anonymous operation - * (the query short-hand) that it contains only that one operation definition. - * - * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation - */ -function LoneAnonymousOperationRule(context) { - let operationCount = 0; - return { - Document(node) { - operationCount = node.definitions.filter( - (definition) => definition.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.OPERATION_DEFINITION, - ).length; - }, - - OperationDefinition(node) { - if (!node.name && operationCount > 1) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - 'This anonymous operation must be the only defined operation.', - { - nodes: node, - }, - ), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "LoneSchemaDefinitionRule": function() { return /* binding */ LoneSchemaDefinitionRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. - */ -function LoneSchemaDefinitionRule(context) { - var _ref, _ref2, _oldSchema$astNode; - - const oldSchema = context.getSchema(); - const alreadyDefined = - (_ref = - (_ref2 = - (_oldSchema$astNode = - oldSchema === null || oldSchema === void 0 - ? void 0 - : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 - ? _oldSchema$astNode - : oldSchema === null || oldSchema === void 0 - ? void 0 - : oldSchema.getQueryType()) !== null && _ref2 !== void 0 - ? _ref2 - : oldSchema === null || oldSchema === void 0 - ? void 0 - : oldSchema.getMutationType()) !== null && _ref !== void 0 - ? _ref - : oldSchema === null || oldSchema === void 0 - ? void 0 - : oldSchema.getSubscriptionType(); - let schemaDefinitionsCount = 0; - return { - SchemaDefinition(node) { - if (alreadyDefined) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - 'Cannot define a new schema within a schema extension.', - { - nodes: node, - }, - ), - ); - return; - } - - if (schemaDefinitionsCount > 0) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError('Must provide only one schema definition.', { - nodes: node, - }), - ); - } - - ++schemaDefinitionsCount; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs": -/*!*******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs ***! - \*******************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoFragmentCyclesRule": function() { return /* binding */ NoFragmentCyclesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * No fragment cycles - * - * The graph of fragment spreads must not form any cycles including spreading itself. - * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data. - * - * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles - */ -function NoFragmentCyclesRule(context) { - // Tracks already visited fragments to maintain O(N) and to ensure that cycles - // are not redundantly reported. - const visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors - - const spreadPath = []; // Position in the spread path - - const spreadPathIndexByName = Object.create(null); - return { - OperationDefinition: () => false, - - FragmentDefinition(node) { - detectCycleRecursive(node); - return false; - }, - }; // This does a straight-forward DFS to find cycles. - // It does not terminate when a cycle was found but continues to explore - // the graph to find all possible cycles. - - function detectCycleRecursive(fragment) { - if (visitedFrags[fragment.name.value]) { - return; - } - - const fragmentName = fragment.name.value; - visitedFrags[fragmentName] = true; - const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); - - if (spreadNodes.length === 0) { - return; - } - - spreadPathIndexByName[fragmentName] = spreadPath.length; - - for (const spreadNode of spreadNodes) { - const spreadName = spreadNode.name.value; - const cycleIndex = spreadPathIndexByName[spreadName]; - spreadPath.push(spreadNode); - - if (cycleIndex === undefined) { - const spreadFragment = context.getFragment(spreadName); - - if (spreadFragment) { - detectCycleRecursive(spreadFragment); - } - } else { - const cyclePath = spreadPath.slice(cycleIndex); - const viaPath = cyclePath - .slice(0, -1) - .map((s) => '"' + s.name.value + '"') - .join(', '); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Cannot spread fragment "${spreadName}" within itself` + - (viaPath !== '' ? ` via ${viaPath}.` : '.'), - { - nodes: cyclePath, - }, - ), - ); - } - - spreadPath.pop(); - } - - spreadPathIndexByName[fragmentName] = undefined; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoUndefinedVariablesRule": function() { return /* binding */ NoUndefinedVariablesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * No undefined variables - * - * A GraphQL operation is only valid if all variables encountered, both directly - * and via fragment spreads, are defined by that operation. - * - * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined - */ -function NoUndefinedVariablesRule(context) { - let variableNameDefined = Object.create(null); - return { - OperationDefinition: { - enter() { - variableNameDefined = Object.create(null); - }, - - leave(operation) { - const usages = context.getRecursiveVariableUsages(operation); - - for (const { node } of usages) { - const varName = node.name.value; - - if (variableNameDefined[varName] !== true) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - operation.name - ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` - : `Variable "$${varName}" is not defined.`, - { - nodes: [node, operation], - }, - ), - ); - } - } - }, - }, - - VariableDefinition(node) { - variableNameDefined[node.variable.name.value] = true; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs": -/*!********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs ***! - \********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoUnusedFragmentsRule": function() { return /* binding */ NoUnusedFragmentsRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * No unused fragments - * - * A GraphQL document is only valid if all fragment definitions are spread - * within operations, or spread within other fragments spread within operations. - * - * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used - */ -function NoUnusedFragmentsRule(context) { - const operationDefs = []; - const fragmentDefs = []; - return { - OperationDefinition(node) { - operationDefs.push(node); - return false; - }, - - FragmentDefinition(node) { - fragmentDefs.push(node); - return false; - }, - - Document: { - leave() { - const fragmentNameUsed = Object.create(null); - - for (const operation of operationDefs) { - for (const fragment of context.getRecursivelyReferencedFragments( - operation, - )) { - fragmentNameUsed[fragment.name.value] = true; - } - } - - for (const fragmentDef of fragmentDefs) { - const fragName = fragmentDef.name.value; - - if (fragmentNameUsed[fragName] !== true) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError(`Fragment "${fragName}" is never used.`, { - nodes: fragmentDef, - }), - ); - } - } - }, - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs": -/*!********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs ***! - \********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoUnusedVariablesRule": function() { return /* binding */ NoUnusedVariablesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * No unused variables - * - * A GraphQL operation is only valid if all variables defined by an operation - * are used, either directly or within a spread fragment. - * - * See https://spec.graphql.org/draft/#sec-All-Variables-Used - */ -function NoUnusedVariablesRule(context) { - let variableDefs = []; - return { - OperationDefinition: { - enter() { - variableDefs = []; - }, - - leave(operation) { - const variableNameUsed = Object.create(null); - const usages = context.getRecursiveVariableUsages(operation); - - for (const { node } of usages) { - variableNameUsed[node.name.value] = true; - } - - for (const variableDef of variableDefs) { - const variableName = variableDef.variable.name.value; - - if (variableNameUsed[variableName] !== true) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - operation.name - ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` - : `Variable "$${variableName}" is never used.`, - { - nodes: variableDef, - }, - ), - ); - } - } - }, - }, - - VariableDefinition(def) { - variableDefs.push(def); - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs": -/*!*******************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs ***! - \*******************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "OverlappingFieldsCanBeMergedRule": function() { return /* binding */ OverlappingFieldsCanBeMergedRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_sortValueNode_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utilities/sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - - - - -function reasonMessage(reason) { - if (Array.isArray(reason)) { - return reason - .map( - ([responseName, subReason]) => - `subfields "${responseName}" conflict because ` + - reasonMessage(subReason), - ) - .join(' and '); - } - - return reason; -} -/** - * Overlapping fields can be merged - * - * A selection set is only valid if all fields (including spreading any - * fragments) either correspond to distinct response names or can be merged - * without ambiguity. - * - * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging - */ - -function OverlappingFieldsCanBeMergedRule(context) { - // A memoization for when two fragments are compared "between" each other for - // conflicts. Two fragments may be compared many times, so memoizing this can - // dramatically improve the performance of this validator. - const comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given - // selection set. Selection sets may be asked for this information multiple - // times, so this improves the performance of this validator. - - const cachedFieldsAndFragmentNames = new Map(); - return { - SelectionSet(selectionSet) { - const conflicts = findConflictsWithinSelectionSet( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - context.getParentType(), - selectionSet, - ); - - for (const [[responseName, reason], fields1, fields2] of conflicts) { - const reasonMsg = reasonMessage(reason); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, - { - nodes: fields1.concat(fields2), - }, - ), - ); - } - }, - }; -} - -/** - * Algorithm: - * - * Conflicts occur when two fields exist in a query which will produce the same - * response name, but represent differing values, thus creating a conflict. - * The algorithm below finds all conflicts via making a series of comparisons - * between fields. In order to compare as few fields as possible, this makes - * a series of comparisons "within" sets of fields and "between" sets of fields. - * - * Given any selection set, a collection produces both a set of fields by - * also including all inline fragments, as well as a list of fragments - * referenced by fragment spreads. - * - * A) Each selection set represented in the document first compares "within" its - * collected set of fields, finding any conflicts between every pair of - * overlapping fields. - * Note: This is the *only time* that a the fields "within" a set are compared - * to each other. After this only fields "between" sets are compared. - * - * B) Also, if any fragment is referenced in a selection set, then a - * comparison is made "between" the original set of fields and the - * referenced fragment. - * - * C) Also, if multiple fragments are referenced, then comparisons - * are made "between" each referenced fragment. - * - * D) When comparing "between" a set of fields and a referenced fragment, first - * a comparison is made between each field in the original set of fields and - * each field in the the referenced set of fields. - * - * E) Also, if any fragment is referenced in the referenced selection set, - * then a comparison is made "between" the original set of fields and the - * referenced fragment (recursively referring to step D). - * - * F) When comparing "between" two fragments, first a comparison is made between - * each field in the first referenced set of fields and each field in the the - * second referenced set of fields. - * - * G) Also, any fragments referenced by the first must be compared to the - * second, and any fragments referenced by the second must be compared to the - * first (recursively referring to step F). - * - * H) When comparing two fields, if both have selection sets, then a comparison - * is made "between" both selection sets, first comparing the set of fields in - * the first selection set with the set of fields in the second. - * - * I) Also, if any fragment is referenced in either selection set, then a - * comparison is made "between" the other set of fields and the - * referenced fragment. - * - * J) Also, if two fragments are referenced in both selection sets, then a - * comparison is made "between" the two fragments. - * - */ -// Find all conflicts found "within" a selection set, including those found -// via spreading in fragments. Called when visiting each SelectionSet in the -// GraphQL Document. -function findConflictsWithinSelectionSet( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - parentType, - selectionSet, -) { - const conflicts = []; - const [fieldMap, fragmentNames] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType, - selectionSet, - ); // (A) Find find all conflicts "within" the fields of this selection set. - // Note: this is the *only place* `collectConflictsWithin` is called. - - collectConflictsWithin( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - fieldMap, - ); - - if (fragmentNames.length !== 0) { - // (B) Then collect conflicts between these fields and those represented by - // each spread fragment name found. - for (let i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - false, - fieldMap, - fragmentNames[i], - ); // (C) Then compare this fragment with all other fragments found in this - // selection set to collect conflicts between fragments spread together. - // This compares each item in the list of fragment names to every other - // item in that same list (except for itself). - - for (let j = i + 1; j < fragmentNames.length; j++) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - false, - fragmentNames[i], - fragmentNames[j], - ); - } - } - } - - return conflicts; -} // Collect all conflicts found between a set of fields and a fragment reference -// including via spreading in any nested fragments. - -function collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap, - fragmentName, -) { - const fragment = context.getFragment(fragmentName); - - if (!fragment) { - return; - } - - const [fieldMap2, referencedFragmentNames] = - getReferencedFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragment, - ); // Do not compare a fragment's fieldMap to itself. - - if (fieldMap === fieldMap2) { - return; - } // (D) First collect any conflicts between the provided collection of fields - // and the collection of fields represented by the given fragment. - - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap, - fieldMap2, - ); // (E) Then collect any conflicts between the provided collection of fields - // and any fragment names found in the given fragment. - - for (const referencedFragmentName of referencedFragmentNames) { - // Memoize so two fragments are not compared for conflicts more than once. - if ( - comparedFragmentPairs.has( - referencedFragmentName, - fragmentName, - areMutuallyExclusive, - ) - ) { - continue; - } - - comparedFragmentPairs.add( - referencedFragmentName, - fragmentName, - areMutuallyExclusive, - ); - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap, - referencedFragmentName, - ); - } -} // Collect all conflicts found between two fragments, including via spreading in -// any nested fragments. - -function collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fragmentName1, - fragmentName2, -) { - // No need to compare a fragment to itself. - if (fragmentName1 === fragmentName2) { - return; - } // Memoize so two fragments are not compared for conflicts more than once. - - if ( - comparedFragmentPairs.has( - fragmentName1, - fragmentName2, - areMutuallyExclusive, - ) - ) { - return; - } - - comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); - const fragment1 = context.getFragment(fragmentName1); - const fragment2 = context.getFragment(fragmentName2); - - if (!fragment1 || !fragment2) { - return; - } - - const [fieldMap1, referencedFragmentNames1] = - getReferencedFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragment1, - ); - const [fieldMap2, referencedFragmentNames2] = - getReferencedFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragment2, - ); // (F) First, collect all conflicts between these two collections of fields - // (not including any nested fragments). - - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fieldMap2, - ); // (G) Then collect conflicts between the first fragment and any nested - // fragments spread in the second fragment. - - for (const referencedFragmentName2 of referencedFragmentNames2) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fragmentName1, - referencedFragmentName2, - ); - } // (G) Then collect conflicts between the second fragment and any nested - // fragments spread in the first fragment. - - for (const referencedFragmentName1 of referencedFragmentNames1) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - referencedFragmentName1, - fragmentName2, - ); - } -} // Find all conflicts found between two selection sets, including those found -// via spreading in fragments. Called when determining if conflicts exist -// between the sub-fields of two overlapping fields. - -function findConflictsBetweenSubSelectionSets( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - parentType1, - selectionSet1, - parentType2, - selectionSet2, -) { - const conflicts = []; - const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType1, - selectionSet1, - ); - const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType2, - selectionSet2, - ); // (H) First, collect all conflicts between these two collections of field. - - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fieldMap2, - ); // (I) Then collect conflicts between the first collection of fields and - // those referenced by each fragment name associated with the second. - - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fragmentName2, - ); - } // (I) Then collect conflicts between the second collection of fields and - // those referenced by each fragment name associated with the first. - - for (const fragmentName1 of fragmentNames1) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap2, - fragmentName1, - ); - } // (J) Also collect conflicts between any fragment names by the first and - // fragment names by the second. This compares each item in the first set of - // names to each item in the second set of names. - - for (const fragmentName1 of fragmentNames1) { - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - fragmentName1, - fragmentName2, - ); - } - } - - return conflicts; -} // Collect all Conflicts "within" one collection of fields. - -function collectConflictsWithin( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - fieldMap, -) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For every response name, if there are multiple fields, they - // must be compared to find a potential conflict. - for (const [responseName, fields] of Object.entries(fieldMap)) { - // This compares every field in the list to every other field in this list - // (except to itself). If the list only has one item, nothing needs to - // be compared. - if (fields.length > 1) { - for (let i = 0; i < fields.length; i++) { - for (let j = i + 1; j < fields.length; j++) { - const conflict = findConflict( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - false, // within one collection is never mutually exclusive - responseName, - fields[i], - fields[j], - ); - - if (conflict) { - conflicts.push(conflict); - } - } - } - } - } -} // Collect all Conflicts between two collections of fields. This is similar to, -// but different from the `collectConflictsWithin` function above. This check -// assumes that `collectConflictsWithin` has already been called on each -// provided collection of fields. This is true because this validator traverses -// each individual selection set. - -function collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - parentFieldsAreMutuallyExclusive, - fieldMap1, - fieldMap2, -) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For any response name which appears in both provided field - // maps, each field from the first field map must be compared to every field - // in the second field map to find potential conflicts. - for (const [responseName, fields1] of Object.entries(fieldMap1)) { - const fields2 = fieldMap2[responseName]; - - if (fields2) { - for (const field1 of fields1) { - for (const field2 of fields2) { - const conflict = findConflict( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - parentFieldsAreMutuallyExclusive, - responseName, - field1, - field2, - ); - - if (conflict) { - conflicts.push(conflict); - } - } - } - } - } -} // Determines if there is a conflict between two particular fields, including -// comparing their sub-fields. - -function findConflict( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - parentFieldsAreMutuallyExclusive, - responseName, - field1, - field2, -) { - const [parentType1, node1, def1] = field1; - const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same - // time, due to the parent types, then it is safe to permit them to diverge - // in aliased field or arguments used as they will not present any ambiguity - // by differing. - // It is known that two parent types could never overlap if they are - // different Object types. Interface or Union types might overlap - if not - // in the current state of the schema, then perhaps in some future version, - // thus may not safely diverge. - - const areMutuallyExclusive = - parentFieldsAreMutuallyExclusive || - (parentType1 !== parentType2 && - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectType)(parentType1) && - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectType)(parentType2)); - - if (!areMutuallyExclusive) { - // Two aliases must refer to the same field. - const name1 = node1.name.value; - const name2 = node2.name.value; - - if (name1 !== name2) { - return [ - [responseName, `"${name1}" and "${name2}" are different fields`], - [node1], - [node2], - ]; - } // Two field calls must have the same arguments. - - if (stringifyArguments(node1) !== stringifyArguments(node2)) { - return [ - [responseName, 'they have differing arguments'], - [node1], - [node2], - ]; - } - } // The return type for each field. - - const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type; - const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type; - - if (type1 && type2 && doTypesConflict(type1, type2)) { - return [ - [ - responseName, - `they return conflicting types "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(type1)}" and "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)( - type2, - )}"`, - ], - [node1], - [node2], - ]; - } // Collect and compare sub-fields. Use the same "visited fragment names" list - // for both collections so fields in a fragment reference are never - // compared to themselves. - - const selectionSet1 = node1.selectionSet; - const selectionSet2 = node2.selectionSet; - - if (selectionSet1 && selectionSet2) { - const conflicts = findConflictsBetweenSubSelectionSets( - context, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - areMutuallyExclusive, - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.getNamedType)(type1), - selectionSet1, - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.getNamedType)(type2), - selectionSet2, - ); - return subfieldConflicts(conflicts, responseName, node1, node2); - } -} - -function stringifyArguments(fieldNode) { - var _fieldNode$arguments; - - // FIXME https://github.com/graphql/graphql-js/issues/2203 - const args = - /* c8 ignore next */ - (_fieldNode$arguments = fieldNode.arguments) !== null && - _fieldNode$arguments !== void 0 - ? _fieldNode$arguments - : []; - const inputObjectWithArgs = { - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT, - fields: args.map((argNode) => ({ - kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.OBJECT_FIELD, - name: argNode.name, - value: argNode.value, - })), - }; - return (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_4__.print)((0,_utilities_sortValueNode_mjs__WEBPACK_IMPORTED_MODULE_5__.sortValueNode)(inputObjectWithArgs)); -} // Two types conflict if both types could not apply to a value simultaneously. -// Composite types are ignored as their individual field types will be compared -// later recursively. However List and Non-Null types must match. - -function doTypesConflict(type1, type2) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isListType)(type1)) { - return (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isListType)(type2) - ? doTypesConflict(type1.ofType, type2.ofType) - : true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isListType)(type2)) { - return true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(type1)) { - return (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(type2) - ? doTypesConflict(type1.ofType, type2.ofType) - : true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isNonNullType)(type2)) { - return true; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isLeafType)(type1) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isLeafType)(type2)) { - return type1 !== type2; - } - - return false; -} // Given a selection set, return the collection of fields (a mapping of response -// name to field nodes and definitions) as well as a list of fragment names -// referenced via fragment spreads. - -function getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType, - selectionSet, -) { - const cached = cachedFieldsAndFragmentNames.get(selectionSet); - - if (cached) { - return cached; - } - - const nodeAndDefs = Object.create(null); - const fragmentNames = Object.create(null); - - _collectFieldsAndFragmentNames( - context, - parentType, - selectionSet, - nodeAndDefs, - fragmentNames, - ); - - const result = [nodeAndDefs, Object.keys(fragmentNames)]; - cachedFieldsAndFragmentNames.set(selectionSet, result); - return result; -} // Given a reference to a fragment, return the represented collection of fields -// as well as a list of nested fragment names referenced via fragment spreads. - -function getReferencedFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragment, -) { - // Short-circuit building a type from the node if possible. - const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); - - if (cached) { - return cached; - } - - const fragmentType = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_6__.typeFromAST)(context.getSchema(), fragment.typeCondition); - return getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragmentType, - fragment.selectionSet, - ); -} - -function _collectFieldsAndFragmentNames( - context, - parentType, - selectionSet, - nodeAndDefs, - fragmentNames, -) { - for (const selection of selectionSet.selections) { - switch (selection.kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FIELD: { - const fieldName = selection.name.value; - let fieldDef; - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectType)(parentType) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isInterfaceType)(parentType)) { - fieldDef = parentType.getFields()[fieldName]; - } - - const responseName = selection.alias - ? selection.alias.value - : fieldName; - - if (!nodeAndDefs[responseName]) { - nodeAndDefs[responseName] = []; - } - - nodeAndDefs[responseName].push([parentType, selection, fieldDef]); - break; - } - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.FRAGMENT_SPREAD: - fragmentNames[selection.name.value] = true; - break; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__.Kind.INLINE_FRAGMENT: { - const typeCondition = selection.typeCondition; - const inlineFragmentType = typeCondition - ? (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_6__.typeFromAST)(context.getSchema(), typeCondition) - : parentType; - - _collectFieldsAndFragmentNames( - context, - inlineFragmentType, - selection.selectionSet, - nodeAndDefs, - fragmentNames, - ); - - break; - } - } - } -} // Given a series of Conflicts which occurred between two sub-fields, generate -// a single Conflict. - -function subfieldConflicts(conflicts, responseName, node1, node2) { - if (conflicts.length > 0) { - return [ - [responseName, conflicts.map(([reason]) => reason)], - [node1, ...conflicts.map(([, fields1]) => fields1).flat()], - [node2, ...conflicts.map(([, , fields2]) => fields2).flat()], - ]; - } -} -/** - * A way to keep track of pairs of things when the ordering of the pair does not matter. - */ - -class PairSet { - constructor() { - this._data = new Map(); - } - - has(a, b, areMutuallyExclusive) { - var _this$_data$get; - - const [key1, key2] = a < b ? [a, b] : [b, a]; - const result = - (_this$_data$get = this._data.get(key1)) === null || - _this$_data$get === void 0 - ? void 0 - : _this$_data$get.get(key2); - - if (result === undefined) { - return false; - } // areMutuallyExclusive being false is a superset of being true, hence if - // we want to know if this PairSet "has" these two with no exclusivity, - // we have to ensure it was added as such. - - return areMutuallyExclusive ? true : areMutuallyExclusive === result; - } - - add(a, b, areMutuallyExclusive) { - const [key1, key2] = a < b ? [a, b] : [b, a]; - - const map = this._data.get(key1); - - if (map === undefined) { - this._data.set(key1, new Map([[key2, areMutuallyExclusive]])); - } else { - map.set(key2, areMutuallyExclusive); - } - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs": -/*!**************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs ***! - \**************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PossibleFragmentSpreadsRule": function() { return /* binding */ PossibleFragmentSpreadsRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - - -/** - * Possible fragment spread - * - * A fragment spread is only valid if the type condition could ever possibly - * be true: if there is a non-empty intersection of the possible parent types, - * and possible types which pass the type condition. - */ -function PossibleFragmentSpreadsRule(context) { - return { - InlineFragment(node) { - const fragType = context.getType(); - const parentType = context.getParentType(); - - if ( - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(fragType) && - (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(parentType) && - !(0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_1__.doTypesOverlap)(context.getSchema(), fragType, parentType) - ) { - const parentTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(parentType); - const fragTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(fragType); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, - { - nodes: node, - }, - ), - ); - } - }, - - FragmentSpread(node) { - const fragName = node.name.value; - const fragType = getFragmentType(context, fragName); - const parentType = context.getParentType(); - - if ( - fragType && - parentType && - !(0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_1__.doTypesOverlap)(context.getSchema(), fragType, parentType) - ) { - const parentTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(parentType); - const fragTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(fragType); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, - { - nodes: node, - }, - ), - ); - } - }, - }; -} - -function getFragmentType(context, name) { - const frag = context.getFragment(name); - - if (frag) { - const type = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_4__.typeFromAST)(context.getSchema(), frag.typeCondition); - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isCompositeType)(type)) { - return type; - } - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PossibleTypeExtensionsRule": function() { return /* binding */ PossibleTypeExtensionsRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - - - - - -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -function PossibleTypeExtensionsRule(context) { - const schema = context.getSchema(); - const definedTypes = Object.create(null); - - for (const def of context.getDocument().definitions) { - if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = def; - } - } - - return { - ScalarTypeExtension: checkExtension, - ObjectTypeExtension: checkExtension, - InterfaceTypeExtension: checkExtension, - UnionTypeExtension: checkExtension, - EnumTypeExtension: checkExtension, - InputObjectTypeExtension: checkExtension, - }; - - function checkExtension(node) { - const typeName = node.name.value; - const defNode = definedTypes[typeName]; - const existingType = - schema === null || schema === void 0 ? void 0 : schema.getType(typeName); - let expectedKind; - - if (defNode) { - expectedKind = defKindToExtKind[defNode.kind]; - } else if (existingType) { - expectedKind = typeToExtKind(existingType); - } - - if (expectedKind) { - if (expectedKind !== node.kind) { - const kindStr = extensionKindToTypeName(node.kind); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, { - nodes: defNode ? [defNode, node] : node, - }), - ); - } - } else { - const allTypeNames = Object.keys({ - ...definedTypes, - ...(schema === null || schema === void 0 - ? void 0 - : schema.getTypeMap()), - }); - const suggestedTypes = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_2__.suggestionList)(typeName, allTypeNames); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Cannot extend type "${typeName}" because it is not defined.` + - (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__.didYouMean)(suggestedTypes), - { - nodes: node.name, - }, - ), - ); - } - } -} -const defKindToExtKind = { - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.SCALAR_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.SCALAR_TYPE_EXTENSION, - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.OBJECT_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.OBJECT_TYPE_EXTENSION, - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INTERFACE_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INTERFACE_TYPE_EXTENSION, - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.UNION_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.UNION_TYPE_EXTENSION, - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.ENUM_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.ENUM_TYPE_EXTENSION, - [_language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INPUT_OBJECT_TYPE_DEFINITION]: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INPUT_OBJECT_TYPE_EXTENSION, -}; - -function typeToExtKind(type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isScalarType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.SCALAR_TYPE_EXTENSION; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isObjectType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.OBJECT_TYPE_EXTENSION; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isInterfaceType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INTERFACE_TYPE_EXTENSION; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isUnionType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.UNION_TYPE_EXTENSION; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isEnumType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.ENUM_TYPE_EXTENSION; - } - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__.isInputObjectType)(type)) { - return _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INPUT_OBJECT_TYPE_EXTENSION; - } - /* c8 ignore next 3 */ - // Not reachable. All possible types have been considered - - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_6__.invariant)(false, 'Unexpected type: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_7__.inspect)(type)); -} - -function extensionKindToTypeName(kind) { - switch (kind) { - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.SCALAR_TYPE_EXTENSION: - return 'scalar'; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.OBJECT_TYPE_EXTENSION: - return 'object'; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INTERFACE_TYPE_EXTENSION: - return 'interface'; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.UNION_TYPE_EXTENSION: - return 'union'; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.ENUM_TYPE_EXTENSION: - return 'enum'; - - case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.INPUT_OBJECT_TYPE_EXTENSION: - return 'input object'; - // Not reachable. All possible types have been considered - - /* c8 ignore next */ - - default: - false || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_6__.invariant)(false, 'Unexpected kind: ' + (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_7__.inspect)(kind)); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ProvidedRequiredArgumentsOnDirectivesRule": function() { return /* binding */ ProvidedRequiredArgumentsOnDirectivesRule; }, -/* harmony export */ "ProvidedRequiredArgumentsRule": function() { return /* binding */ ProvidedRequiredArgumentsRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); - - - - - - - - -/** - * Provided required arguments - * - * A field or directive is only valid if all required (non-null without a - * default value) field arguments have been provided. - */ -function ProvidedRequiredArgumentsRule(context) { - return { - // eslint-disable-next-line new-cap - ...ProvidedRequiredArgumentsOnDirectivesRule(context), - Field: { - // Validate on leave to allow for deeper errors to appear first. - leave(fieldNode) { - var _fieldNode$arguments; - - const fieldDef = context.getFieldDef(); - - if (!fieldDef) { - return false; - } - - const providedArgs = new Set( // FIXME: https://github.com/graphql/graphql-js/issues/2203 - /* c8 ignore next */ - (_fieldNode$arguments = fieldNode.arguments) === null || - _fieldNode$arguments === void 0 - ? void 0 - : _fieldNode$arguments.map((arg) => arg.name.value), - ); - - for (const argDef of fieldDef.args) { - if (!providedArgs.has(argDef.name) && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredArgument)(argDef)) { - const argTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(argDef.type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, - { - nodes: fieldNode, - }, - ), - ); - } - } - }, - }, - }; -} -/** - * @internal - */ - -function ProvidedRequiredArgumentsOnDirectivesRule(context) { - var _schema$getDirectives; - - const requiredArgsMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = - (_schema$getDirectives = - schema === null || schema === void 0 - ? void 0 - : schema.getDirectives()) !== null && _schema$getDirectives !== void 0 - ? _schema$getDirectives - : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__.specifiedDirectives; - - for (const directive of definedDirectives) { - requiredArgsMap[directive.name] = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_4__.keyMap)( - directive.args.filter(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredArgument), - (arg) => arg.name, - ); - } - - const astDefinitions = context.getDocument().definitions; - - for (const def of astDefinitions) { - if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_5__.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argNodes = - (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 - ? _def$arguments - : []; - requiredArgsMap[def.name.value] = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_4__.keyMap)( - argNodes.filter(isRequiredArgumentNode), - (arg) => arg.name.value, - ); - } - } - - return { - Directive: { - // Validate on leave to allow for deeper errors to appear first. - leave(directiveNode) { - const directiveName = directiveNode.name.value; - const requiredArgs = requiredArgsMap[directiveName]; - - if (requiredArgs) { - var _directiveNode$argume; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argNodes = - (_directiveNode$argume = directiveNode.arguments) !== null && - _directiveNode$argume !== void 0 - ? _directiveNode$argume - : []; - const argNodeMap = new Set(argNodes.map((arg) => arg.name.value)); - - for (const [argName, argDef] of Object.entries(requiredArgs)) { - if (!argNodeMap.has(argName)) { - const argType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isType)(argDef.type) - ? (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(argDef.type) - : (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(argDef.type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`, - { - nodes: directiveNode, - }, - ), - ); - } - } - } - }, - }, - }; -} - -function isRequiredArgumentNode(arg) { - return arg.type.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_5__.Kind.NON_NULL_TYPE && arg.defaultValue == null; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs": -/*!**************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs ***! - \**************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ScalarLeafsRule": function() { return /* binding */ ScalarLeafsRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - -/** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. - */ -function ScalarLeafsRule(context) { - return { - Field(node) { - const type = context.getType(); - const selectionSet = node.selectionSet; - - if (type) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isLeafType)((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(type))) { - if (selectionSet) { - const fieldName = node.name.value; - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, - { - nodes: selectionSet, - }, - ), - ); - } - } else if (!selectionSet) { - const fieldName = node.name.value; - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, - { - nodes: node, - }, - ), - ); - } - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs": -/*!***************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs ***! - \***************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "SingleFieldSubscriptionsRule": function() { return /* binding */ SingleFieldSubscriptionsRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _execution_collectFields_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../execution/collectFields.mjs */ "../../../node_modules/graphql/execution/collectFields.mjs"); - - - - -/** - * Subscriptions must only include a non-introspection field. - * - * A GraphQL subscription is valid only if it contains a single root field and - * that root field is not an introspection field. - * - * See https://spec.graphql.org/draft/#sec-Single-root-field - */ -function SingleFieldSubscriptionsRule(context) { - return { - OperationDefinition(node) { - if (node.operation === 'subscription') { - const schema = context.getSchema(); - const subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType) { - const operationName = node.name ? node.name.value : null; - const variableValues = Object.create(null); - const document = context.getDocument(); - const fragments = Object.create(null); - - for (const definition of document.definitions) { - if (definition.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_0__.Kind.FRAGMENT_DEFINITION) { - fragments[definition.name.value] = definition; - } - } - - const fields = (0,_execution_collectFields_mjs__WEBPACK_IMPORTED_MODULE_1__.collectFields)( - schema, - fragments, - variableValues, - subscriptionType, - node.selectionSet, - ); - - if (fields.size > 1) { - const fieldSelectionLists = [...fields.values()]; - const extraFieldSelectionLists = fieldSelectionLists.slice(1); - const extraFieldSelections = extraFieldSelectionLists.flat(); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - operationName != null - ? `Subscription "${operationName}" must select only one top level field.` - : 'Anonymous Subscription must select only one top level field.', - { - nodes: extraFieldSelections, - }, - ), - ); - } - - for (const fieldNodes of fields.values()) { - const field = fieldNodes[0]; - const fieldName = field.name.value; - - if (fieldName.startsWith('__')) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - operationName != null - ? `Subscription "${operationName}" must not select an introspection top level field.` - : 'Anonymous Subscription must not select an introspection top level field.', - { - nodes: fieldNodes, - }, - ), - ); - } - } - } - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs": -/*!********************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs ***! - \********************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueArgumentDefinitionNamesRule": function() { return /* binding */ UniqueArgumentDefinitionNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - - -/** - * Unique argument definition names - * - * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments. - * A GraphQL Directive is only valid if all its arguments are uniquely named. - */ -function UniqueArgumentDefinitionNamesRule(context) { - return { - DirectiveDefinition(directiveNode) { - var _directiveNode$argume; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argumentNodes = - (_directiveNode$argume = directiveNode.arguments) !== null && - _directiveNode$argume !== void 0 - ? _directiveNode$argume - : []; - return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes); - }, - - InterfaceTypeDefinition: checkArgUniquenessPerField, - InterfaceTypeExtension: checkArgUniquenessPerField, - ObjectTypeDefinition: checkArgUniquenessPerField, - ObjectTypeExtension: checkArgUniquenessPerField, - }; - - function checkArgUniquenessPerField(typeNode) { - var _typeNode$fields; - - const typeName = typeNode.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const fieldNodes = - (_typeNode$fields = typeNode.fields) !== null && - _typeNode$fields !== void 0 - ? _typeNode$fields - : []; - - for (const fieldDef of fieldNodes) { - var _fieldDef$arguments; - - const fieldName = fieldDef.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const argumentNodes = - (_fieldDef$arguments = fieldDef.arguments) !== null && - _fieldDef$arguments !== void 0 - ? _fieldDef$arguments - : []; - checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes); - } - - return false; - } - - function checkArgUniqueness(parentName, argumentNodes) { - const seenArgs = (0,_jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__.groupBy)(argumentNodes, (arg) => arg.name.value); - - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Argument "${parentName}(${argName}:)" can only be defined once.`, - { - nodes: argNodes.map((node) => node.name), - }, - ), - ); - } - } - - return false; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueArgumentNamesRule": function() { return /* binding */ UniqueArgumentNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - - -/** - * Unique argument names - * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. - * - * See https://spec.graphql.org/draft/#sec-Argument-Names - */ -function UniqueArgumentNamesRule(context) { - return { - Field: checkArgUniqueness, - Directive: checkArgUniqueness, - }; - - function checkArgUniqueness(parentNode) { - var _parentNode$arguments; - - // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const argumentNodes = - (_parentNode$arguments = parentNode.arguments) !== null && - _parentNode$arguments !== void 0 - ? _parentNode$arguments - : []; - const seenArgs = (0,_jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__.groupBy)(argumentNodes, (arg) => arg.name.value); - - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `There can be only one argument named "${argName}".`, - { - nodes: argNodes.map((node) => node.name), - }, - ), - ); - } - } - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueDirectiveNamesRule": function() { return /* binding */ UniqueDirectiveNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -function UniqueDirectiveNamesRule(context) { - const knownDirectiveNames = Object.create(null); - const schema = context.getSchema(); - return { - DirectiveDefinition(node) { - const directiveName = node.name.value; - - if ( - schema !== null && - schema !== void 0 && - schema.getDirective(directiveName) - ) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, - { - nodes: node.name, - }, - ), - ); - return; - } - - if (knownDirectiveNames[directiveName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `There can be only one directive named "@${directiveName}".`, - { - nodes: [knownDirectiveNames[directiveName], node.name], - }, - ), - ); - } else { - knownDirectiveNames[directiveName] = node.name; - } - - return false; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs": -/*!******************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs ***! - \******************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueDirectivesPerLocationRule": function() { return /* binding */ UniqueDirectivesPerLocationRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../language/predicates.mjs */ "../../../node_modules/graphql/language/predicates.mjs"); -/* harmony import */ var _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/directives.mjs */ "../../../node_modules/graphql/type/directives.mjs"); - - - - - -/** - * Unique directive names per location - * - * A GraphQL document is only valid if all non-repeatable directives at - * a given location are uniquely named. - * - * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location - */ -function UniqueDirectivesPerLocationRule(context) { - const uniqueDirectiveMap = Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema - ? schema.getDirectives() - : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_0__.specifiedDirectives; - - for (const directive of definedDirectives) { - uniqueDirectiveMap[directive.name] = !directive.isRepeatable; - } - - const astDefinitions = context.getDocument().definitions; - - for (const def of astDefinitions) { - if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.DIRECTIVE_DEFINITION) { - uniqueDirectiveMap[def.name.value] = !def.repeatable; - } - } - - const schemaDirectives = Object.create(null); - const typeDirectivesMap = Object.create(null); - return { - // Many different AST nodes may contain directives. Rather than listing - // them all, just listen for entering any node, and check to see if it - // defines any directives. - enter(node) { - if (!('directives' in node) || !node.directives) { - return; - } - - let seenDirectives; - - if ( - node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_DEFINITION || - node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__.Kind.SCHEMA_EXTENSION - ) { - seenDirectives = schemaDirectives; - } else if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__.isTypeDefinitionNode)(node) || (0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__.isTypeExtensionNode)(node)) { - const typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - - if (seenDirectives === undefined) { - typeDirectivesMap[typeName] = seenDirectives = Object.create(null); - } - } else { - seenDirectives = Object.create(null); - } - - for (const directive of node.directives) { - const directiveName = directive.name.value; - - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `The directive "@${directiveName}" can only be used once at this location.`, - { - nodes: [seenDirectives[directiveName], directive], - }, - ), - ); - } else { - seenDirectives[directiveName] = directive; - } - } - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueEnumValueNamesRule": function() { return /* binding */ UniqueEnumValueNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -function UniqueEnumValueNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); - const knownValueNames = Object.create(null); - return { - EnumTypeDefinition: checkValueUniqueness, - EnumTypeExtension: checkValueUniqueness, - }; - - function checkValueUniqueness(node) { - var _node$values; - - const typeName = node.name.value; - - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = Object.create(null); - } // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const valueNodes = - (_node$values = node.values) !== null && _node$values !== void 0 - ? _node$values - : []; - const valueNames = knownValueNames[typeName]; - - for (const valueDef of valueNodes) { - const valueName = valueDef.name.value; - const existingType = existingTypeMap[typeName]; - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isEnumType)(existingType) && existingType.getValue(valueName)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, - { - nodes: valueDef.name, - }, - ), - ); - } else if (valueNames[valueName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Enum value "${typeName}.${valueName}" can only be defined once.`, - { - nodes: [valueNames[valueName], valueDef.name], - }, - ), - ); - } else { - valueNames[valueName] = valueDef.name; - } - } - - return false; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs": -/*!*****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs ***! - \*****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueFieldDefinitionNamesRule": function() { return /* binding */ UniqueFieldDefinitionNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -function UniqueFieldDefinitionNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); - const knownFieldNames = Object.create(null); - return { - InputObjectTypeDefinition: checkFieldUniqueness, - InputObjectTypeExtension: checkFieldUniqueness, - InterfaceTypeDefinition: checkFieldUniqueness, - InterfaceTypeExtension: checkFieldUniqueness, - ObjectTypeDefinition: checkFieldUniqueness, - ObjectTypeExtension: checkFieldUniqueness, - }; - - function checkFieldUniqueness(node) { - var _node$fields; - - const typeName = node.name.value; - - if (!knownFieldNames[typeName]) { - knownFieldNames[typeName] = Object.create(null); - } // FIXME: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - - const fieldNodes = - (_node$fields = node.fields) !== null && _node$fields !== void 0 - ? _node$fields - : []; - const fieldNames = knownFieldNames[typeName]; - - for (const fieldDef of fieldNodes) { - const fieldName = fieldDef.name.value; - - if (hasField(existingTypeMap[typeName], fieldName)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, - { - nodes: fieldDef.name, - }, - ), - ); - } else if (fieldNames[fieldName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Field "${typeName}.${fieldName}" can only be defined once.`, - { - nodes: [fieldNames[fieldName], fieldDef.name], - }, - ), - ); - } else { - fieldNames[fieldName] = fieldDef.name; - } - } - - return false; - } -} - -function hasField(type, fieldName) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isObjectType)(type) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isInterfaceType)(type) || (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isInputObjectType)(type)) { - return type.getFields()[fieldName] != null; - } - - return false; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueFragmentNamesRule": function() { return /* binding */ UniqueFragmentNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - * - * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness - */ -function UniqueFragmentNamesRule(context) { - const knownFragmentNames = Object.create(null); - return { - OperationDefinition: () => false, - - FragmentDefinition(node) { - const fragmentName = node.name.value; - - if (knownFragmentNames[fragmentName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `There can be only one fragment named "${fragmentName}".`, - { - nodes: [knownFragmentNames[fragmentName], node.name], - }, - ), - ); - } else { - knownFragmentNames[fragmentName] = node.name; - } - - return false; - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs": -/*!************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs ***! - \************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueInputFieldNamesRule": function() { return /* binding */ UniqueInputFieldNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - - -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - * - * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness - */ -function UniqueInputFieldNamesRule(context) { - const knownNameStack = []; - let knownNames = Object.create(null); - return { - ObjectValue: { - enter() { - knownNameStack.push(knownNames); - knownNames = Object.create(null); - }, - - leave() { - const prevKnownNames = knownNameStack.pop(); - prevKnownNames || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.invariant)(false); - knownNames = prevKnownNames; - }, - }, - - ObjectField(node) { - const fieldName = node.name.value; - - if (knownNames[fieldName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `There can be only one input field named "${fieldName}".`, - { - nodes: [knownNames[fieldName], node.name], - }, - ), - ); - } else { - knownNames[fieldName] = node.name; - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueOperationNamesRule": function() { return /* binding */ UniqueOperationNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - * - * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness - */ -function UniqueOperationNamesRule(context) { - const knownOperationNames = Object.create(null); - return { - OperationDefinition(node) { - const operationName = node.name; - - if (operationName) { - if (knownOperationNames[operationName.value]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `There can be only one operation named "${operationName.value}".`, - { - nodes: [ - knownOperationNames[operationName.value], - operationName, - ], - }, - ), - ); - } else { - knownOperationNames[operationName.value] = operationName; - } - } - - return false; - }, - - FragmentDefinition: () => false, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs": -/*!***********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueOperationTypesRule": function() { return /* binding */ UniqueOperationTypesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -function UniqueOperationTypesRule(context) { - const schema = context.getSchema(); - const definedOperationTypes = Object.create(null); - const existingOperationTypes = schema - ? { - query: schema.getQueryType(), - mutation: schema.getMutationType(), - subscription: schema.getSubscriptionType(), - } - : {}; - return { - SchemaDefinition: checkOperationTypes, - SchemaExtension: checkOperationTypes, - }; - - function checkOperationTypes(node) { - var _node$operationTypes; - - // See: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const operationTypesNodes = - (_node$operationTypes = node.operationTypes) !== null && - _node$operationTypes !== void 0 - ? _node$operationTypes - : []; - - for (const operationType of operationTypesNodes) { - const operation = operationType.operation; - const alreadyDefinedOperationType = definedOperationTypes[operation]; - - if (existingOperationTypes[operation]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Type for ${operation} already defined in the schema. It cannot be redefined.`, - { - nodes: operationType, - }, - ), - ); - } else if (alreadyDefinedOperationType) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `There can be only one ${operation} type in schema.`, - { - nodes: [alreadyDefinedOperationType, operationType], - }, - ), - ); - } else { - definedOperationTypes[operation] = operationType; - } - } - - return false; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs": -/*!******************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs ***! - \******************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueTypeNamesRule": function() { return /* binding */ UniqueTypeNamesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -function UniqueTypeNamesRule(context) { - const knownTypeNames = Object.create(null); - const schema = context.getSchema(); - return { - ScalarTypeDefinition: checkTypeName, - ObjectTypeDefinition: checkTypeName, - InterfaceTypeDefinition: checkTypeName, - UnionTypeDefinition: checkTypeName, - EnumTypeDefinition: checkTypeName, - InputObjectTypeDefinition: checkTypeName, - }; - - function checkTypeName(node) { - const typeName = node.name.value; - - if (schema !== null && schema !== void 0 && schema.getType(typeName)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError( - `Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, - { - nodes: node.name, - }, - ), - ); - return; - } - - if (knownTypeNames[typeName]) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__.GraphQLError(`There can be only one type named "${typeName}".`, { - nodes: [knownTypeNames[typeName], node.name], - }), - ); - } else { - knownTypeNames[typeName] = node.name; - } - - return false; - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UniqueVariableNamesRule": function() { return /* binding */ UniqueVariableNamesRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsutils/groupBy.mjs */ "../../../node_modules/graphql/jsutils/groupBy.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); - - - -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -function UniqueVariableNamesRule(context) { - return { - OperationDefinition(operationNode) { - var _operationNode$variab; - - // See: https://github.com/graphql/graphql-js/issues/2203 - - /* c8 ignore next */ - const variableDefinitions = - (_operationNode$variab = operationNode.variableDefinitions) !== null && - _operationNode$variab !== void 0 - ? _operationNode$variab - : []; - const seenVariableDefinitions = (0,_jsutils_groupBy_mjs__WEBPACK_IMPORTED_MODULE_0__.groupBy)( - variableDefinitions, - (node) => node.variable.name.value, - ); - - for (const [variableName, variableNodes] of seenVariableDefinitions) { - if (variableNodes.length > 1) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `There can be only one variable named "$${variableName}".`, - { - nodes: variableNodes.map((node) => node.variable.name), - }, - ), - ); - } - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs": -/*!**********************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs ***! - \**********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ValuesOfCorrectTypeRule": function() { return /* binding */ ValuesOfCorrectTypeRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../jsutils/didYouMean.mjs */ "../../../node_modules/graphql/jsutils/didYouMean.mjs"); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsutils/keyMap.mjs */ "../../../node_modules/graphql/jsutils/keyMap.mjs"); -/* harmony import */ var _jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../jsutils/suggestionList.mjs */ "../../../node_modules/graphql/jsutils/suggestionList.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - - - - - -/** - * Value literals of correct type - * - * A GraphQL document is only valid if all value literals are of the type - * expected at their position. - * - * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type - */ -function ValuesOfCorrectTypeRule(context) { - return { - ListValue(node) { - // Note: TypeInfo will traverse into a list's item type, so look to the - // parent input type to check if it is a list. - const type = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNullableType)(context.getParentInputType()); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isListType)(type)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } - }, - - ObjectValue(node) { - const type = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(context.getInputType()); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(type)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } // Ensure every required field exists. - - const fieldNodeMap = (0,_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__.keyMap)(node.fields, (field) => field.name.value); - - for (const fieldDef of Object.values(type.getFields())) { - const fieldNode = fieldNodeMap[fieldDef.name]; - - if (!fieldNode && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isRequiredInputField)(fieldDef)) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(fieldDef.type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, - { - nodes: node, - }, - ), - ); - } - } - }, - - ObjectField(node) { - const parentType = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(context.getParentInputType()); - const fieldType = context.getInputType(); - - if (!fieldType && (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isInputObjectType)(parentType)) { - const suggestions = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__.suggestionList)( - node.name.value, - Object.keys(parentType.getFields()), - ); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Field "${node.name.value}" is not defined by type "${parentType.name}".` + - (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_5__.didYouMean)(suggestions), - { - nodes: node, - }, - ), - ); - } - }, - - NullValue(node) { - const type = context.getInputType(); - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isNonNullType)(type)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Expected value of type "${(0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(type)}", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}.`, - { - nodes: node, - }, - ), - ); - } - }, - - EnumValue: (node) => isValidValueNode(context, node), - IntValue: (node) => isValidValueNode(context, node), - FloatValue: (node) => isValidValueNode(context, node), - StringValue: (node) => isValidValueNode(context, node), - BooleanValue: (node) => isValidValueNode(context, node), - }; -} -/** - * Any value literal may be a valid representation of a Scalar, depending on - * that scalar type. - */ - -function isValidValueNode(context, node) { - // Report any error at the full type expected by the location. - const locationType = context.getInputType(); - - if (!locationType) { - return; - } - - const type = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(locationType); - - if (!(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.isLeafType)(type)) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Expected value of type "${typeStr}", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}.`, - { - nodes: node, - }, - ), - ); - return; - } // Scalars and Enums determine if a literal value is valid via parseLiteral(), - // which may throw or return an invalid value to indicate failure. - - try { - const parseResult = type.parseLiteral( - node, - undefined, - /* variables */ - ); - - if (parseResult === undefined) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Expected value of type "${typeStr}", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}.`, - { - nodes: node, - }, - ), - ); - } - } catch (error) { - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__.inspect)(locationType); - - if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError) { - context.reportError(error); - } else { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Expected value of type "${typeStr}", found ${(0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__.print)(node)}; ` + - error.message, - { - nodes: node, - originalError: error, - }, - ), - ); - } - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs": -/*!*************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs ***! - \*************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "VariablesAreInputTypesRule": function() { return /* binding */ VariablesAreInputTypesRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_printer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../language/printer.mjs */ "../../../node_modules/graphql/language/printer.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - -/** - * Variables are input types - * - * A GraphQL operation is only valid if all the variables it defines are of - * input types (scalar, enum, or input object). - * - * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types - */ -function VariablesAreInputTypesRule(context) { - return { - VariableDefinition(node) { - const type = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__.typeFromAST)(context.getSchema(), node.type); - - if (type !== undefined && !(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_1__.isInputType)(type)) { - const variableName = node.variable.name.value; - const typeName = (0,_language_printer_mjs__WEBPACK_IMPORTED_MODULE_2__.print)(node.type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_3__.GraphQLError( - `Variable "$${variableName}" cannot be non-input type "${typeName}".`, - { - nodes: node.type, - }, - ), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs": -/*!*****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs ***! - \*****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "VariablesInAllowedPositionRule": function() { return /* binding */ VariablesInAllowedPositionRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsutils/inspect.mjs */ "../../../node_modules/graphql/jsutils/inspect.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../language/kinds.mjs */ "../../../node_modules/graphql/language/kinds.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utilities/typeComparators.mjs */ "../../../node_modules/graphql/utilities/typeComparators.mjs"); -/* harmony import */ var _utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/typeFromAST.mjs */ "../../../node_modules/graphql/utilities/typeFromAST.mjs"); - - - - - - - -/** - * Variables in allowed position - * - * Variable usages must be compatible with the arguments they are passed to. - * - * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed - */ -function VariablesInAllowedPositionRule(context) { - let varDefMap = Object.create(null); - return { - OperationDefinition: { - enter() { - varDefMap = Object.create(null); - }, - - leave(operation) { - const usages = context.getRecursiveVariableUsages(operation); - - for (const { node, type, defaultValue } of usages) { - const varName = node.name.value; - const varDef = varDefMap[varName]; - - if (varDef && type) { - // A var type is allowed if it is the same or more strict (e.g. is - // a subtype of) than the expected type. It can be more strict if - // the variable type is non-null when the expected type is nullable. - // If both are list types, the variable item type can be more strict - // than the expected item type (contravariant). - const schema = context.getSchema(); - const varType = (0,_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_0__.typeFromAST)(schema, varDef.type); - - if ( - varType && - !allowedVariableUsage( - schema, - varType, - varDef.defaultValue, - type, - defaultValue, - ) - ) { - const varTypeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(varType); - const typeStr = (0,_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__.inspect)(type); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, - { - nodes: [varDef, node], - }, - ), - ); - } - } - } - }, - }, - - VariableDefinition(node) { - varDefMap[node.variable.name.value] = node; - }, - }; -} -/** - * Returns true if the variable is allowed in the location it was found, - * which includes considering if default values exist for either the variable - * or the location at which it is located. - */ - -function allowedVariableUsage( - schema, - varType, - varDefaultValue, - locationType, - locationDefaultValue, -) { - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isNonNullType)(locationType) && !(0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__.isNonNullType)(varType)) { - const hasNonNullVariableDefaultValue = - varDefaultValue != null && varDefaultValue.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__.Kind.NULL; - const hasLocationDefaultValue = locationDefaultValue !== undefined; - - if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { - return false; - } - - const nullableLocationType = locationType.ofType; - return (0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__.isTypeSubTypeOf)(schema, varType, nullableLocationType); - } - - return (0,_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__.isTypeSubTypeOf)(schema, varType, locationType); -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs": -/*!****************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoDeprecatedCustomRule": function() { return /* binding */ NoDeprecatedCustomRule; } -/* harmony export */ }); -/* harmony import */ var _jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../jsutils/invariant.mjs */ "../../../node_modules/graphql/jsutils/invariant.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); - - - - -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -function NoDeprecatedCustomRule(context) { - return { - Field(node) { - const fieldDef = context.getFieldDef(); - const deprecationReason = - fieldDef === null || fieldDef === void 0 - ? void 0 - : fieldDef.deprecationReason; - - if (fieldDef && deprecationReason != null) { - const parentType = context.getParentType(); - parentType != null || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.invariant)(false); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`, - { - nodes: node, - }, - ), - ); - } - }, - - Argument(node) { - const argDef = context.getArgument(); - const deprecationReason = - argDef === null || argDef === void 0 - ? void 0 - : argDef.deprecationReason; - - if (argDef && deprecationReason != null) { - const directiveDef = context.getDirective(); - - if (directiveDef != null) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, - { - nodes: node, - }, - ), - ); - } else { - const parentType = context.getParentType(); - const fieldDef = context.getFieldDef(); - (parentType != null && fieldDef != null) || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.invariant)(false); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, - { - nodes: node, - }, - ), - ); - } - } - }, - - ObjectField(node) { - const inputObjectDef = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.getNamedType)(context.getParentInputType()); - - if ((0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.isInputObjectType)(inputObjectDef)) { - const inputFieldDef = inputObjectDef.getFields()[node.name.value]; - const deprecationReason = - inputFieldDef === null || inputFieldDef === void 0 - ? void 0 - : inputFieldDef.deprecationReason; - - if (deprecationReason != null) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`, - { - nodes: node, - }, - ), - ); - } - } - }, - - EnumValue(node) { - const enumValueDef = context.getEnumValue(); - const deprecationReason = - enumValueDef === null || enumValueDef === void 0 - ? void 0 - : enumValueDef.deprecationReason; - - if (enumValueDef && deprecationReason != null) { - const enumTypeDef = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__.getNamedType)(context.getInputType()); - enumTypeDef != null || (0,_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__.invariant)(false); - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError( - `The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, - { - nodes: node, - }, - ), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs": -/*!*************************************************************************************************!*\ - !*** ../../../node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs ***! - \*************************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NoSchemaIntrospectionCustomRule": function() { return /* binding */ NoSchemaIntrospectionCustomRule; } -/* harmony export */ }); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../type/definition.mjs */ "../../../node_modules/graphql/type/definition.mjs"); -/* harmony import */ var _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../type/introspection.mjs */ "../../../node_modules/graphql/type/introspection.mjs"); - - - - -/** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. - */ -function NoSchemaIntrospectionCustomRule(context) { - return { - Field(node) { - const type = (0,_type_definition_mjs__WEBPACK_IMPORTED_MODULE_0__.getNamedType)(context.getType()); - - if (type && (0,_type_introspection_mjs__WEBPACK_IMPORTED_MODULE_1__.isIntrospectionType)(type)) { - context.reportError( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__.GraphQLError( - `GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, - { - nodes: node, - }, - ), - ); - } - }, - }; -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/specifiedRules.mjs": -/*!*******************************************************************!*\ - !*** ../../../node_modules/graphql/validation/specifiedRules.mjs ***! - \*******************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "specifiedRules": function() { return /* binding */ specifiedRules; }, -/* harmony export */ "specifiedSDLRules": function() { return /* binding */ specifiedSDLRules; } -/* harmony export */ }); -/* harmony import */ var _rules_ExecutableDefinitionsRule_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rules/ExecutableDefinitionsRule.mjs */ "../../../node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"); -/* harmony import */ var _rules_FieldsOnCorrectTypeRule_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rules/FieldsOnCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"); -/* harmony import */ var _rules_FragmentsOnCompositeTypesRule_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rules/FragmentsOnCompositeTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"); -/* harmony import */ var _rules_KnownArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./rules/KnownArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"); -/* harmony import */ var _rules_KnownDirectivesRule_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rules/KnownDirectivesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"); -/* harmony import */ var _rules_KnownFragmentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./rules/KnownFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"); -/* harmony import */ var _rules_KnownTypeNamesRule_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rules/KnownTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"); -/* harmony import */ var _rules_LoneAnonymousOperationRule_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rules/LoneAnonymousOperationRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"); -/* harmony import */ var _rules_LoneSchemaDefinitionRule_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./rules/LoneSchemaDefinitionRule.mjs */ "../../../node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"); -/* harmony import */ var _rules_NoFragmentCyclesRule_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./rules/NoFragmentCyclesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"); -/* harmony import */ var _rules_NoUndefinedVariablesRule_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./rules/NoUndefinedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"); -/* harmony import */ var _rules_NoUnusedFragmentsRule_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./rules/NoUnusedFragmentsRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"); -/* harmony import */ var _rules_NoUnusedVariablesRule_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./rules/NoUnusedVariablesRule.mjs */ "../../../node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"); -/* harmony import */ var _rules_OverlappingFieldsCanBeMergedRule_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./rules/OverlappingFieldsCanBeMergedRule.mjs */ "../../../node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"); -/* harmony import */ var _rules_PossibleFragmentSpreadsRule_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./rules/PossibleFragmentSpreadsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"); -/* harmony import */ var _rules_PossibleTypeExtensionsRule_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./rules/PossibleTypeExtensionsRule.mjs */ "../../../node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"); -/* harmony import */ var _rules_ProvidedRequiredArgumentsRule_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./rules/ProvidedRequiredArgumentsRule.mjs */ "../../../node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"); -/* harmony import */ var _rules_ScalarLeafsRule_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rules/ScalarLeafsRule.mjs */ "../../../node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"); -/* harmony import */ var _rules_SingleFieldSubscriptionsRule_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rules/SingleFieldSubscriptionsRule.mjs */ "../../../node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"); -/* harmony import */ var _rules_UniqueArgumentDefinitionNamesRule_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./rules/UniqueArgumentDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"); -/* harmony import */ var _rules_UniqueArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./rules/UniqueArgumentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"); -/* harmony import */ var _rules_UniqueDirectiveNamesRule_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./rules/UniqueDirectiveNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"); -/* harmony import */ var _rules_UniqueDirectivesPerLocationRule_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rules/UniqueDirectivesPerLocationRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"); -/* harmony import */ var _rules_UniqueEnumValueNamesRule_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./rules/UniqueEnumValueNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"); -/* harmony import */ var _rules_UniqueFieldDefinitionNamesRule_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./rules/UniqueFieldDefinitionNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"); -/* harmony import */ var _rules_UniqueFragmentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./rules/UniqueFragmentNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"); -/* harmony import */ var _rules_UniqueInputFieldNamesRule_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./rules/UniqueInputFieldNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"); -/* harmony import */ var _rules_UniqueOperationNamesRule_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rules/UniqueOperationNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"); -/* harmony import */ var _rules_UniqueOperationTypesRule_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./rules/UniqueOperationTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"); -/* harmony import */ var _rules_UniqueTypeNamesRule_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./rules/UniqueTypeNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"); -/* harmony import */ var _rules_UniqueVariableNamesRule_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rules/UniqueVariableNamesRule.mjs */ "../../../node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"); -/* harmony import */ var _rules_ValuesOfCorrectTypeRule_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./rules/ValuesOfCorrectTypeRule.mjs */ "../../../node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"); -/* harmony import */ var _rules_VariablesAreInputTypesRule_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./rules/VariablesAreInputTypesRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"); -/* harmony import */ var _rules_VariablesInAllowedPositionRule_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rules/VariablesInAllowedPositionRule.mjs */ "../../../node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"); -// Spec Section: "Executable Definitions" - // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" - - // Spec Section: "Fragments on Composite Types" - - // Spec Section: "Argument Names" - - // Spec Section: "Directives Are Defined" - - // Spec Section: "Fragment spread target defined" - - // Spec Section: "Fragment Spread Type Existence" - - // Spec Section: "Lone Anonymous Operation" - - // SDL-specific validation rules - - // Spec Section: "Fragments must not form cycles" - - // Spec Section: "All Variable Used Defined" - - // Spec Section: "Fragments must be used" - - // Spec Section: "All Variables Used" - - // Spec Section: "Field Selection Merging" - - // Spec Section: "Fragment spread is possible" - - - // Spec Section: "Argument Optionality" - - // Spec Section: "Leaf Field Selections" - - // Spec Section: "Subscriptions with Single Root Field" - - - // Spec Section: "Argument Uniqueness" - - - // Spec Section: "Directives Are Unique Per Location" - - - - // Spec Section: "Fragment Name Uniqueness" - - // Spec Section: "Input Object Field Uniqueness" - - // Spec Section: "Operation Name Uniqueness" - - - - // Spec Section: "Variable Uniqueness" - - // Spec Section: "Value Type Correctness" - - // Spec Section: "Variables are Input Types" - - // Spec Section: "All Variable Usages Are Allowed" - - - -/** - * This set includes all validation rules defined by the GraphQL spec. - * - * The order of the rules in this list has been adjusted to lead to the - * most clear output when encountering multiple validation errors. - */ -const specifiedRules = Object.freeze([ - _rules_ExecutableDefinitionsRule_mjs__WEBPACK_IMPORTED_MODULE_0__.ExecutableDefinitionsRule, - _rules_UniqueOperationNamesRule_mjs__WEBPACK_IMPORTED_MODULE_1__.UniqueOperationNamesRule, - _rules_LoneAnonymousOperationRule_mjs__WEBPACK_IMPORTED_MODULE_2__.LoneAnonymousOperationRule, - _rules_SingleFieldSubscriptionsRule_mjs__WEBPACK_IMPORTED_MODULE_3__.SingleFieldSubscriptionsRule, - _rules_KnownTypeNamesRule_mjs__WEBPACK_IMPORTED_MODULE_4__.KnownTypeNamesRule, - _rules_FragmentsOnCompositeTypesRule_mjs__WEBPACK_IMPORTED_MODULE_5__.FragmentsOnCompositeTypesRule, - _rules_VariablesAreInputTypesRule_mjs__WEBPACK_IMPORTED_MODULE_6__.VariablesAreInputTypesRule, - _rules_ScalarLeafsRule_mjs__WEBPACK_IMPORTED_MODULE_7__.ScalarLeafsRule, - _rules_FieldsOnCorrectTypeRule_mjs__WEBPACK_IMPORTED_MODULE_8__.FieldsOnCorrectTypeRule, - _rules_UniqueFragmentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_9__.UniqueFragmentNamesRule, - _rules_KnownFragmentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_10__.KnownFragmentNamesRule, - _rules_NoUnusedFragmentsRule_mjs__WEBPACK_IMPORTED_MODULE_11__.NoUnusedFragmentsRule, - _rules_PossibleFragmentSpreadsRule_mjs__WEBPACK_IMPORTED_MODULE_12__.PossibleFragmentSpreadsRule, - _rules_NoFragmentCyclesRule_mjs__WEBPACK_IMPORTED_MODULE_13__.NoFragmentCyclesRule, - _rules_UniqueVariableNamesRule_mjs__WEBPACK_IMPORTED_MODULE_14__.UniqueVariableNamesRule, - _rules_NoUndefinedVariablesRule_mjs__WEBPACK_IMPORTED_MODULE_15__.NoUndefinedVariablesRule, - _rules_NoUnusedVariablesRule_mjs__WEBPACK_IMPORTED_MODULE_16__.NoUnusedVariablesRule, - _rules_KnownDirectivesRule_mjs__WEBPACK_IMPORTED_MODULE_17__.KnownDirectivesRule, - _rules_UniqueDirectivesPerLocationRule_mjs__WEBPACK_IMPORTED_MODULE_18__.UniqueDirectivesPerLocationRule, - _rules_KnownArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_19__.KnownArgumentNamesRule, - _rules_UniqueArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_20__.UniqueArgumentNamesRule, - _rules_ValuesOfCorrectTypeRule_mjs__WEBPACK_IMPORTED_MODULE_21__.ValuesOfCorrectTypeRule, - _rules_ProvidedRequiredArgumentsRule_mjs__WEBPACK_IMPORTED_MODULE_22__.ProvidedRequiredArgumentsRule, - _rules_VariablesInAllowedPositionRule_mjs__WEBPACK_IMPORTED_MODULE_23__.VariablesInAllowedPositionRule, - _rules_OverlappingFieldsCanBeMergedRule_mjs__WEBPACK_IMPORTED_MODULE_24__.OverlappingFieldsCanBeMergedRule, - _rules_UniqueInputFieldNamesRule_mjs__WEBPACK_IMPORTED_MODULE_25__.UniqueInputFieldNamesRule, -]); -/** - * @internal - */ - -const specifiedSDLRules = Object.freeze([ - _rules_LoneSchemaDefinitionRule_mjs__WEBPACK_IMPORTED_MODULE_26__.LoneSchemaDefinitionRule, - _rules_UniqueOperationTypesRule_mjs__WEBPACK_IMPORTED_MODULE_27__.UniqueOperationTypesRule, - _rules_UniqueTypeNamesRule_mjs__WEBPACK_IMPORTED_MODULE_28__.UniqueTypeNamesRule, - _rules_UniqueEnumValueNamesRule_mjs__WEBPACK_IMPORTED_MODULE_29__.UniqueEnumValueNamesRule, - _rules_UniqueFieldDefinitionNamesRule_mjs__WEBPACK_IMPORTED_MODULE_30__.UniqueFieldDefinitionNamesRule, - _rules_UniqueArgumentDefinitionNamesRule_mjs__WEBPACK_IMPORTED_MODULE_31__.UniqueArgumentDefinitionNamesRule, - _rules_UniqueDirectiveNamesRule_mjs__WEBPACK_IMPORTED_MODULE_32__.UniqueDirectiveNamesRule, - _rules_KnownTypeNamesRule_mjs__WEBPACK_IMPORTED_MODULE_4__.KnownTypeNamesRule, - _rules_KnownDirectivesRule_mjs__WEBPACK_IMPORTED_MODULE_17__.KnownDirectivesRule, - _rules_UniqueDirectivesPerLocationRule_mjs__WEBPACK_IMPORTED_MODULE_18__.UniqueDirectivesPerLocationRule, - _rules_PossibleTypeExtensionsRule_mjs__WEBPACK_IMPORTED_MODULE_33__.PossibleTypeExtensionsRule, - _rules_KnownArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_19__.KnownArgumentNamesOnDirectivesRule, - _rules_UniqueArgumentNamesRule_mjs__WEBPACK_IMPORTED_MODULE_20__.UniqueArgumentNamesRule, - _rules_UniqueInputFieldNamesRule_mjs__WEBPACK_IMPORTED_MODULE_25__.UniqueInputFieldNamesRule, - _rules_ProvidedRequiredArgumentsRule_mjs__WEBPACK_IMPORTED_MODULE_22__.ProvidedRequiredArgumentsOnDirectivesRule, -]); - - -/***/ }), - -/***/ "../../../node_modules/graphql/validation/validate.mjs": -/*!*************************************************************!*\ - !*** ../../../node_modules/graphql/validation/validate.mjs ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "assertValidSDL": function() { return /* binding */ assertValidSDL; }, -/* harmony export */ "assertValidSDLExtension": function() { return /* binding */ assertValidSDLExtension; }, -/* harmony export */ "validate": function() { return /* binding */ validate; }, -/* harmony export */ "validateSDL": function() { return /* binding */ validateSDL; } -/* harmony export */ }); -/* harmony import */ var _jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsutils/devAssert.mjs */ "../../../node_modules/graphql/jsutils/devAssert.mjs"); -/* harmony import */ var _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../error/GraphQLError.mjs */ "../../../node_modules/graphql/error/GraphQLError.mjs"); -/* harmony import */ var _language_visitor_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../language/visitor.mjs */ "../../../node_modules/graphql/language/visitor.mjs"); -/* harmony import */ var _type_validate_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../type/validate.mjs */ "../../../node_modules/graphql/type/validate.mjs"); -/* harmony import */ var _utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/TypeInfo.mjs */ "../../../node_modules/graphql/utilities/TypeInfo.mjs"); -/* harmony import */ var _specifiedRules_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./specifiedRules.mjs */ "../../../node_modules/graphql/validation/specifiedRules.mjs"); -/* harmony import */ var _ValidationContext_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ValidationContext.mjs */ "../../../node_modules/graphql/validation/ValidationContext.mjs"); - - - - - - - -/** - * Implements the "Validation" section of the spec. - * - * Validation runs synchronously, returning an array of encountered errors, or - * an empty array if no errors were encountered and the document is valid. - * - * A list of specific validation rules may be provided. If not provided, the - * default list of rules defined by the GraphQL specification will be used. - * - * Each validation rules is a function which returns a visitor - * (see the language/visitor API). Visitor methods are expected to return - * GraphQLErrors, or Arrays of GraphQLErrors when invalid. - * - * Validate will stop validation after a `maxErrors` limit has been reached. - * Attackers can send pathologically invalid queries to induce a DoS attack, - * so by default `maxErrors` set to 100 errors. - * - * Optionally a custom TypeInfo instance may be provided. If not provided, one - * will be created from the provided schema. - */ - -function validate( - schema, - documentAST, - rules = _specifiedRules_mjs__WEBPACK_IMPORTED_MODULE_0__.specifiedRules, - options, - /** @deprecated will be removed in 17.0.0 */ - typeInfo = new _utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__.TypeInfo(schema), -) { - var _options$maxErrors; - - const maxErrors = - (_options$maxErrors = - options === null || options === void 0 ? void 0 : options.maxErrors) !== - null && _options$maxErrors !== void 0 - ? _options$maxErrors - : 100; - documentAST || (0,_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_2__.devAssert)(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error. - - (0,_type_validate_mjs__WEBPACK_IMPORTED_MODULE_3__.assertValidSchema)(schema); - const abortObj = Object.freeze({}); - const errors = []; - const context = new _ValidationContext_mjs__WEBPACK_IMPORTED_MODULE_4__.ValidationContext( - schema, - documentAST, - typeInfo, - (error) => { - if (errors.length >= maxErrors) { - errors.push( - new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__.GraphQLError( - 'Too many validation errors, error limit reached. Validation aborted.', - ), - ); // eslint-disable-next-line @typescript-eslint/no-throw-literal - - throw abortObj; - } - - errors.push(error); - }, - ); // This uses a specialized visitor which runs multiple visitors in parallel, - // while maintaining the visitor skip and break API. - - const visitor = (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_6__.visitInParallel)(rules.map((rule) => rule(context))); // Visit the whole document with each instance of all provided rules. - - try { - (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_6__.visit)(documentAST, (0,_utilities_TypeInfo_mjs__WEBPACK_IMPORTED_MODULE_1__.visitWithTypeInfo)(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; - } - } - - return errors; -} -/** - * @internal - */ - -function validateSDL( - documentAST, - schemaToExtend, - rules = _specifiedRules_mjs__WEBPACK_IMPORTED_MODULE_0__.specifiedSDLRules, -) { - const errors = []; - const context = new _ValidationContext_mjs__WEBPACK_IMPORTED_MODULE_4__.SDLValidationContext( - documentAST, - schemaToExtend, - (error) => { - errors.push(error); - }, - ); - const visitors = rules.map((rule) => rule(context)); - (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_6__.visit)(documentAST, (0,_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_6__.visitInParallel)(visitors)); - return errors; -} -/** - * Utility function which asserts a SDL document is valid by throwing an error - * if it is invalid. - * - * @internal - */ - -function assertValidSDL(documentAST) { - const errors = validateSDL(documentAST); - - if (errors.length !== 0) { - throw new Error(errors.map((error) => error.message).join('\n\n')); - } -} -/** - * Utility function which asserts a SDL document is valid by throwing an error - * if it is invalid. - * - * @internal - */ - -function assertValidSDLExtension(documentAST, schema) { - const errors = validateSDL(documentAST, schema); - - if (errors.length !== 0) { - throw new Error(errors.map((error) => error.message).join('\n\n')); - } -} - - -/***/ }), - -/***/ "../../../node_modules/graphql/version.mjs": -/*!*************************************************!*\ - !*** ../../../node_modules/graphql/version.mjs ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "version": function() { return /* binding */ version; }, -/* harmony export */ "versionInfo": function() { return /* binding */ versionInfo; } -/* harmony export */ }); -// Note: This file is autogenerated using "resources/gen-version.js" script and -// automatically updated by "npm version" command. - -/** - * A string containing the version of the GraphQL.js library - */ -const version = '16.5.0'; -/** - * An object containing the components of the GraphQL.js version string - */ - -const versionInfo = Object.freeze({ - major: 16, - minor: 5, - patch: 0, - preReleaseTag: null, -}); - - -/***/ }), - -/***/ "../../../node_modules/meros/browser/index.mjs": -/*!*****************************************************!*\ - !*** ../../../node_modules/meros/browser/index.mjs ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "meros": function() { return /* binding */ meros; } -/* harmony export */ }); -const separator = '\r\n\r\n'; -const decoder = new TextDecoder; -async function* generate(stream, boundary, options) { - const reader = stream.getReader(), is_eager = !options || !options.multiple; - let buffer = '', is_preamble = true, payloads = []; - try { - let result; - outer: while (!(result = await reader.read()).done) { - const chunk = decoder.decode(result.value); - const idx_chunk = chunk.indexOf(boundary); - let idx_boundary = buffer.length; - buffer += chunk; - if (!!~idx_chunk) { - // chunk itself had `boundary` marker - idx_boundary += idx_chunk; - } - else { - // search combined (boundary can be across chunks) - idx_boundary = buffer.indexOf(boundary); - } - payloads = []; - while (!!~idx_boundary) { - const current = buffer.substring(0, idx_boundary); - const next = buffer.substring(idx_boundary + boundary.length); - if (is_preamble) { - is_preamble = false; - } - else { - const headers = {}; - const idx_headers = current.indexOf(separator); - const arr_headers = buffer.slice(0, idx_headers).toString().trim().split(/\r\n/); - // parse headers - let tmp; - while (tmp = arr_headers.shift()) { - tmp = tmp.split(': '); - headers[tmp.shift().toLowerCase()] = tmp.join(': '); - } - let body = current.substring(idx_headers + separator.length, current.lastIndexOf('\r\n')); - let is_json = false; - tmp = headers['content-type']; - if (tmp && !!~tmp.indexOf('application/json')) { - try { - body = JSON.parse(body); - is_json = true; - } - catch (_) { - } - } - tmp = { headers, body, json: is_json }; - is_eager ? yield tmp : payloads.push(tmp); - // hit a tail boundary, break - if (next.substring(0, 2) === '--') - break outer; - } - buffer = next; - idx_boundary = buffer.indexOf(boundary); - } - if (payloads.length) - yield payloads; - } - } - finally { - if (payloads.length) - yield payloads; - reader.releaseLock(); - } -} - -/** - * Yield immediately for every part made available on the response. If the `content-type` of the response isn't a - * multipart body, then we'll resolve with {@link Response}. - * - * @example - * - * ```js - * const parts = await fetch('/fetch-multipart') - * .then(meros); - * - * for await (const part of parts) { - * // do something with this part - * } - * ``` - */ -async function meros(response, options) { - if (!response.ok || !response.body || response.bodyUsed) - return response; - const ctype = response.headers.get('content-type'); - if (!ctype || !~ctype.indexOf('multipart/mixed')) - return response; - const idx_boundary = ctype.indexOf('boundary='); - return generate(response.body, `--${!!~idx_boundary - ? // +9 for 'boundary='.length - ctype.substring(idx_boundary + 9).trim().replace(/['"]/g, '') - : '-'}`, options); -} - - - - -/***/ }), - -/***/ "./style.css": -/*!*******************!*\ - !*** ./style.css ***! - \*******************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "../../graphiql-react/dist/style.css": -/*!*******************************************!*\ - !*** ../../graphiql-react/dist/style.css ***! - \*******************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "../../graphiql-react/font/fira-code.css": -/*!***********************************************!*\ - !*** ../../graphiql-react/font/fira-code.css ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "../../graphiql-react/font/roboto.css": -/*!********************************************!*\ - !*** ../../graphiql-react/font/roboto.css ***! - \********************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "React" ***! - \************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["React"]; - -/***/ }), - -/***/ "react-dom": -/*!***************************!*\ - !*** external "ReactDOM" ***! - \***************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["ReactDOM"]; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/create fake namespace object */ -/******/ !function() { -/******/ var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; }; -/******/ var leafPrototypes; -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 16: return value when it's Promise-like -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = this(value); -/******/ if(mode & 8) return value; -/******/ if(typeof value === 'object' && value) { -/******/ if((mode & 4) && value.__esModule) return value; -/******/ if((mode & 16) && typeof value.then === 'function') return value; -/******/ } -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ var def = {}; -/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; -/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { -/******/ Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; }); -/******/ } -/******/ def['default'] = function() { return value; }; -/******/ __webpack_require__.d(ns, def); -/******/ return ns; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ !function() { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/nonce */ -/******/ !function() { -/******/ __webpack_require__.nc = undefined; -/******/ }(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__("./cdn.ts"); -/******/ window.GraphiQL = __webpack_exports__["default"]; -/******/ -/******/ })() -; -//# sourceMappingURL=graphiql.js.map \ No newline at end of file diff --git a/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js b/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js new file mode 100644 index 0000000..d600cc4 --- /dev/null +++ b/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js @@ -0,0 +1,3 @@ +/*! For license information please see graphiql.min.js.LICENSE.txt */ +!function(){var e,t,n={8042:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,n=function(){"use strict";function e(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}Object.defineProperty(t,"__esModule",{value:!0});const n=Symbol(),r=Symbol();function i(){let t=!0;const i=[];let o=e();const a=e(),s=async function*(){for(;;)if(i.length>0)yield i.shift();else{const e=await Promise.race([o.promise,a.promise]);if(e===n)break;if(e!==r)throw e}}();const l=s.return.bind(s);s.return=function(){return t=!1,a.resolve(n),l(...arguments)};const u=s.throw.bind(s);return s.throw=e=>(t=!1,a.resolve(e),u(e)),{pushValue:function(n){!1!==t&&(i.push(n),o.resolve(r),o=e())},asyncIterableIterator:s}}t.applyAsyncIterableIteratorToSink=function(e,t){return(async()=>{try{for await(const n of e)t.next(n);t.complete()}catch(e){t.error(e)}})(),()=>{var t;null===(t=e.return)||void 0===t||t.call(e)}},t.isAsyncIterable=function(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator&&Symbol.asyncIterator in e)},t.makeAsyncIterableIteratorFromSink=e=>{const{pushValue:t,asyncIterableIterator:n}=i(),r=e({next:e=>{t(e)},complete:()=>{n.return()},error:e=>{n.throw(e)}}),o=n.return;let a;return n.return=()=>(void 0===a&&(r(),a=o()),a),n},t.makePushPullAsyncIterableIterator=i},void 0===(r=n.apply(t,[]))||(e.exports=r)},7674:function(e,t,n){var r,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(i="function"==typeof(r=function(){"use strict";var e=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},r=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(5313),t),r(n(6718),t),r(n(863),t)})?r.apply(t,[]):r)||(e.exports=i)},5609:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.R=e.P=void 0;var t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0});class r{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new i(e,t)}setEnd(e,t){this.end=new i(e,t)}}e.R=r,n(r,"Range");class i{constructor(e,t){this.lessThanOrEqualTo=e=>this.linei(e,"name",{value:t,configurable:!0});function a(e,n){const i={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,r.f)(n,(n=>{var r,o;switch(n.kind){case"Query":case"ShortQuery":i.type=e.getQueryType();break;case"Mutation":i.type=e.getMutationType();break;case"Subscription":i.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":n.type&&(i.type=e.getType(n.type));break;case"Field":case"AliasedField":i.fieldDef=i.type&&n.name?s(e,i.parentType,n.name):null,i.type=null===(r=i.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":i.parentType=i.type?(0,t.getNamedType)(i.type):null;break;case"Directive":i.directiveDef=n.name?e.getDirective(n.name):null;break;case"Arguments":const a=n.prevState?"Field"===n.prevState.kind?i.fieldDef:"Directive"===n.prevState.kind?i.directiveDef:"AliasedField"===n.prevState.kind?n.prevState.name&&s(e,i.parentType,n.prevState.name):null:null;i.argDefs=a?a.args:null;break;case"Argument":if(i.argDef=null,i.argDefs)for(let e=0;ee.value===n.name)):null;break;case"ListValue":const c=i.inputType?(0,t.getNullableType)(i.inputType):null;i.inputType=c instanceof t.GraphQLList?c.ofType:null;break;case"ObjectValue":const d=i.inputType?(0,t.getNamedType)(i.inputType):null;i.objectFieldDefs=d instanceof t.GraphQLInputObjectType?d.getFields():null;break;case"ObjectField":const f=n.name&&i.objectFieldDefs?i.objectFieldDefs[n.name]:null;i.inputType=null==f?void 0:f.type;break;case"NamedType":i.type=n.name?e.getType(n.name):null}})),i}function s(e,r,i){return i===n.S.name&&e.getQueryType()===r?n.S:i===n.T.name&&e.getQueryType()===r?n.T:i===n.a.name&&(0,t.isCompositeType)(r)?n.a:r&&r.getFields?r.getFields()[i]:void 0}function l(e,t){for(let n=0;nn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){function t(t){return function(n,i){var o=i.line,a=n.getLine(o);function s(t){for(var r,s=i.ch,l=0;;){var u=s<=0?-1:a.lastIndexOf(t[0],s-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}r(i,"hasImport");var o,a=n.line,s=i(a);if(!s||i(a-1)||(o=i(a-2))&&o.end.line==a-1)return null;for(var l=s.end;;){var u=i(l.line+1);if(null==u)break;l=u.end}return{from:t.clipPos(e.Pos(a,s.startCh+1)),to:l}})),e.registerHelper("fold","include",(function(t,n){function i(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}r(i,"hasInclude");var o=n.line,a=i(o);if(null==a||null!=i(o-1))return null;for(var s=o;null!=i(s+1);)++s;return{from:e.Pos(o,a+1),to:t.clipPos(e.Pos(s))}}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.b=a})?r.apply(t,i):r)||(e.exports=o)},5728:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),n&&(a(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(o))})),r(i,"getOption");var o={Backspace:u,Enter:c};function a(e){for(var t=0;t=0;s--){var c=a[s].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function c(t){var n=l(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function f(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function p(t,r){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=i(o,"pairs"),s=a.indexOf(r);if(-1==s)return e.Pass;for(var u,c=i(o,"closeBefore"),p=i(o,"triples"),h=a.charAt(s+1)==r,g=t.listSelections(),v=s%2==0,y=0;y1&&p.indexOf(r)>=0&&t.getRange(n(T.line,T.ch-2),T)==r+r){if(T.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(T.line,T.ch-2))))return e.Pass;b="addFour"}else if(h){var C=0==T.ch?" ":t.getRange(n(T.line,T.ch-1),T);if(e.isWordChar(w)||C==r||e.isWordChar(C))return e.Pass;b="both"}else{if(!v||!(0===w.length||/\s/.test(w)||c.indexOf(w)>-1))return e.Pass;b="both"}else b=h&&m(t,T)?"both":p.indexOf(r)>=0&&t.getRange(T,n(T.line,T.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=b)return e.Pass}else u=b}var S=s%2?a.charAt(s-1):r,x=s%2?r:a.charAt(s+1);t.operation((function(){if("skip"==u)d(t,1);else if("skipThree"==u)d(t,3);else if("surround"==u){for(var e=t.getSelections(),n=0;nn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e,n){t.c,e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),s=i||o||a,l=s&&(i?document.documentMode||6:+(a||o)[1]),u=!a&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),d=!a&&/Chrome\//.test(e),f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),E=/\bCrOS\b/.test(e),T=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,u=!0);var C=b&&(c||f&&(null==w||w<12.11)),S=n||s&&l>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}r(x,"classTest");var N,k=r((function(e,t){var n=e.className,r=x(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}}),"rmClass");function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return _(e).appendChild(t)}function I(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?F=r((function(e){e.selectionStart=0,e.selectionEnd=e.value.length}),"selectInput"):s&&(F=r((function(e){try{e.select()}catch(e){}}),"selectInput")),r(P,"bind"),r(j,"copyObj"),r(V,"countColumn");var U=r((function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)}),"Delayed");function B(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}r(W,"findColumn");var K=[""];function Q(e){for(;K.length<=e;)K.push(X(K)+" ");return K[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}r(ne,"isWordCharBasic"),r(re,"isWordChar"),r(ie,"isEmpty");var oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ae(e){return e.charCodeAt(0)>=768&&oe.test(e)}function se(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}r(ae,"isExtendingChar"),r(se,"skipExtendingChars"),r(le,"findFirst"),r(ue,"iterateBidiSections");var ce=null;function de(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}r(de,"getBidiPartAt");var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}r(n,"charType");var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;function u(e,t,n){this.level=e,this.from=t,this.to=n}return r(u,"BidiSpan"),function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var c=e.length,d=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function we(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ne(e){Ce(e),Se(e)}function ke(e){return e.target||e.srcElement}function _e(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}r(ge,"getHandlers"),r(ve,"off"),r(ye,"signal"),r(be,"signalDOMEvent"),r(Ee,"signalCursorActivity"),r(Te,"hasHandler"),r(we,"eventMixin"),r(Ce,"e_preventDefault"),r(Se,"e_stopPropagation"),r(xe,"e_defaultPrevented"),r(Ne,"e_stop"),r(ke,"e_target"),r(_e,"e_button");var Oe,Ie,De=function(){if(s&&l<9)return!1;var e=I("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==Oe){var t=I("span","​");O(e,I("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var n=Oe?I("span","​"):I("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=Ie)return Ie;var t=O(e,document.createTextNode("AخA")),n=N(t,0,1).getBoundingClientRect(),r=N(t,1,2).getBoundingClientRect();return _(e),!(!n||n.left==n.right)&&(Ie=r.right-n.right<3)}r(Le,"zeroWidthElement"),r(Ae,"hasBadBidiRects");var Me,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(Me=I("div"))||(Me.setAttribute("oncopy","return;"),"function"==typeof Me.oncopy),je=null;function Ve(e){if(null!=je)return je;var t=O(e,I("span","x")),n=t.getBoundingClientRect(),r=N(t,0,1).getBoundingClientRect();return je=Math.abs(n.left-r.left)>1}r(Ve,"hasBadZoomedRects");var Ue={},Be={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}function qe(e,t){Be[e]=t}function He(e){if("string"==typeof e&&Be.hasOwnProperty(e))e=Be[e];else if(e&&"string"==typeof e.name&&Be.hasOwnProperty(e.name)){var t=Be[e.name];"string"==typeof t&&(t={name:t}),(e=ee(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=He(t);var n=Ue[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var i=ze[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}r($e,"defineMode"),r(qe,"defineMIME"),r(He,"resolveMode"),r(Ge,"getMode");var ze={};function We(e,t){j(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function Ke(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Qe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}r(We,"extendMode"),r(Ke,"copyState"),r(Qe,"innerMode"),r(Xe,"startState");var Ye=r((function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n}),"StringStream");function Je(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?at(n,Je(e,n).text.length):ht(t,Je(e,t.line).text.length)}function ht(e,t){var n=e.ch;return null==n||n>t?at(e.line,t):n<0?at(e.line,0):e}function mt(e,t){for(var n=[],r=0;r=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var o=r((function(e){return n?e.toLowerCase():e}),"cased");if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},r(Je,"getLine"),r(Ze,"getBetween"),r(et,"getLines"),r(tt,"updateLineHeight"),r(nt,"lineNo"),r(rt,"lineAtHeight"),r(it,"isLine"),r(ot,"lineNumberFor"),r(at,"Pos"),r(st,"cmp"),r(lt,"equalCursorPos"),r(ut,"copyPos"),r(ct,"maxPos"),r(dt,"minPos"),r(ft,"clipLine"),r(pt,"clipPos"),r(ht,"clipToLen"),r(mt,"clipPosArray");var gt=r((function(e,t){this.state=e,this.lookAhead=t}),"SavedContext"),vt=r((function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1}),"Context");function yt(e,t,n,i){var o=[e.state.modeGen],a={};kt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),a,i);for(var s=n.state,l=r((function(r){n.baseTokens=o;var i=e.state.overlays[r],l=1,u=0;n.state=!0,kt(e,t.text,i.mode,n,(function(e,t){for(var n=l;ue&&o.splice(l,1,e,o[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(i.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ke(e.doc.mode,r.state),o=yt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Et(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=_t(e,t,n),a=o>r.first&&Je(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Xe(r.mode),o);return r.iter(o,t,(function(n){Tt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof gt?new vt(e,Ke(e.mode,t.state),n,t.lookAhead):new vt(e,Ke(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t},r(yt,"highlightLine"),r(bt,"getLineStyles"),r(Et,"getContextBefore"),r(Tt,"processLine"),r(wt,"callBlankLine"),r(Ct,"readToken");var St=r((function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n}),"Token");function xt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Je(a,(t=pt(a,t)).line),u=Et(e,t.line,n),c=new Ye(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&Tt(e,t,r,d.pos),d.pos=t.length,l=null):l=Nt(Ct(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Je(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof gt?u.lookAhead:0)<=o.modeFrontier))return s;var c=V(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function Ot(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Je(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Mt(a,o.from,s?null:o.to))}}return r}function Vt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=st(u.from,s.from),f=st(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function qt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Wt(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,r,i){var o=Je(e,t),a=Dt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?st(u.to,n)>=0:st(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?st(u.from,r)<=0:st(u.from,r)<0)))return!0}}}function Zt(e){for(var t;t=Qt(e);)e=t.find(-1,!0).line;return e}function en(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function tn(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function nn(e,t){var n=Je(e,t),r=Zt(n);return n==r?t:nt(r)}function rn(e,t){if(t>e.lastLine())return t;var n,r=Je(e,t);if(!on(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return nt(r)+1}function on(e,t){var n=Dt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}r(Lt,"seeReadOnlySpans"),r(At,"seeCollapsedSpans"),r(Mt,"MarkedSpan"),r(Rt,"getMarkedSpanFor"),r(Ft,"removeMarkedSpan"),r(Pt,"addMarkedSpan"),r(jt,"markedSpansBefore"),r(Vt,"markedSpansAfter"),r(Ut,"stretchSpansOverChange"),r(Bt,"clearEmptySpans"),r($t,"removeReadOnlyRanges"),r(qt,"detachMarkedSpans"),r(Ht,"attachMarkedSpans"),r(Gt,"extraLeft"),r(zt,"extraRight"),r(Wt,"compareCollapsedMarkers"),r(Kt,"collapsedSpanAtSide"),r(Qt,"collapsedSpanAtStart"),r(Xt,"collapsedSpanAtEnd"),r(Yt,"collapsedSpanAround"),r(Jt,"conflictingCollapsedRange"),r(Zt,"visualLine"),r(en,"visualLineEnd"),r(tn,"visualLineContinued"),r(nn,"visualLineNo"),r(rn,"visualLineEndNo"),r(on,"lineIsHidden"),r(an,"lineIsHiddenInner"),r(sn,"heightAtLine"),r(ln,"lineLength"),r(un,"findMaxLine");var cn=r((function(e,t,n){this.text=e,Ht(this,t),this.height=n?n(this):1}),"Line");function dn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),qt(e),Ht(e,n);var i=r?r(e):1;i!=e.height&&tt(e,i)}function fn(e){e.parent=null,qt(e)}cn.prototype.lineNo=function(){return nt(this)},we(cn),r(dn,"updateLine"),r(fn,"cleanUpLine");var pn={},hn={};function mn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=D("span",null,null,u?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=yn,Ae(e.display.measure)&&(a=pe(o,e.doc.direction))&&(r.addToken=En(r.addToken,a)),r.map=[],wn(o,r,bt(e,o,t!=e.display.externalMeasured&&nt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=R(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=R(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Le(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=R(r.pre.className,r.textClass||"")),r}function vn(e){var t=I("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function yn(e,t,n,r,i,o,a){if(t){var u,c=e.splitSpaces?bn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var g=document.createTextNode(c.slice(p,p+m));s&&l<9?u.appendChild(I("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(I("span",Q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((v=u.appendChild(I("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),s&&l<9?u.appendChild(I("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),s&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||a){var E=n||"";r&&(E+=r),i&&(E+=i);var T=I("span",[u],E,o);if(a)for(var w in a)a.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&T.setAttribute(w,a[w]);return e.content.appendChild(T)}e.content.appendChild(u)}}function bn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function Tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=u=c=s="",f=null,d=null,v=1/0;for(var y=[],b=void 0,E=0;Eh||w.collapsed&&T.to==h&&T.from==h)){if(null!=T.to&&T.to!=h&&v>T.to&&(v=T.to,u=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&T.from==h&&(c+=" "+w.startStyle),w.endStyle&&T.to==v&&(b||(b=[])).push(w.endStyle,T.to),w.title&&((f||(f={})).title=w.title),w.attributes)for(var C in w.attributes)(f||(f={}))[C]=w.attributes[C];w.collapsed&&(!d||Wt(d.marker,w)<0)&&(d=T)}else T.from>h&&v>T.from&&(v=T.from)}if(b)for(var S=0;S=p)break;for(var N=Math.min(p,v);;){if(g){var k=h+g.length;if(!d){var _=k>N?g.slice(0,N-h):g;t.addToken(t,_,a?a+l:l,c,h+_.length==v?u:"",s,f)}if(k>=N){g=g.slice(N-h),h=N;break}h=k,c=""}g=i.slice(o,o=n[m++]),a=mn(n[m++],t.cm.options)}}else for(var O=1;O2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Zn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function er(e,t){var n=nt(t=Zt(t)),r=e.display.externalMeasured=new Cn(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function tr(e,t,n,r){return ir(e,rr(e,t),n,r)}function nr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function ur(e,t,n,r){var i,o=sr(t.map,n,r),a=o.node,u=o.start,c=o.end,d=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ae(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==r?p.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!u&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Dr(e.display),top:h.top,bottom:h.bottom}:ar}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b=i.text.length?(u=i.text.length,c="before"):u<=0&&(u=0,c="after"),!l)return s("before"==c?u-1:u,"before"==c);function d(e,t,n){return s(n?e-1:e,1==l[t].level!=n)}r(d,"getBidi");var f=de(l,u,c),p=ce,h=d(u,f,"before"==c);return null!=p&&(h.other=d(u,p,"before"!=c)),h}function Tr(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=Je(e.doc,t.line),i=sn(r)+zn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(e,t,n,r,i){var o=at(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Cr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=rt(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Je(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Je(r,i);;){var s=kr(e,a,i,t,n),l=Yt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Je(r,i=u.line)}}function Sr(e,t,n,r){r-=gr(t);var i=t.text.length,o=le((function(t){return ir(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=le((function(t){return ir(e,n,t).top>r}),o,i)}}function xr(e,t,n,r){return n||(n=rr(e,t)),Sr(e,t,n,vr(e,t,ir(e,n,r),"line").top)}function Nr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function kr(e,t,n,r,i){i-=sn(t);var o=rr(e,t),a=gr(t),s=0,l=t.text.length,u=!0,c=pe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Or:_r)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,g=le((function(t){var n=ir(e,o,t);return n.top+=a,n.bottom+=a,!!Nr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),v=!1;if(m){var y=r-m.left=E.bottom?1:0}return wr(n,g=se(t.text,g,1),p,v,r-f)}function _r(e,t,n,r,i,o,a){var s=le((function(s){var l=i[s],u=1!=l.level;return Nr(Er(e,at(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=Er(e,at(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Nr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Or(e,t,n,r,i,o,a){var s=Sr(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||p.to<=l)){var h=ir(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=hm)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==or){or=I("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(I("br"));or.appendChild(document.createTextNode("x"))}O(e.measure,or);var n=or.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),_(e.measure),n||1}function Dr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=I("span","xxxxxxxxxx"),n=I("pre",[t],"CodeMirror-line-like");O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Lr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Mr(e){var t=Ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(on(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Je(e.doc,u.line).text).length==u.ch){var c=V(l,l.length,e.options.tabSize)-l.length;u=at(u.line,Math.max(0,Math.round((o-Kn(e.display).left)/Dr(e.display))-c))}return u}function Pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Dt&&nn(e.doc,t)i.viewFrom?Ur(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Ur(e);else if(t<=i.viewFrom){var o=Br(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Ur(e)}else if(n>=i.viewTo){var a=Br(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Ur(e)}else{var s=Br(e,t,t,-1),l=Br(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Sn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Ur(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Pr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Br(e,t,n,r){var i,o=Pr(e,t),a=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;nn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function $r(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Sn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Pr(e,n)))),r.viewTo=n}function qr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(I("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Wr(e,t){return e.top-t.top||e.left-t.left}function Kr(e,t,n){var i=e.display,o=e.doc,a=document.createDocumentFragment(),s=Kn(e.display),l=s.left,u=Math.max(i.sizerWidth,Xn(e)-i.sizer.offsetLeft)-s.right,c="ltr"==o.direction;function d(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(I("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,i){var a,s,f=Je(o,t),p=f.text.length;function h(n,r){return br(e,at(t,n),"div",f,r)}function m(t,n,r){var i=xr(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}r(h,"coords"),r(m,"wrapX");var g=pe(f,o.direction);return ue(g,n||0,null==i?p:i,(function(e,t,r,o){var f="ltr"==r,v=h(e,f?"left":"right"),y=h(t-1,f?"right":"left"),b=null==n&&0==e,E=null==i&&t==p,T=0==o,w=!g||o==g.length-1;if(y.top-v.top<=3){var C=(c?E:b)&&w,S=(c?b:E)&&T?l:(f?v:y).left,x=C?u:(f?y:v).right;d(S,v.top,x-S,v.bottom)}else{var N,k,_,O;f?(N=c&&b&&T?l:v.left,k=c?u:m(e,r,"before"),_=c?l:m(t,r,"after"),O=c&&E&&w?u:y.right):(N=c?m(e,r,"before"):l,k=!c&&b&&T?u:v.right,_=!c&&E&&w?l:y.left,O=c?m(t,r,"after"):u),d(N,v.top,k-N,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Zr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Jr(e))}function Yr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zr(e))}),100)}function Jr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Qr(e))}function Zr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,k(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a.005||m<-.005)&&(ie.display.sizerWidth){var v=Math.ceil(f/Dr(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ti(e){if(e.widgets)for(var t=0;t=a&&(o=rt(t,sn(Je(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ri(e,t){if(!be(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=I("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-zn(e.display))+"px;\n height: "+(t.bottom-t.top+Qn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ii(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?at(t.line,t.ch+1,"before"):t,t=t.ch?at(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Er(e,t),l=n&&n!=t?Er(e,n):s,u=ai(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(pi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(mi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function oi(e,t){var n=ai(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&mi(e,n.scrollLeft)}function ai(e,t){var n=e.display,r=Ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Yn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Wn(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Xn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+f-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function si(e,t){null!=t&&(di(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function li(e){di(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ui(e,t,n){null==t&&null==n||di(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ci(e,t){di(e),e.curOp.scrollToPos=t}function di(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,fi(e,Tr(e,t.from),Tr(e,t.to),t.margin))}function fi(e,t,n,r){var i=ai(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ui(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Hi(e,{top:t}),hi(e,t,!0),n&&Hi(e),Fi(e,100))}function hi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function mi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Ki(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Wn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}r(sr,"nodeAndOffsetInLineMap"),r(lr,"getUsefulRect"),r(ur,"measureCharInner"),r(cr,"maybeUpdateRectForZooming"),r(dr,"clearLineMeasurementCacheFor"),r(fr,"clearLineMeasurementCache"),r(pr,"clearCaches"),r(hr,"pageScrollX"),r(mr,"pageScrollY"),r(gr,"widgetTopHeight"),r(vr,"intoCoordSystem"),r(yr,"fromCoordSystem"),r(br,"charCoords"),r(Er,"cursorCoords"),r(Tr,"estimateCoords"),r(wr,"PosWithInfo"),r(Cr,"coordsChar"),r(Sr,"wrappedLineExtent"),r(xr,"wrappedLineExtentChar"),r(Nr,"boxIsAfter"),r(kr,"coordsCharInner"),r(_r,"coordsBidiPart"),r(Or,"coordsBidiPartWrapped"),r(Ir,"textHeight"),r(Dr,"charWidth"),r(Lr,"getDimensions"),r(Ar,"compensateForHScroll"),r(Mr,"estimateHeight"),r(Rr,"estimateLineHeights"),r(Fr,"posFromMouse"),r(Pr,"findViewIndex"),r(jr,"regChange"),r(Vr,"regLineChange"),r(Ur,"resetView"),r(Br,"viewCuttingPoint"),r($r,"adjustView"),r(qr,"countDirtyView"),r(Hr,"updateSelection"),r(Gr,"prepareSelection"),r(zr,"drawSelectionCursor"),r(Wr,"cmpCoords"),r(Kr,"drawSelectionRange"),r(Qr,"restartBlink"),r(Xr,"ensureFocus"),r(Yr,"delayBlurEvent"),r(Jr,"onFocus"),r(Zr,"onBlur"),r(ei,"updateHeightsInViewport"),r(ti,"updateWidgetHeight"),r(ni,"visibleLines"),r(ri,"maybeScrollWindow"),r(ii,"scrollPosIntoView"),r(oi,"scrollIntoView"),r(ai,"calculateScrollPos"),r(si,"addToScrollTop"),r(li,"ensureCursorVisible"),r(ui,"scrollToCoords"),r(ci,"scrollToRange"),r(di,"resolveScrollToPos"),r(fi,"scrollToCoordsRange"),r(pi,"updateScrollTop"),r(hi,"setScrollTop"),r(mi,"setScrollLeft"),r(gi,"measureForScrollbars");var vi=r((function(e,t,n){this.cm=n;var r=this.vert=I("div",[I("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=I("div",[I("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),me(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}),"NativeScrollbars");vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},vi.prototype.enableZeroWidthBar=function(e,t,n){function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}e.style.pointerEvents="auto",r(i,"maybeDisable"),t.set(1e3,i)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var yi=r((function(){}),"NullScrollbars");function bi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;Ei(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ei(e),Ei(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ei(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}yi.prototype.update=function(){return{bottom:0,right:0}},yi.prototype.setScrollLeft=function(){},yi.prototype.setScrollTop=function(){},yi.prototype.clear=function(){},r(bi,"updateScrollbars"),r(Ei,"updateScrollbarsInner");var Ti={native:vi,null:yi};function wi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ti[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?mi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}r(wi,"initScrollbars");var Ci=0;function Si(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ci,markArrays:null},Nn(e.curOp)}function xi(e){var t=e.curOp;t&&_n(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ji(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function _i(e){e.updatedDisplay=e.mustUpdate&&$i(e.cm,e.update)}function Oi(e){var t=e.cm,n=t.display;e.updatedDisplay&&ei(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=tr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ii(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Et(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ke(t.mode,r.state):null,l=yt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fn)return Fi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Li(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qr(e))return!1;Qi(e)&&(Ur(e),t.dims=Lr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Dt&&(o=nn(e.doc,o),a=rn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;$r(e,o,a),n.viewOffset=sn(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=qr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ui(e);return l>4&&(n.lineDiv.style.display="none"),Gi(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Bi(u),_(n.cursorDiv),_(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Fi(e,400)),n.updateLineNumbers=null,!0}function qi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ni(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Wn(e.display)-Yn(e),n.top)}),t.visible=ni(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!$i(e,t))break;ei(e);var i=gi(e);Hr(e),bi(e,i),Wi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Hi(e,t){var n=new ji(e,t);if($i(e,n)){ei(e),qi(e,n);var r=gi(e);Hr(e),bi(e,r),Wi(e,r),n.finish()}}function Gi(e,t,n){var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,s=a.firstChild;function l(t){var n=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}r(l,"rm");for(var c=i.view,d=i.viewFrom,f=0;f-1&&(h=!1),Ln(e,p,d,n)),h&&(_(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(ot(e.options,d)))),s=p.node.nextSibling}else{var m=Un(e,p,d,n);a.insertBefore(m,s)}d+=p.size}for(;s;)s=l(s)}function zi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",In(e,"gutterChanged",e)}function Wi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qn(e)+"px"}function Ki(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;al.clientWidth,d=l.scrollHeight>l.clientHeight;if(i&&c||o&&d){if(o&&b&&u)e:for(var p=t.target,h=s.view;p!=l;p=p.parentNode)for(var m=0;m=0&&st(e,r.to())<=0)return n}return-1};var ao=r((function(e,t){this.anchor=e,this.head=t}),"Range");function so(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return st(e.from(),t.from())})),n=B(t,i);for(var o=1;o0:l>=0){var u=dt(s.from(),a.from()),c=ct(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ao(d?c:u,d?u:c))}}return new oo(t,n)}function lo(e,t){return new oo([new ao(e,t||e)],0)}function uo(e){return e.text?at(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(st(e,t.from)<0)return e;if(st(e,t.to)<=0)return uo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=uo(t).ch-t.to.ch),at(n,r)}function fo(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,m-1),e.insert(l.line+1,y)}In(e,"change",e,t)}function bo(e,t,n){function i(e,r,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function ko(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=No(i,i.lastOp==r)))a=X(o.changes),0==st(t.from,t.to)&&0==st(t.from,a.to)?a.to=uo(t):o.changes.push(So(e,t));else{var l=X(i.done);for(l&&l.ranges||Io(e.sel,i.done),o={changes:[So(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function _o(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Oo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_o(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Io(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&xo(i.undone)}function Io(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Do(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Lo(e){if(!e)return null;for(var t,n=0;n-1&&(X(s)[d]=u[d],delete u[d])}}}return r}function Fo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=st(t,i)<0;o!=st(n,i)<0?(i=t,t=n):o!=st(t,n)<0&&(t=n)}return new ao(i,t)}return new ao(n||t,t)}function Po(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),qo(e,new oo([Fo(e.sel.primary(),t,n,i)],0),r)}function jo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=st(d,n))&&(r<0?f<0:f>0))return Ko(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=Xo(e,p,r,p.line==t.line?o:null)),p?Ko(e,p,t,r,i):null}}return t}function Qo(e,t,n,r,i){var o=r||1;return Ko(e,t,n,o,i)||!i&&Ko(e,t,n,o,!0)||Ko(e,t,n,-o,i)||!i&&Ko(e,t,n,-o,!0)||(e.cantEdit=!0,at(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,at(t.line-1)):null:n>0&&t.ch==(r||Je(e,t.line)).text.length?t.line=0;--i)ea(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ea(e,t)}}function ea(e,t){if(1!=t.text.length||""!=t.text[0]||0!=st(t.from,t.to)){var n=fo(e,t);ko(e,t,n,e.cm?e.cm.curOp.id:NaN),ra(e,t,n,Ut(e,t));var r=[];bo(e,(function(e,n){n||-1!=B(r,e.history)||(la(e.history,t),r.push(e.history)),ra(e,t,null,Ut(e,t))}))}}function ta(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var o,a=e.history,s=e.sel,l="undo"==t?a.done:a.undone,u="undo"==t?a.undone:a.done,c=0;c=0;--h){var m=p(h);if(m)return m.v}}}}function na(e,t){if(0!=t&&(e.first+=t,e.sel=new oo(Y(e.sel.ranges,(function(e){return new ao(at(e.anchor.line+t,e.anchor.ch),at(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){jr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:at(o,Je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),n||(n=fo(e,t)),e.cm?ia(e.cm,t,r):yo(e,t,r),Ho(e,n,H),e.cantEdit&&Qo(e,at(e.firstLine(),0))&&(e.cantEdit=!1)}}function ia(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=nt(Zt(Je(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&Ee(e),yo(r,t,n,Mr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=ln(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Ot(r,o.line),Fi(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?jr(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?jr(e,o.line,a.line+1,u):Vr(e,o.line,"text");var c=Te(e,"changes"),d=Te(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&In(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function oa(e,t,n,r,i){var o;r||(r=n),st(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Zo(e,{from:n,to:r,text:t,origin:i})}function aa(e,t,n,r){n1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Jt(e,t.line,t,n,o)||t.line!=n.line&&Jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At()}o.addToHistory&&ko(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Zt(r)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&tt(r,0),Pt(r,new Mt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){on(e,t)&&tt(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Lt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ma,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)jr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Vr(u,c,"text");o.atomic&&zo(u.doc),In(u,"markerAdded",u,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Si(e),Te(this,"clear")){var n=this.find();n&&In(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&jr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&In(e,"markerCleared",e,this,r,i),t&&xi(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Zo(this,r[l]);s?$o(this,s):this.cm&&li(this.cm)})),undo:Ri((function(){ta(this,"undo")})),redo:Ri((function(){ta(this,"redo")})),undoSelection:Ri((function(){ta(this,"undo",!0)})),redoSelection:Ri((function(){ta(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,at(n,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),Ho(t.doc,lo(n,n)),p)for(var h=0;h=0;t--)oa(e.doc,"",r[t].from,r[t].to,"+delete");li(e)}))}function Ka(e,t,n){var r=se(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qa(e,t,n){var r=Ka(e,t.ch,n);return null==r?null:new at(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=pe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=rr(t,n);a=i<0?n.text.length-1:0;var c=ir(t,u,a).top;a=le((function(e){return ir(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ka(n,a,1))}else a=i<0?s.to:s.from;return new at(r,a,l)}}return new at(r,i<0?n.text.length:0,i<0?"before":"after")}function Ya(e,t,n,i){var o=pe(t,e.doc.direction);if(!o)return Qa(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=de(o,n.ch,n.sticky),s=o[a];if("ltr"==e.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&p>=d.begin)){var h=f?"before":"after";return new at(n.line,p,h)}}var m=r((function(e,t,i){for(var a=r((function(e,t){return t?new at(n.line,u(e,1),"before"):new at(n.line,e,"after")}),"getRes");e>=0&&e0==(1!=s.level),c=l?i.begin:u(i.end,-1);if(s.from<=c&&c0?d.end:u(d.begin,-1);return null==v||i>0&&v==t.text.length||!(g=m(i>0?0:o.length-1,i,c(v)))?null:g}Va.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Va.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Va.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Va.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Va.default=b?Va.macDefault:Va.pcDefault,r(Ua,"normalizeKeyName"),r(Ba,"normalizeKeyMap"),r($a,"lookupKey"),r(qa,"isModifierKey"),r(Ha,"addModifierNames"),r(Ga,"keyName"),r(za,"getKeyMap"),r(Wa,"deleteNearSelection"),r(Ka,"moveCharLogically"),r(Qa,"moveLogically"),r(Xa,"endOfLine"),r(Ya,"moveVisually");var Ja={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Wa(e,(function(t){if(t.empty()){var n=Je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new at(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),at(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Je(e.doc,i.line-1).text;a&&(i=new at(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),at(i.line-1,a.length-1),i,"+transpose"))}n.push(new ao(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Li(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(st((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(st(i.to(),t)>0||t.xRel<0)?Cs(e,r,t,o):xs(e,r,t,o)}function Cs(e,t,n,i){var o=e.display,a=!1,c=Ai(e,(function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yr(e)),ve(o.wrapper.ownerDocument,"mouseup",c),ve(o.wrapper.ownerDocument,"mousemove",d),ve(o.scroller,"dragstart",f),ve(o.scroller,"drop",c),a||(Ce(t),i.addNew||Po(e.doc,n,null,null,i.extend),u&&!p||s&&9==l?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),d=r((function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10}),"mouseMove"),f=r((function(){return a=!0}),"dragStart");u&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,me(o.wrapper.ownerDocument,"mouseup",c),me(o.wrapper.ownerDocument,"mousemove",d),me(o.scroller,"dragstart",f),me(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Ss(e,t,n){if("char"==n)return new ao(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ao(at(t.line,0),pt(e.doc,at(t.line+1,0)));var r=n(e,t);return new ao(r.from,r.to)}function xs(e,t,n,i){s&&Yr(e);var o=e.display,a=e.doc;Ce(t);var l,u,c=a.sel,d=c.ranges;if(i.addNew&&!i.extend?(u=a.sel.contains(n),l=u>-1?d[u]:new ao(n,n)):(l=a.sel.primary(),u=a.sel.primIndex),"rectangle"==i.unit)i.addNew||(l=new ao(n,n)),n=Fr(e,t,!0,!0),u=-1;else{var f=Ss(e,n,i.unit);l=i.extend?Fo(l,f.anchor,f.head,i.extend):f}i.addNew?-1==u?(u=d.length,qo(a,so(e,d.concat([l]),u),{scroll:!1,origin:"*mouse"})):d.length>1&&d[u].empty()&&"char"==i.unit&&!i.extend?(qo(a,so(e,d.slice(0,u).concat(d.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),c=a.sel):Vo(a,u,l,G):(u=0,qo(a,new oo([l],0),G),c=a.sel);var p=n;function h(t){if(0!=st(p,t))if(p=t,"rectangle"==i.unit){for(var r=[],o=e.options.tabSize,s=V(Je(a,n.line).text,n.ch,o),d=V(Je(a,t.line).text,t.ch,o),f=Math.min(s,d),h=Math.max(s,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Je(a,m).text,y=W(v,f,o);f==h?r.push(new ao(at(m,y),at(m,y))):v.length>y&&r.push(new ao(at(m,y),at(m,W(v,h,o))))}r.length||r.push(new ao(n,n)),qo(a,so(e,c.ranges.slice(0,u).concat(r),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=l,T=Ss(e,t,i.unit),w=E.anchor;st(T.anchor,w)>0?(b=T.head,w=dt(E.from(),T.anchor)):(b=T.anchor,w=ct(E.to(),T.head));var C=c.ranges.slice(0);C[u]=Ns(e,new ao(pt(a,w),b)),qo(a,so(e,C,u),G)}}r(h,"extendTo");var m=o.wrapper.getBoundingClientRect(),g=0;function v(t){var n=++g,r=Fr(e,t,!0,"rectangle"==i.unit);if(r)if(0!=st(r,p)){e.curOp.focus=A(),h(r);var s=ni(o,a);(r.line>=s.to||r.linem.bottom?20:0;l&&setTimeout(Ai(e,(function(){g==n&&(o.scroller.scrollTop+=l,v(t))})),50)}}function y(t){e.state.selectingText=!1,g=1/0,t&&(Ce(t),o.input.focus()),ve(o.wrapper.ownerDocument,"mousemove",b),ve(o.wrapper.ownerDocument,"mouseup",E),a.history.lastSelOrigin=null}r(v,"extend"),r(y,"done");var b=Ai(e,(function(e){0!==e.buttons&&_e(e)?v(e):y(e)})),E=Ai(e,y);e.state.selectingText=E,me(o.wrapper.ownerDocument,"mousemove",b),me(o.wrapper.ownerDocument,"mouseup",E)}function Ns(e,t){var n=t.anchor,r=t.head,i=Je(e.doc,n.line);if(0==st(n,r)&&n.sticky==r.sticky)return t;var o=pe(i);if(!o)return t;var a=de(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=de(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new ao(new at(n.line,h,m),r)}function ks(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Te(e,n))return xe(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ye(e,n,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),xe(t)}}function _s(e,t){return ks(e,t,"gutterClick",!0)}function Os(e,t){Gn(e.display,t)||Is(e,t)||be(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Is(e,t){return!!Te(e,"gutterContextMenu")&&ks(e,t,"gutterContextMenu",!1)}function Ds(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}vs.prototype.compare=function(e,t,n){return this.time+gs>e&&0==st(t,this.pos)&&n==this.button},r(ys,"clickRepeat"),r(bs,"onMouseDown"),r(Es,"handleMappedButton"),r(Ts,"configureMouse"),r(ws,"leftButtonDown"),r(Cs,"leftButtonStartDrag"),r(Ss,"rangeForUnit"),r(xs,"leftButtonSelect"),r(Ns,"bidiSimplify"),r(ks,"gutterEvent"),r(_s,"clickInGutter"),r(Os,"onContextMenu"),r(Is,"contextMenuInGutter"),r(Ds,"themeChanged");var Ls={toString:function(){return"CodeMirror.Init"}},As={},Ms={};function Rs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}r(n,"option"),e.defineOption=n,e.Init=Ls,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,mo(e)}),!0),n("indentUnit",2,mo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),pr(e),jr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(at(r,o))}r++}));for(var i=n.length-1;i>=0;i--)oa(e.doc,t,n[i],at(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ls&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!T),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ds(e),Ji(e)}),!0),n("keyMap","default",(function(e,t,n){var r=za(t),i=n!=Ls&&za(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ps,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Ji(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return bi(e)}),!0),n("scrollbarStyle","native",(function(e){wi(e),bi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Ji(e)}),!0),n("firstLineNumber",1,Ji,!0),n("lineNumberFormatter",(function(e){return e}),Ji,!0),n("showCursorWhenSelecting",!1,Hr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Zr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Fs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hr,!0),n("singleCursorHeightPerLine",!0,Hr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Fs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?me:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ps(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(k(e.display.wrapper,"CodeMirror-wrap"),un(e)),Rr(e),jr(e),pr(e),setTimeout((function(){return bi(e)}),100)}function js(e,t){var n=this;if(!(this instanceof js))return new js(e,t);this.options=t=t?j(t):{},j(As,t,!1);var r=t.value;"string"==typeof r?r=new Sa(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new js.inputStyles[t.inputStyle](this),o=this.display=new Zi(e,r,i,t);for(var a in o.wrapper.CodeMirror=this,Ds(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new U,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),s&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Vs(this),La(),Si(this),this.curOp.forceUpdate=!0,Eo(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Jr(n)}),20):Zr(this),Ms)Ms.hasOwnProperty(a)&&Ms[a](this,t[a],Ls);Qi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}r(o,"finishTouch"),r(a,"isMouseLikeTouchEvent"),r(u,"farAway"),me(t.scroller,"touchstart",(function(r){if(!be(e,r)&&!a(r)&&!_s(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Gn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=e.coordsChar(t.activeTouch,"page");i=!r.prev||u(r,r.prev)?new ao(a,a):!r.prev.prev||u(r,r.prev.prev)?e.findWordAt(a):new ao(at(a.line,0),pt(e.doc,at(a.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),Ce(n)}o()})),me(t.scroller,"touchcancel",o),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),mi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return io(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Ne(t)},over:function(t){be(e,t)||(_a(e,t),Ne(t))},start:function(t){return ka(e,t)},drop:Ai(e,Na),leave:function(t){be(e,t)||Oa(e)}};var c=t.input.getField();me(c,"keyup",(function(t){return fs.call(e,t)})),me(c,"keydown",Ai(e,cs)),me(c,"keypress",Ai(e,ps)),me(c,"focus",(function(t){return Jr(e,t)})),me(c,"blur",(function(t){return Zr(e,t)}))}r(Rs,"defineOptions"),r(Fs,"dragDropChanged"),r(Ps,"wrappingChanged"),r(js,"CodeMirror"),js.defaults=As,js.optionHandlers=Ms,r(Vs,"registerEventHandlers");var Us=[];function Bs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Et(e,t).state:n="prev");var a=e.options.tabSize,s=Je(o,t),l=V(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==q||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?V(Je(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(fa,l=Re(t),u=null;if(s&&r.ranges.length>1)if($s&&$s.text.join("\n")==t){if(r.ranges.length%$s.text.length==0){u=[];for(var c=0;c<$s.text.length;c++)u.push(o.splitLines($s.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Y(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=at(h.line,h.ch-n):e.state.overwrite&&!s?m=at(m.line,Math.min(Je(o,m.line).text.length,m.ch+X(l).length)):s&&$s&&$s.lineWise&&$s.text.join("\n")==l.join("\n")&&(h=m=at(h.line,0)));var g={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Zo(e.doc,g),In(e,"inputRead",e,g)}t&&!s&&zs(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Li(t,(function(){return Hs(t,n,0,null,"paste")})),!0}function zs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Bs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Je(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Bs(e,i.head.line,"smart"));a&&In(e,"electricInput",e,i.head.line)}}}function Ws(e){for(var t=[],n=[],r=0;rn&&(Bs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Vo(this.doc,r,new ao(o,u[r].to()),H)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,at(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=bt(this,Je(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Je(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-sn(r):0)},defaultTextHeight:function(){return Ir(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=Er(this,pt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&oi(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Mi(cs),triggerOnKeyPress:Mi(ps),triggerOnKeyUp:fs,triggerOnMouseDown:Mi(bs),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Mi((function(e){zs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Rr(this),ye(this,"refresh",this)})),swapDoc:Mi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Eo(this,e),pr(this),this.display.input.reset(),ui(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,In(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ys(e,t,n,i,o){var a=t,s=n,l=Je(e,t.line),u=o&&"rtl"==e.direction?-n:n;function c(){var n=t.line+u;return!(n=e.first+e.size)&&(t=new at(n,t.ch,t.sticky),l=Je(e,n))}function d(r){var a;if("codepoint"==i){var s=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(s))a=null;else{var d=n>0?s>=55296&&s<56320:s>=56320&&s<57343;a=new at(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(d?2:1))),-n)}}else a=o?Ya(e.cm,l,t,n):Qa(l,t,n);if(null==a){if(r||!c())return!1;t=Xa(o,e.cm,l,t.line,u)}else t=a;return!0}if(r(c,"findNextLine"),r(d,"moveOnce"),"char"==i||"codepoint"==i)d();else if("column"==i)d(!0);else if("word"==i||"group"==i)for(var f=null,p="group"==i,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(n<0)||d(!m);m=!1){var g=l.text.charAt(t.ch)||"\n",v=re(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||m||v||(v="s"),f&&f!=v){n<0&&(n=1,d(),t.sticky="after");break}if(v&&(f=v),n>0&&!d(!m))break}var y=Qo(e,t,a,s,!0);return lt(a,y)&&(y.hitSide=!0),y}function Js(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Ir(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Cr(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}r(qs,"setLastCopied"),r(Hs,"applyTextInput"),r(Gs,"handlePaste"),r(zs,"triggerElectric"),r(Ws,"copyableRanges"),r(Ks,"disableBrowserMagic"),r(Qs,"hiddenTextarea"),r(Xs,"addEditorMethods"),r(Ys,"findPosH"),r(Js,"findPosV");var Zs=r((function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}),"ContentEditableInput");function el(e,t){var n=nr(e,t.line);if(!n||n.hidden)return null;var r=Je(e.doc,t.line),i=Zn(n,r,t.line),o=pe(r,e.doc.direction),a="left";o&&(a=de(o,t.ch)%2?"right":"left");var s=sr(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function nl(e,t){return t&&(e.bad=!0),e}function rl(e,t,n,i,o){var a="",s=!1,l=e.doc.lineSeparator(),u=!1;function c(e){return function(t){return t.id==e}}function d(){s&&(a+=l,u&&(a+=l),s=u=!1)}function f(e){e&&(d(),a+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void f(n);var r,a=t.getAttribute("cm-marker");if(a){var h=e.findMarks(at(i,0),at(o+1,0),c(+a));return void(h.length&&(r=h[0].find(0))&&f(Ze(e.doc,r.from,r.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&d();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&el(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=at(a.line-1,Je(r.doc,a.line-1).length)),s.ch==Je(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Pr(r,a.line))?(t=nt(i.view[0].line),n=i.view[0].node):(t=nt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Pr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=nt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(rl(r,n,u,t,l)),f=Ze(r.doc,at(t,0),at(l,Je(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);pa.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var T=at(t,p),w=at(l,f.length?X(f).length-h:0);return d.length>1||d[0]||st(T,w)?(oa(r.doc,d,T,w,"+input"),!0):void 0},Zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zs.prototype.reset=function(){this.forceCompositionEnd()},Zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Zs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Li(this.cm,(function(){return jr(e.cm)}))},Zs.prototype.setUneditable=function(e){e.contentEditable="false"},Zs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ai(this.cm,Hs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Zs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Zs.prototype.onContextMenu=function(){},Zs.prototype.resetPosition=function(){},Zs.prototype.needsContentAttribute=!0,r(el,"posToDOM"),r(tl,"isInGutter"),r(nl,"badPos"),r(rl,"domTextBetween"),r(il,"domToPos"),r(ol,"locateNodeInLineView");var al=r((function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null}),"TextareaInput");function sl(e,t){if((t=t?j(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=l.getValue()}var o;if(r(i,"save"),e.form&&(me(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var a=e.form;o=a.submit;try{var s=a.submit=function(){i(),a.submit=o,a.submit(),a.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var l=js((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l}function ll(e){e.off=ve,e.on=me,e.wheelEventPixels=ro,e.Doc=Sa,e.splitLines=Re,e.countColumn=V,e.findColumn=W,e.isWordChar=ne,e.Pass=q,e.signal=ye,e.Line=cn,e.changeEnd=uo,e.scrollbarModel=Ti,e.Pos=at,e.cmpPos=st,e.modes=Ue,e.mimeModes=Be,e.resolveMode=He,e.getMode=Ge,e.modeExtensions=ze,e.extendMode=We,e.copyState=Ke,e.startState=Xe,e.innerMode=Qe,e.commands=Ja,e.keyMap=Va,e.keyName=Ga,e.isModifierKey=qa,e.lookupKey=$a,e.normalizeKeyMap=Ba,e.StringStream=Ye,e.SharedTextMarker=ya,e.TextMarker=ga,e.LineWidget=fa,e.e_preventDefault=Ce,e.e_stopPropagation=Se,e.e_stop=Ne,e.addClass=M,e.contains=L,e.rmClass=k,e.keyNames=Ra}al.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var o=this.textarea;function a(e){if(!be(i,e)){if(i.somethingSelected())qs({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ws(i);qs({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),F(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(o.style.width="0px"),me(o,"input",(function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),me(o,"paste",(function(e){be(i,e)||Gs(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),r(a,"prepareCopyCut"),me(o,"cut",a),me(o,"copy",a),me(e.scroller,"paste",(function(t){if(!Gn(e,t)&&!be(i,t)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var r=new Event("paste");r.clipboardData=t.clipboardData,o.dispatchEvent(r)}})),me(e.lineSpace,"selectstart",(function(t){Gn(e,t)||Ce(t)})),me(o,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),me(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},al.prototype.createField=function(e){this.wrapper=Qs(),this.textarea=this.wrapper.firstChild},al.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},al.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Gr(e);if(e.options.moveInputWithCursor){var i=Er(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},al.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},al.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&F(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},al.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,r(n,"p"),t.polling.set(20,n)},al.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Fe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(r.length,i.length);a1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Fr(n,e),c=i.scroller.scrollTop;if(a&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&Ai(n,qo)(n.doc,lo(a),H);var d,p=o.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(d=window.scrollY),i.input.focus(),u&&window.scrollTo(null,d),i.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=y,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),r(v,"prepareSelectAllHack"),r(y,"rehide"),s&&l>=9&&v(),S){Ne(e);var g=r((function(){ve(window,"mouseup",g),setTimeout(y,20)}),"mouseup");me(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=o.selectionStart){var e=n.somethingSelected(),r="​"+(e?o.value:"");o.value="⇚",o.value=r,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=r.length,i.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,o.style.cssText=p,s&&l<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=o.selectionStart)){(!s||s&&l<9)&&v();var e=0,a=r((function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Ai(n,Yo)(n):e++<10?i.detectingSelectAll=setTimeout(a,500):(i.selForContextMenu=null,i.input.reset())}),"poll");i.detectingSelectAll=setTimeout(a,200)}}},al.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,r(sl,"fromTextArea"),r(ll,"addLegacyProps"),Rs(js),Xs(js);var ul="iter insert remove copy getEditor constructor".split(" ");for(var cl in Sa.prototype)Sa.prototype.hasOwnProperty(cl)&&B(ul,cl)<0&&(js.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sa.prototype[cl]));return we(Sa),js.inputStyles={textarea:al,contenteditable:Zs},js.defineMode=function(e){js.defaults.mode||"null"==e||(js.defaults.mode=e),$e.apply(this,arguments)},js.defineMIME=qe,js.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),js.defineMIME("text/plain","null"),js.defineExtension=function(e,t){js.prototype[e]=t},js.defineDocExtension=function(e,t){Sa.prototype[e]=t},js.fromTextArea=sl,ll(js),js.version="5.65.3",js}()}(o);var a=o.exports;e.C=a;var s=i({__proto__:null,default:a},[o.exports]);e.c=s},void 0===(o=r.apply(t,i))||(e.exports=o)},6754:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t={},n=/[^\s\u00a0]/,i=e.Pos,o=e.cmpPos;function a(e){var t=e.search(n);return-1==t?0:t}function s(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(i(t.line,0)))&&!/^[\'\"\`]/.test(n)}function l(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}r(a,"firstNonWS"),e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,r=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),u=o[s].to();l.line>=r||(u.line>=r&&(u=i(r,0)),r=l.line,null==a?n.uncomment(l,u,e)?a="un":(n.lineComment(l,u,e),a="line"):"un"==a?n.uncomment(l,u,e):n.lineComment(l,u,e))}})),r(s,"probablyInsideString"),r(l,"getMode"),e.defineExtension("lineComment",(function(e,r,o){o||(o=t);var u=this,c=l(u,e),d=u.getLine(e.line);if(null!=d&&!s(u,e,d)){var f=o.lineComment||c.lineComment;if(f){var p=Math.min(0!=r.ch||r.line==e.line?r.line+1:r.line,u.lastLine()+1),h=null==o.padding?" ":o.padding,m=o.commentBlankLines||e.line==r.line;u.operation((function(){if(o.indent){for(var t=null,r=e.line;rs.length)&&(t=s)}for(r=e.line;rf||s.operation((function(){if(0!=a.fullLines){var t=n.test(s.getLine(f));s.replaceRange(p+d,i(f)),s.replaceRange(c+p,i(e.line,0));var l=a.blockCommentLead||u.blockCommentLead;if(null!=l)for(var h=e.line+1;h<=f;++h)(h!=f||t)&&s.replaceRange(l+p,i(h,0))}else{var m=0==o(s.getCursor("to"),r),g=!s.somethingSelected();s.replaceRange(d,r),m&&s.setSelection(g?r:s.getCursor("from"),r),s.replaceRange(c,e)}}))}}else(a.lineComment||u.lineComment)&&0!=a.fullLines&&s.lineComment(e,r,a)})),e.defineExtension("uncomment",(function(e,r,o){o||(o=t);var a,s=this,u=l(s,e),c=Math.min(0!=r.ch||r.line==e.line?r.line:r.line-1,s.lastLine()),d=Math.min(e.line,c),f=o.lineComment||u.lineComment,p=[],h=null==o.padding?" ":o.padding;e:if(f){for(var m=d;m<=c;++m){var g=s.getLine(m),v=g.indexOf(f);if(v>-1&&!/comment/.test(s.getTokenTypeAt(i(m,v+1)))&&(v=-1),-1==v&&n.test(g))break e;if(v>-1&&n.test(g.slice(0,v)))break e;p.push(g)}if(s.operation((function(){for(var e=d;e<=c;++e){var t=p[e-d],n=t.indexOf(f),r=n+f.length;n<0||(t.slice(r,r+h.length)==h&&(r+=h.length),a=!0,s.replaceRange("",i(e,n),i(e,r)))}})),a)return!0}var y=o.blockCommentStart||u.blockCommentStart,b=o.blockCommentEnd||u.blockCommentEnd;if(!y||!b)return!1;var E=o.blockCommentLead||u.blockCommentLead,T=s.getLine(d),w=T.indexOf(y);if(-1==w)return!1;var C=c==d?T:s.getLine(c),S=C.indexOf(b,c==d?w+y.length:0),x=i(d,w+1),N=i(c,S+1);if(-1==S||!/comment/.test(s.getTokenTypeAt(x))||!/comment/.test(s.getTokenTypeAt(N))||s.getRange(x,N,"\n").indexOf(b)>-1)return!1;var k=T.lastIndexOf(y,e.ch),_=-1==k?-1:T.slice(0,e.ch).indexOf(b,k+y.length);if(-1!=k&&-1!=_&&_+b.length!=e.ch)return!1;_=C.indexOf(b,r.ch);var O=C.slice(r.ch).lastIndexOf(y,_-r.ch);return k=-1==_||-1==O?-1:r.ch+O,(-1==_||-1==k||k==r.ch)&&(s.operation((function(){s.replaceRange("",i(c,S-(h&&C.slice(S-h.length,S)==h?h.length:0)),i(c,S+b.length));var e=w+y.length;if(h&&T.slice(e,e+h.length)==h&&(e+=h.length),s.replaceRange("",i(d,w),i(d,e)),E)for(var t=d+1;t<=c;++t){var r=s.getLine(t),o=r.indexOf(E);if(-1!=o&&!n.test(r.slice(0,o))){var a=o+E.length;h&&r.slice(a,a+h.length)==h&&(a+=h.length),s.replaceRange("",i(t,o),i(t,a))}}})),!0)}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.c=a})?r.apply(t,i):r)||(e.exports=o)},8058:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.d=e.a=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}r(t,"dialogDiv"),r(n,"closeNotification"),e.defineExtension("openDialog",(function(i,o,a){a||(a={}),n(this,null);var s=t(this,i,a.bottom),l=!1,u=this;function c(t){if("string"==typeof t)f.value=t;else{if(l)return;l=!0,e.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),u.focus(),a.onClose&&a.onClose(s)}}r(c,"close");var d,f=s.getElementsByTagName("input")[0];return f?(f.focus(),a.value&&(f.value=a.value,!1!==a.selectValueOnOpen&&f.select()),a.onInput&&e.on(f,"input",(function(e){a.onInput(e,f.value,c)})),a.onKeyUp&&e.on(f,"keyup",(function(e){a.onKeyUp(e,f.value,c)})),e.on(f,"keydown",(function(t){a&&a.onKeyDown&&a.onKeyDown(t,f.value,c)||((27==t.keyCode||!1!==a.closeOnEnter&&13==t.keyCode)&&(f.blur(),e.e_stop(t),c()),13==t.keyCode&&o(f.value,t))})),!1!==a.closeOnBlur&&e.on(s,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(d=s.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),u.focus()})),!1!==a.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(i,o,a){n(this,null);var s=t(this,i,a&&a.bottom),l=s.getElementsByTagName("button"),u=!1,c=this,d=1;function f(){u||(u=!0,e.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),c.focus())}r(f,"close"),l[0].focus();for(var p=0;pn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){function t(t,i,a,s){if(a&&a.call){var l=a;a=null}else l=o(t,a,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var u=o(t,a,"minFoldSize");function c(e){var n=l(t,i);if(!n||n.to.line-n.from.linet.firstLine();)i=e.Pos(i.line-1,0),d=c(!1);if(d&&!d.cleared&&"unfold"!==s){var f=n(t,a,d);e.on(f,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(d.from,d.to,{replacedWith:f,clearOnEnter:o(t,a,"clearOnEnter"),__isFold:!0});p.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,d.from,d.to)}}function n(e,t,n){var r=o(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var i=document.createTextNode(r);(r=document.createElement("span")).appendChild(i),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}r(t,"doFold"),r(n,"makeWidget"),e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=u){if(f&&l&&f.test(l.className))return;r=a(i.indicatorOpen)}}(r||l)&&e.setGutterMarker(n,i.gutter,r)}))}function l(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function u(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){s(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,r){var i=e.state.foldGutter;if(i){var a=i.options;if(r==a.gutter){var s=o(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){u(e)}),n.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?u(e):e.operation((function(){n.fromt.to&&(s(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r=0;e--)t(n[e])}Object.defineProperty(e,"__esModule",{value:!0}),e.f=t,(0,Object.defineProperty)(t,"name",{value:"forEachState",configurable:!0})})?n.apply(t,[t]):n)||(e.exports=r)},7139:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(6856),n(9196),n(3573),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Argument",{enumerable:!0,get:function(){return t.A}}),Object.defineProperty(e,"ArgumentIcon",{enumerable:!0,get:function(){return t.ac}}),Object.defineProperty(e,"Button",{enumerable:!0,get:function(){return t.aH}}),Object.defineProperty(e,"ButtonGroup",{enumerable:!0,get:function(){return t.aI}}),Object.defineProperty(e,"ChevronDownIcon",{enumerable:!0,get:function(){return t.ad}}),Object.defineProperty(e,"ChevronLeftIcon",{enumerable:!0,get:function(){return t.ae}}),Object.defineProperty(e,"ChevronUpIcon",{enumerable:!0,get:function(){return t.af}}),Object.defineProperty(e,"CloseIcon",{enumerable:!0,get:function(){return t.ag}}),Object.defineProperty(e,"CopyIcon",{enumerable:!0,get:function(){return t.ah}}),Object.defineProperty(e,"DOC_EXPLORER_PLUGIN",{enumerable:!0,get:function(){return t._}}),Object.defineProperty(e,"DefaultValue",{enumerable:!0,get:function(){return t.D}}),Object.defineProperty(e,"DeprecatedArgumentIcon",{enumerable:!0,get:function(){return t.ai}}),Object.defineProperty(e,"DeprecatedEnumValueIcon",{enumerable:!0,get:function(){return t.aj}}),Object.defineProperty(e,"DeprecatedFieldIcon",{enumerable:!0,get:function(){return t.ak}}),Object.defineProperty(e,"DeprecationReason",{enumerable:!0,get:function(){return t.w}}),Object.defineProperty(e,"Dialog",{enumerable:!0,get:function(){return t.aJ}}),Object.defineProperty(e,"Directive",{enumerable:!0,get:function(){return t.x}}),Object.defineProperty(e,"DirectiveIcon",{enumerable:!0,get:function(){return t.al}}),Object.defineProperty(e,"DocExplorer",{enumerable:!0,get:function(){return t.y}}),Object.defineProperty(e,"DocsFilledIcon",{enumerable:!0,get:function(){return t.am}}),Object.defineProperty(e,"DocsIcon",{enumerable:!0,get:function(){return t.an}}),Object.defineProperty(e,"EditorContext",{enumerable:!0,get:function(){return t.E}}),Object.defineProperty(e,"EditorContextProvider",{enumerable:!0,get:function(){return t.d}}),Object.defineProperty(e,"EnumValueIcon",{enumerable:!0,get:function(){return t.ao}}),Object.defineProperty(e,"ExecuteButton",{enumerable:!0,get:function(){return t.aS}}),Object.defineProperty(e,"ExecutionContext",{enumerable:!0,get:function(){return t.r}}),Object.defineProperty(e,"ExecutionContextProvider",{enumerable:!0,get:function(){return t.s}}),Object.defineProperty(e,"ExplorerContext",{enumerable:!0,get:function(){return t.z}}),Object.defineProperty(e,"ExplorerContextProvider",{enumerable:!0,get:function(){return t.B}}),Object.defineProperty(e,"ExplorerSection",{enumerable:!0,get:function(){return t.F}}),Object.defineProperty(e,"FieldDocumentation",{enumerable:!0,get:function(){return t.G}}),Object.defineProperty(e,"FieldIcon",{enumerable:!0,get:function(){return t.ap}}),Object.defineProperty(e,"FieldLink",{enumerable:!0,get:function(){return t.J}}),Object.defineProperty(e,"GraphiQLProvider",{enumerable:!0,get:function(){return t.a3}}),Object.defineProperty(e,"HISTORY_PLUGIN",{enumerable:!0,get:function(){return t.$}}),Object.defineProperty(e,"HeaderEditor",{enumerable:!0,get:function(){return t.H}}),Object.defineProperty(e,"History",{enumerable:!0,get:function(){return t.W}}),Object.defineProperty(e,"HistoryContext",{enumerable:!0,get:function(){return t.X}}),Object.defineProperty(e,"HistoryContextProvider",{enumerable:!0,get:function(){return t.Y}}),Object.defineProperty(e,"HistoryIcon",{enumerable:!0,get:function(){return t.aq}}),Object.defineProperty(e,"ImagePreview",{enumerable:!0,get:function(){return t.I}}),Object.defineProperty(e,"ImplementsIcon",{enumerable:!0,get:function(){return t.ar}}),Object.defineProperty(e,"KeyboardShortcutIcon",{enumerable:!0,get:function(){return t.as}}),Object.defineProperty(e,"Listbox",{enumerable:!0,get:function(){return t.aL}}),Object.defineProperty(e,"MagnifyingGlassIcon",{enumerable:!0,get:function(){return t.at}}),Object.defineProperty(e,"MarkdownContent",{enumerable:!0,get:function(){return t.aM}}),Object.defineProperty(e,"Menu",{enumerable:!0,get:function(){return t.aK}}),Object.defineProperty(e,"MergeIcon",{enumerable:!0,get:function(){return t.au}}),Object.defineProperty(e,"PenIcon",{enumerable:!0,get:function(){return t.av}}),Object.defineProperty(e,"PlayIcon",{enumerable:!0,get:function(){return t.aw}}),Object.defineProperty(e,"PluginContext",{enumerable:!0,get:function(){return t.a0}}),Object.defineProperty(e,"PluginContextProvider",{enumerable:!0,get:function(){return t.a1}}),Object.defineProperty(e,"PlusIcon",{enumerable:!0,get:function(){return t.ax}}),Object.defineProperty(e,"PrettifyIcon",{enumerable:!0,get:function(){return t.ay}}),Object.defineProperty(e,"QueryEditor",{enumerable:!0,get:function(){return t.Q}}),Object.defineProperty(e,"ReloadIcon",{enumerable:!0,get:function(){return t.az}}),Object.defineProperty(e,"ResponseEditor",{enumerable:!0,get:function(){return t.R}}),Object.defineProperty(e,"RootTypeIcon",{enumerable:!0,get:function(){return t.aA}}),Object.defineProperty(e,"SchemaContext",{enumerable:!0,get:function(){return t.a4}}),Object.defineProperty(e,"SchemaContextProvider",{enumerable:!0,get:function(){return t.a5}}),Object.defineProperty(e,"SchemaDocumentation",{enumerable:!0,get:function(){return t.K}}),Object.defineProperty(e,"Search",{enumerable:!0,get:function(){return t.M}}),Object.defineProperty(e,"SettingsIcon",{enumerable:!0,get:function(){return t.aB}}),Object.defineProperty(e,"Spinner",{enumerable:!0,get:function(){return t.aN}}),Object.defineProperty(e,"StarFilledIcon",{enumerable:!0,get:function(){return t.aC}}),Object.defineProperty(e,"StarIcon",{enumerable:!0,get:function(){return t.aD}}),Object.defineProperty(e,"StopIcon",{enumerable:!0,get:function(){return t.aE}}),Object.defineProperty(e,"StorageContext",{enumerable:!0,get:function(){return t.a7}}),Object.defineProperty(e,"StorageContextProvider",{enumerable:!0,get:function(){return t.a8}}),Object.defineProperty(e,"Tab",{enumerable:!0,get:function(){return t.aO}}),Object.defineProperty(e,"Tabs",{enumerable:!0,get:function(){return t.aP}}),Object.defineProperty(e,"ToolbarButton",{enumerable:!0,get:function(){return t.aR}}),Object.defineProperty(e,"ToolbarListbox",{enumerable:!0,get:function(){return t.aT}}),Object.defineProperty(e,"ToolbarMenu",{enumerable:!0,get:function(){return t.aU}}),Object.defineProperty(e,"Tooltip",{enumerable:!0,get:function(){return t.aQ}}),Object.defineProperty(e,"TypeDocumentation",{enumerable:!0,get:function(){return t.N}}),Object.defineProperty(e,"TypeIcon",{enumerable:!0,get:function(){return t.aF}}),Object.defineProperty(e,"TypeLink",{enumerable:!0,get:function(){return t.O}}),Object.defineProperty(e,"UnStyledButton",{enumerable:!0,get:function(){return t.aG}}),Object.defineProperty(e,"VariableEditor",{enumerable:!0,get:function(){return t.V}}),Object.defineProperty(e,"useAutoCompleteLeafs",{enumerable:!0,get:function(){return t.u}}),Object.defineProperty(e,"useCopyQuery",{enumerable:!0,get:function(){return t.e}}),Object.defineProperty(e,"useDragResize",{enumerable:!0,get:function(){return t.ab}}),Object.defineProperty(e,"useEditorContext",{enumerable:!0,get:function(){return t.f}}),Object.defineProperty(e,"useExecutionContext",{enumerable:!0,get:function(){return t.v}}),Object.defineProperty(e,"useExplorerContext",{enumerable:!0,get:function(){return t.U}}),Object.defineProperty(e,"useHeaderEditor",{enumerable:!0,get:function(){return t.h}}),Object.defineProperty(e,"useHistoryContext",{enumerable:!0,get:function(){return t.Z}}),Object.defineProperty(e,"useMergeQuery",{enumerable:!0,get:function(){return t.j}}),Object.defineProperty(e,"usePluginContext",{enumerable:!0,get:function(){return t.a2}}),Object.defineProperty(e,"usePrettifyEditors",{enumerable:!0,get:function(){return t.k}}),Object.defineProperty(e,"useQueryEditor",{enumerable:!0,get:function(){return t.m}}),Object.defineProperty(e,"useResponseEditor",{enumerable:!0,get:function(){return t.n}}),Object.defineProperty(e,"useSchemaContext",{enumerable:!0,get:function(){return t.a6}}),Object.defineProperty(e,"useStorageContext",{enumerable:!0,get:function(){return t.a9}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return t.aa}}),Object.defineProperty(e,"useVariableEditor",{enumerable:!0,get:function(){return t.q}})})?r.apply(t,i):r)||(e.exports=o)},4840:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(6980),n(3573),n(6856),n(5609),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a){"use strict";e.C.registerHelper("hint","graphql",((t,n)=>{const{schema:o,externalFragments:a}=n;if(!o)return;const s=t.getCursor(),l=t.getTokenAt(s),u=null!==l.type&&/"|\w/.test(l.string[0])?l.start:l.end,c=new i.P(s.line,u),d={list:(0,r.g)(o,t.getValue(),c,l,a).map((e=>({text:e.label,type:e.type,description:e.documentation,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason}))),from:{line:s.line,ch:u},to:{line:s.line,ch:l.end}};return(null==d?void 0:d.list)&&d.list.length>0&&(d.from=e.C.Pos(d.from.line,d.from.ch),d.to=e.C.Pos(d.to.line,d.to.ch),e.C.signal(t,"hasCompletion",t,d,l)),d}))})?r.apply(t,i):r)||(e.exports=o)},4712:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(2635),n(6856),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty,s=(e,t)=>a(e,"name",{value:t,configurable:!0});function l(e,t,n){const r=u(n,d(t.string));if(!r)return;const i=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:r,from:{line:e.line,ch:i},to:{line:e.line,ch:t.end}}}function u(e,t){return t?c(c(e.map((e=>({proximity:f(d(e.text),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length)).map((e=>e.entry)):c(e,(e=>!e.isDeprecated))}function c(e,t){const n=e.filter(t);return 0===n.length?e:n}function d(e){return e.toLowerCase().replaceAll(/\W/g,"")}function f(e,t){let n=p(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function p(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}function h(e,n,r){const i="Invalid"===n.state.kind?n.state.prevState:n.state,{kind:o,step:a}=i;if("Document"===o&&0===a)return l(e,n,[{text:"{"}]);const{variableToType:s}=r;if(!s)return;const u=m(s,n.state);if("Document"===o||"Variable"===o&&0===a)return l(e,n,Object.keys(s).map((e=>({text:`"${e}": `,type:s[e]}))));if(("ObjectValue"===o||"ObjectField"===o&&0===a)&&u.fields)return l(e,n,Object.keys(u.fields).map((e=>u.fields[e])).map((e=>({text:`"${e.name}": `,type:e.type,description:e.description}))));if("StringValue"===o||"NumberValue"===o||"BooleanValue"===o||"NullValue"===o||"ListValue"===o&&1===a||"ObjectField"===o&&2===a||"Variable"===o&&2===a){const r=u.type?(0,t.getNamedType)(u.type):void 0;if(r instanceof t.GraphQLInputObjectType)return l(e,n,[{text:"{"}]);if(r instanceof t.GraphQLEnumType)return l(e,n,r.getValues().map((e=>({text:`"${e.name}"`,type:r,description:e.description}))));if(r===t.GraphQLBoolean)return l(e,n,[{text:"true",type:t.GraphQLBoolean,description:"Not false."},{text:"false",type:t.GraphQLBoolean,description:"Not true."}])}}function m(e,r){const i={type:null,fields:null};return(0,n.f)(r,(n=>{switch(n.kind){case"Variable":i.type=e[n.name];break;case"ListValue":{const e=i.type?(0,t.getNullableType)(i.type):void 0;i.type=e instanceof t.GraphQLList?e.ofType:null;break}case"ObjectValue":{const e=i.type?(0,t.getNamedType)(i.type):void 0;i.fields=e instanceof t.GraphQLInputObjectType?e.getFields():null;break}case"ObjectField":{const e=n.name&&i.fields?i.fields[n.name]:null;i.type=null==e?void 0:e.type;break}}})),i}s(l,"hintList"),s(u,"filterAndSortList"),s(c,"filterNonEmpty"),s(d,"normalizeText"),s(f,"getProximity"),s(p,"lexicalDistance"),e.C.registerHelper("hint","graphql-variables",((t,n)=>{const r=t.getCursor(),i=t.getTokenAt(r),o=h(r,i,n);return(null==o?void 0:o.list)&&o.list.length>0&&(o.from=e.C.Pos(o.from.line,o.from.ch),o.to=e.C.Pos(o.to.line,o.to.ch),e.C.signal(t,"hasCompletion",t,o,i)),o})),s(h,"getVariablesHint"),s(m,"getTypeInfo")})?r.apply(t,i):r)||(e.exports=o)},6856:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(9196),n(3573),n(1850)],r=function(e,t,r,i){"use strict";function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}Object.defineProperty(e,"__esModule",{value:!0}),e.$=void 0,e.A=YE,e.B=BE,e.C=void 0,e.D=OE,e.E=void 0,e.F=aT,e.G=cT,e.H=uS,e.I=fS,e.J=Dw,e.K=mT,e.L=void 0,e.M=Sw,e.N=Mw,e.O=KE,e.P=void 0,e.Q=vS,e.R=CS,e.U=e.T=e.S=void 0,e.V=NS,e.W=iE,e.X=void 0,e.Y=Zb,e.a0=e.a=e._=e.Z=void 0,e.a1=Qw,e.a2=void 0,e.a3=OS,e.a4=void 0,e.a5=AE,e.a7=e.a6=void 0,e.a8=ge,e.aR=e.aQ=e.aP=e.aO=e.aN=e.aM=e.aL=e.aK=e.aJ=e.aI=e.aH=e.aG=e.aF=e.aE=e.aD=e.aC=e.aB=e.aA=e.a9=void 0,e.aS=qS,e.aU=e.aT=void 0,e.aa=LS,e.ab=FS,e.az=e.ay=e.ax=e.aw=e.av=e.au=e.at=e.as=e.ar=e.aq=e.ap=e.ao=e.an=e.am=e.al=e.ak=e.aj=e.ai=e.ah=e.ag=e.af=e.ae=e.ad=e.ac=void 0,e.b=ki,e.c=void 0,e.d=rS,e.e=lC,e.f=void 0,e.g=Zi,e.h=hC,e.i=void 0,e.j=uC,e.k=cC,e.l=_i,e.m=CC,e.n=ES,e.o=ji,e.p=Di,e.q=JC,e.r=void 0,e.s=cE,e.t=Ii,e.u=dC,e.v=void 0,e.w=eT,e.x=rT,e.y=qw,e.z=void 0,t=a(t),i=a(i);var s=Object.defineProperty,l=Object.defineProperties,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,p=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&p(e,n,t[n]);if(c)for(var n of c(t))f.call(t,n)&&p(e,n,t[n]);return e},m=(e,t)=>l(e,u(t)),g=(e,t)=>s(e,"name",{value:t,configurable:!0}),v=(e,t)=>{var n={};for(var r in e)d.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&c)for(var r of c(e))t.indexOf(r)<0&&f.call(e,r)&&(n[r]=e[r]);return n};function y(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{const r=e.subscribe({next:e=>{t(e),r.unsubscribe()},error:n,complete:()=>{n(new Error("no value resolved"))}})}))}function w(e){return"object"==typeof e&&null!==e&&"subscribe"in e&&"function"==typeof e.subscribe}function C(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}function S(e){return new Promise(((t,n)=>{var r;const i=null===(r=("return"in e?e:e[Symbol.asyncIterator]()).return)||void 0===r?void 0:r.bind(e);("next"in e?e:e[Symbol.asyncIterator]()).next.bind(e)().then((e=>{t(e.value),null==i||i()})).catch((e=>{n(e)}))}))}function x(e){return Promise.resolve(e).then((e=>C(e)?S(e):w(e)?T(e):e))}g(y,"r$2"),g(b,"clsx"),g(E,"isPromise"),g(T,"observableToPromise"),g(w,"isObservable"),g(C,"isAsyncIterable"),g(S,"asyncIterableToPromise"),g(x,"fetcherReturnToPromise"),globalThis&&globalThis.__awaiter;var N=globalThis&&globalThis.__await||function(e){return this instanceof N?(this.v=e,this):new N(e)};function k(e){return JSON.stringify(e,null,2)}function _(e){return Object.assign(Object.assign({},e),{message:e.message,stack:e.stack})}function O(e){return e instanceof Error?_(e):e}function I(e){return Array.isArray(e)?k({errors:e.map((e=>O(e)))}):k({errors:[O(e)]})}function D(e){return k(e)}function L(e,t,n){const i=[];if(!e||!t)return{insertions:i,result:t};let o;try{o=(0,r.parse)(t)}catch(e){return{insertions:i,result:t}}const a=n||A,s=new r.TypeInfo(e);return(0,r.visit)(o,{leave(e){s.leave(e)},enter(e){if(s.enter(e),"Field"===e.kind&&!e.selectionSet){const n=M(P(s.getType()),a);if(n&&e.loc){const o=F(t,e.loc.start);i.push({index:e.loc.end,string:" "+(0,r.print)(n).replaceAll("\n","\n"+o)})}}}}),{insertions:i,result:R(t,i)}}function A(e){if(!("getFields"in e))return[];const t=e.getFields();if(t.id)return["id"];if(t.edges)return["edges"];if(t.node)return["node"];const n=[];return Object.keys(t).forEach((e=>{(0,r.isLeafType)(t[e].type)&&n.push(e)})),n}function M(e,t){const n=(0,r.getNamedType)(e);if(!e||(0,r.isLeafType)(e))return;const i=t(n);return Array.isArray(i)&&0!==i.length&&"getFields"in n?{kind:r.Kind.SELECTION_SET,selections:i.map((e=>{const i=n.getFields()[e],o=i?i.type:null;return{kind:r.Kind.FIELD,name:{kind:r.Kind.NAME,value:e},selectionSet:M(o,t)}}))}:void 0}function R(e,t){if(0===t.length)return e;let n="",r=0;return t.forEach((t=>{let{index:i,string:o}=t;n+=e.slice(r,i)+o,r=i})),n+=e.slice(r),n}function F(e,t){let n=t,r=t;for(;n;){const t=e.charCodeAt(n-1);if(10===t||13===t||8232===t||8233===t)break;n--,9!==t&&11!==t&&12!==t&&32!==t&&160!==t&&(r=n)}return e.slice(n,r)}function P(e){if(e)return e}function j(e,t){var n;const r=new Map,i=[];for(const o of e)if("Field"===o.kind){const e=t(o),a=r.get(e);if(null===(n=o.directives)||void 0===n?void 0:n.length){const e=Object.assign({},o);i.push(e)}else if((null==a?void 0:a.selectionSet)&&o.selectionSet)a.selectionSet.selections=[...a.selectionSet.selections,...o.selectionSet.selections];else if(!a){const t=Object.assign({},o);r.set(e,t),i.push(t)}}else i.push(o);return i}function V(e,t,n){var i;const o=n?(0,r.getNamedType)(n).name:null,a=[],s=[];for(let l of t){if("FragmentSpread"===l.kind){const t=l.name.value;if(!l.directives||0===l.directives.length){if(s.includes(t))continue;s.push(t)}const n=e[l.name.value];if(n){const{typeCondition:e,directives:t,selectionSet:i}=n;l={kind:r.Kind.INLINE_FRAGMENT,typeCondition:e,directives:t,selectionSet:i}}}if(l.kind===r.Kind.INLINE_FRAGMENT&&(!l.directives||0===(null===(i=l.directives)||void 0===i?void 0:i.length))){const t=l.typeCondition?l.typeCondition.name.value:null;if(!t||t===o){a.push(...V(e,l.selectionSet.selections,n));continue}}a.push(l)}return a}function U(e,t){const n=t?new r.TypeInfo(t):null,i=Object.create(null);for(const t of e.definitions)t.kind===r.Kind.FRAGMENT_DEFINITION&&(i[t.name.value]=t);const o={SelectionSet(e){const t=n?n.getParentType():null;let{selections:r}=e;return r=V(i,r,t),r=j(r,(e=>e.alias?e.alias.value:e.name.value)),Object.assign(Object.assign({},e),{selections:r})},FragmentDefinition(){return null}};return(0,r.visit)(e,n?(0,r.visitWithTypeInfo)(n,o):o)}function B(e,t,n){if(!n||n.length<1)return;const r=n.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value}));if(t&&r.includes(t))return t;if(t&&e){const n=e.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value})).indexOf(t);if(-1!==n&&n{for(const e in window.localStorage)0===e.indexOf(`${H}:`)&&window.localStorage.removeItem(e)}}}get(e){if(!this.storage)return null;const t=`${H}:${e}`,n=this.storage.getItem(t);return"null"===n||"undefined"===n?(this.storage.removeItem(t),null):n||null}set(e,t){let n=!1,r=null;if(this.storage){const i=`${H}:${e}`;if(t)try{this.storage.setItem(i,t)}catch(e){r=e instanceof Error?e:new Error(`${e}`),n=$(this.storage,e)}else this.storage.removeItem(i)}return{isQuotaError:n,error:r}}clear(){this.storage&&this.storage.clear()}}g(q,"StorageAPI");const H="graphiql";class G{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}get length(){return this.items.length}contains(e){return this.items.some((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName))}edit(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1,e),this.save())}delete(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1),this.save())}fetchRecent(){return this.items.at(-1)}fetchAll(){const e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]}push(e){const t=[...this.items,e];this.maxSize&&t.length>this.maxSize&&t.shift();for(let e=0;e<5;e++){const e=this.storage.set(this.key,JSON.stringify({[this.key]:t}));if(null==e?void 0:e.error){if(!e.isQuotaError||!this.maxSize)return;t.shift()}else this.items=t}}save(){this.storage.set(this.key,JSON.stringify({[this.key]:this.items}))}}g(G,"QueryStore");class z{constructor(e,t){this.storage=e,this.maxHistoryLength=t,this.updateHistory=(e,t,n,r)=>{if(this.shouldSaveQuery(e,t,n,this.history.fetchRecent())){this.history.push({query:e,variables:t,headers:n,operationName:r});const i=this.history.items,o=this.favorite.items;this.queries=i.concat(o)}},this.history=new G("queries",this.storage,this.maxHistoryLength),this.favorite=new G("favorites",this.storage,null),this.queries=[...this.history.fetchAll(),...this.favorite.fetchAll()]}shouldSaveQuery(e,t,n,i){if(!e)return!1;try{(0,r.parse)(e)}catch(e){return!1}if(e.length>1e5)return!1;if(!i)return!0;if(JSON.stringify(e)===JSON.stringify(i.query)){if(JSON.stringify(t)===JSON.stringify(i.variables)){if(JSON.stringify(n)===JSON.stringify(i.headers))return!1;if(n&&!i.headers)return!1}if(t&&!i.variables)return!1}return!0}toggleFavorite(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};this.favorite.contains(a)?o&&(a.favorite=!1,this.favorite.delete(a)):(a.favorite=!0,this.favorite.push(a)),this.queries=[...this.history.items,...this.favorite.items]}editLabel(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};o?this.favorite.edit(Object.assign(Object.assign({},a),{favorite:o})):this.history.edit(a),this.queries=[...this.history.items,...this.favorite.items]}}g(z,"HistoryStore");var W=Object.defineProperty,K=g(((e,t)=>W(e,"name",{value:t,configurable:!0})),"__name$G");function Q(e){const n=(0,t.createContext)(null);return n.displayName=e,n}function X(e){function n(r){var i;const o=(0,t.useContext)(e);if(null===o&&(null==r?void 0:r.nonNull))throw new Error(`Tried to use \`${(null==(i=r.caller)?void 0:i.name)||n.caller.name}\` without the necessary context. Make sure to render the \`${e.displayName}Provider\` component higher up the tree.`);return o}return g(n,"useGivenContext"),K(n,"useGivenContext"),Object.defineProperty(n,"name",{value:`use${e.displayName}`}),n}g(Q,"createNullableContext"),K(Q,"createNullableContext"),g(X,"createContextHook"),K(X,"createContextHook");var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}e.c=Y,g(J,"getDefaultExportFromCjs"),g(Z,"getAugmentedNamespace");var ee={exports:{}},te={};function ne(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,g((function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}),"toObject"),g(ne,"shouldUseNative"),ne()&&Object.assign;var re=t.default,ie=60103;if(te.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var oe=Symbol.for;ie=oe("react.element"),te.Fragment=oe("react.fragment")}var ae=re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,se=Object.prototype.hasOwnProperty,le={key:!0,ref:!0,__self:!0,__source:!0};function ue(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)se.call(t,r)&&!le.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:ie,type:e,key:o,ref:a,props:i,_owner:ae.current}}g(ue,"q$1"),te.jsx=ue,te.jsxs=ue,ee.exports=te;const ce=ee.exports.jsx,de=ee.exports.jsxs,fe=ee.exports.Fragment;var pe=Object.defineProperty,he=g(((e,t)=>pe(e,"name",{value:t,configurable:!0})),"__name$F");const me=Q("StorageContext");function ge(e){const n=(0,t.useRef)(!0),[r,i]=(0,t.useState)(new q(e.storage));return(0,t.useEffect)((()=>{n.current?n.current=!1:i(new q(e.storage))}),[e.storage]),ce(me.Provider,{value:r,children:e.children})}e.a7=me,g(ge,"StorageContextProvider"),he(ge,"StorageContextProvider");const ve=X(me);e.a9=ve;const ye=10,be=2;function Ee(e){return Te(e,[])}function Te(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return we(e,t);default:return String(e)}}function we(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(Ce(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Te(t,n)}else if(Array.isArray(e))return xe(e,n);return Se(e,n)}function Ce(e){return"function"==typeof e.toJSON}function Se(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>be?"["+Ne(e)+"]":"{ "+n.map((e=>{let[n,r]=e;return n+": "+Te(r,t)})).join(", ")+" }"}function xe(e,t){if(0===e.length)return"[]";if(t.length>be)return"[Array]";const n=Math.min(ye,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Ne(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}function ke(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}let _e;function Oe(e){return 9===e||32===e}function Ie(e){return e>=48&&e<=57}function De(e){return e>=97&&e<=122||e>=65&&e<=90}function Le(e){return De(e)||95===e}function Ae(e){return De(e)||Ie(e)||95===e}function Me(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||Oe(e.charCodeAt(0)))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,l=e.endsWith("\\"),u=s||l,c=!(null!=t&&t.minimize)&&(!i||e.length>70||u||o||a);let d="";const f=i&&Oe(e.charCodeAt(0));return(c&&!f||o)&&(d+="\n"),d+=n,(c||u)&&(d+="\n"),'"""'+d+'"""'}function Re(e){return`"${e.replace(Pe,je)}"`}var Fe;g(Ee,"inspect"),g(Te,"formatValue"),g(we,"formatObjectValue"),g(Ce,"isJSONable"),g(Se,"formatObject"),g(xe,"formatArray"),g(Ne,"getObjectTag"),g(ke,"invariant"),(Fe=_e||(_e={})).QUERY="QUERY",Fe.MUTATION="MUTATION",Fe.SUBSCRIPTION="SUBSCRIPTION",Fe.FIELD="FIELD",Fe.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",Fe.FRAGMENT_SPREAD="FRAGMENT_SPREAD",Fe.INLINE_FRAGMENT="INLINE_FRAGMENT",Fe.VARIABLE_DEFINITION="VARIABLE_DEFINITION",Fe.SCHEMA="SCHEMA",Fe.SCALAR="SCALAR",Fe.OBJECT="OBJECT",Fe.FIELD_DEFINITION="FIELD_DEFINITION",Fe.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",Fe.INTERFACE="INTERFACE",Fe.UNION="UNION",Fe.ENUM="ENUM",Fe.ENUM_VALUE="ENUM_VALUE",Fe.INPUT_OBJECT="INPUT_OBJECT",Fe.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",g(Oe,"isWhiteSpace$2"),g(Ie,"isDigit$1"),g(De,"isLetter$1"),g(Le,"isNameStart"),g(Ae,"isNameContinue"),g(Me,"printBlockString"),g(Re,"printString");const Pe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function je(e){return Ve[e.charCodeAt(0)]}g(je,"escapedReplacer");const Ve=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function Ue(e,t){if(!Boolean(e))throw new Error(t)}g(Ue,"devAssert");const Be={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},$e=new Set(Object.keys(Be));function qe(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&$e.has(t)}let He,Ge;var ze,We;g(qe,"isNode"),(We=He||(He={})).QUERY="query",We.MUTATION="mutation",We.SUBSCRIPTION="subscription",(ze=Ge||(Ge={})).NAME="Name",ze.DOCUMENT="Document",ze.OPERATION_DEFINITION="OperationDefinition",ze.VARIABLE_DEFINITION="VariableDefinition",ze.SELECTION_SET="SelectionSet",ze.FIELD="Field",ze.ARGUMENT="Argument",ze.FRAGMENT_SPREAD="FragmentSpread",ze.INLINE_FRAGMENT="InlineFragment",ze.FRAGMENT_DEFINITION="FragmentDefinition",ze.VARIABLE="Variable",ze.INT="IntValue",ze.FLOAT="FloatValue",ze.STRING="StringValue",ze.BOOLEAN="BooleanValue",ze.NULL="NullValue",ze.ENUM="EnumValue",ze.LIST="ListValue",ze.OBJECT="ObjectValue",ze.OBJECT_FIELD="ObjectField",ze.DIRECTIVE="Directive",ze.NAMED_TYPE="NamedType",ze.LIST_TYPE="ListType",ze.NON_NULL_TYPE="NonNullType",ze.SCHEMA_DEFINITION="SchemaDefinition",ze.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",ze.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",ze.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",ze.FIELD_DEFINITION="FieldDefinition",ze.INPUT_VALUE_DEFINITION="InputValueDefinition",ze.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",ze.UNION_TYPE_DEFINITION="UnionTypeDefinition",ze.ENUM_TYPE_DEFINITION="EnumTypeDefinition",ze.ENUM_VALUE_DEFINITION="EnumValueDefinition",ze.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",ze.DIRECTIVE_DEFINITION="DirectiveDefinition",ze.SCHEMA_EXTENSION="SchemaExtension",ze.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",ze.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",ze.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",ze.UNION_TYPE_EXTENSION="UnionTypeExtension",ze.ENUM_TYPE_EXTENSION="EnumTypeExtension",ze.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const Ke=Object.freeze({});function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be;const r=new Map;for(const e of Object.values(Ge))r.set(e,Xe(t,e));let i,o,a,s=Array.isArray(e),l=[e],u=-1,c=[],d=e;const f=[],p=[];do{u++;const e=u===l.length,v=e&&0!==c.length;if(e){if(o=0===p.length?void 0:f[f.length-1],d=a,a=p.pop(),v)if(s){d=d.slice();let e=0;for(const[t,n]of c){const r=t-e;null===n?(d.splice(r,1),e++):d[r]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of c)d[e]=t}u=i.index,l=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:l[u],d=a[o],null==d)continue;f.push(o)}let y;if(!Array.isArray(d)){var h,m;qe(d)||Ue(!1,`Invalid AST Node: ${Ee(d)}.`);const n=e?null===(h=r.get(d.kind))||void 0===h?void 0:h.leave:null===(m=r.get(d.kind))||void 0===m?void 0:m.enter;if(y=null==n?void 0:n.call(t,d,o,a,f,p),y===Ke)break;if(!1===y){if(!e){f.pop();continue}}else if(void 0!==y&&(c.push([o,y]),!e)){if(!qe(y)){f.pop();continue}d=y}}var g;void 0===y&&v&&c.push([o,d]),e?f.pop():(i={inArray:s,index:u,keys:l,edits:c,prev:i},s=Array.isArray(d),l=s?d:null!==(g=n[d.kind])&&void 0!==g?g:[],u=-1,c=[],a&&p.push(a),a=d)}while(void 0!==i);return 0!==c.length?c[c.length-1][1]:e}function Xe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ye(e){return Qe(e,Je)}g(Qe,"visit"),g(Xe,"getEnterLeaveForKind"),g(Ye,"print");const Je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ze(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=tt("(",Ze(e.variableDefinitions,", "),")"),n=Ze([e.operation,Ze([e.name,t]),Ze(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:e=>{let{variable:t,type:n,defaultValue:r,directives:i}=e;return t+": "+n+tt(" = ",r)+tt(" ",Ze(i," "))}},SelectionSet:{leave:e=>{let{selections:t}=e;return et(t)}},Field:{leave(e){let{alias:t,name:n,arguments:r,directives:i,selectionSet:o}=e;const a=tt("",t,": ")+n;let s=a+tt("(",Ze(r,", "),")");return s.length>80&&(s=a+tt("(\n",nt(Ze(r,"\n")),"\n)")),Ze([s,Ze(i," "),o]," ")}},Argument:{leave:e=>{let{name:t,value:n}=e;return t+": "+n}},FragmentSpread:{leave:e=>{let{name:t,directives:n}=e;return"..."+t+tt(" ",Ze(n," "))}},InlineFragment:{leave:e=>{let{typeCondition:t,directives:n,selectionSet:r}=e;return Ze(["...",tt("on ",t),Ze(n," "),r]," ")}},FragmentDefinition:{leave:e=>{let{name:t,typeCondition:n,variableDefinitions:r,directives:i,selectionSet:o}=e;return`fragment ${t}${tt("(",Ze(r,", "),")")} on ${n} ${tt("",Ze(i," ")," ")}`+o}},IntValue:{leave:e=>{let{value:t}=e;return t}},FloatValue:{leave:e=>{let{value:t}=e;return t}},StringValue:{leave:e=>{let{value:t,block:n}=e;return n?Me(t):Re(t)}},BooleanValue:{leave:e=>{let{value:t}=e;return t?"true":"false"}},NullValue:{leave:()=>"null"},EnumValue:{leave:e=>{let{value:t}=e;return t}},ListValue:{leave:e=>{let{values:t}=e;return"["+Ze(t,", ")+"]"}},ObjectValue:{leave:e=>{let{fields:t}=e;return"{"+Ze(t,", ")+"}"}},ObjectField:{leave:e=>{let{name:t,value:n}=e;return t+": "+n}},Directive:{leave:e=>{let{name:t,arguments:n}=e;return"@"+t+tt("(",Ze(n,", "),")")}},NamedType:{leave:e=>{let{name:t}=e;return t}},ListType:{leave:e=>{let{type:t}=e;return"["+t+"]"}},NonNullType:{leave:e=>{let{type:t}=e;return t+"!"}},SchemaDefinition:{leave:e=>{let{description:t,directives:n,operationTypes:r}=e;return tt("",t,"\n")+Ze(["schema",Ze(n," "),et(r)]," ")}},OperationTypeDefinition:{leave:e=>{let{operation:t,type:n}=e;return t+": "+n}},ScalarTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r}=e;return tt("",t,"\n")+Ze(["scalar",n,Ze(r," ")]," ")}},ObjectTypeDefinition:{leave:e=>{let{description:t,name:n,interfaces:r,directives:i,fields:o}=e;return tt("",t,"\n")+Ze(["type",n,tt("implements ",Ze(r," & ")),Ze(i," "),et(o)]," ")}},FieldDefinition:{leave:e=>{let{description:t,name:n,arguments:r,type:i,directives:o}=e;return tt("",t,"\n")+n+(rt(r)?tt("(\n",nt(Ze(r,"\n")),"\n)"):tt("(",Ze(r,", "),")"))+": "+i+tt(" ",Ze(o," "))}},InputValueDefinition:{leave:e=>{let{description:t,name:n,type:r,defaultValue:i,directives:o}=e;return tt("",t,"\n")+Ze([n+": "+r,tt("= ",i),Ze(o," ")]," ")}},InterfaceTypeDefinition:{leave:e=>{let{description:t,name:n,interfaces:r,directives:i,fields:o}=e;return tt("",t,"\n")+Ze(["interface",n,tt("implements ",Ze(r," & ")),Ze(i," "),et(o)]," ")}},UnionTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,types:i}=e;return tt("",t,"\n")+Ze(["union",n,Ze(r," "),tt("= ",Ze(i," | "))]," ")}},EnumTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,values:i}=e;return tt("",t,"\n")+Ze(["enum",n,Ze(r," "),et(i)]," ")}},EnumValueDefinition:{leave:e=>{let{description:t,name:n,directives:r}=e;return tt("",t,"\n")+Ze([n,Ze(r," ")]," ")}},InputObjectTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,fields:i}=e;return tt("",t,"\n")+Ze(["input",n,Ze(r," "),et(i)]," ")}},DirectiveDefinition:{leave:e=>{let{description:t,name:n,arguments:r,repeatable:i,locations:o}=e;return tt("",t,"\n")+"directive @"+n+(rt(r)?tt("(\n",nt(Ze(r,"\n")),"\n)"):tt("(",Ze(r,", "),")"))+(i?" repeatable":"")+" on "+Ze(o," | ")}},SchemaExtension:{leave:e=>{let{directives:t,operationTypes:n}=e;return Ze(["extend schema",Ze(t," "),et(n)]," ")}},ScalarTypeExtension:{leave:e=>{let{name:t,directives:n}=e;return Ze(["extend scalar",t,Ze(n," ")]," ")}},ObjectTypeExtension:{leave:e=>{let{name:t,interfaces:n,directives:r,fields:i}=e;return Ze(["extend type",t,tt("implements ",Ze(n," & ")),Ze(r," "),et(i)]," ")}},InterfaceTypeExtension:{leave:e=>{let{name:t,interfaces:n,directives:r,fields:i}=e;return Ze(["extend interface",t,tt("implements ",Ze(n," & ")),Ze(r," "),et(i)]," ")}},UnionTypeExtension:{leave:e=>{let{name:t,directives:n,types:r}=e;return Ze(["extend union",t,Ze(n," "),tt("= ",Ze(r," | "))]," ")}},EnumTypeExtension:{leave:e=>{let{name:t,directives:n,values:r}=e;return Ze(["extend enum",t,Ze(n," "),et(r)]," ")}},InputObjectTypeExtension:{leave:e=>{let{name:t,directives:n,fields:r}=e;return Ze(["extend input",t,Ze(n," "),et(r)]," ")}}};function Ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function et(e){return tt("{\n",nt(Ze(e,"\n")),"\n}")}function tt(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function nt(e){return tt(" ",e.replace(/\n/g,"\n "))}function rt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function it(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function ot(e){return"object"==typeof e&&null!==e}g(Ze,"join"),g(et,"block$2"),g(tt,"wrap"),g(nt,"indent"),g(rt,"hasMultilineItems"),g(it,"isIterableObject"),g(ot,"isObjectLike");const at=5;function st(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,at),s=a.pop();return i+a.join(", ")+", or "+s+"?"}function lt(e){return e}g(st,"didYouMean"),g(lt,"identityFunc");const ut=g((function(e,t){return e instanceof t}),"instanceOf");function ct(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function dt(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function ft(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function pt(e,t){let n=0,r=0;for(;n0);let s=0;do{++r,s=10*s+o-ht,o=t.charCodeAt(r)}while(gt(o)&&s>0);if(as)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}g(ct,"keyMap"),g(dt,"keyValMap"),g(ft,"mapValue"),g(pt,"naturalCompare");const ht=48,mt=57;function gt(e){return!isNaN(e)&&ht<=e&&e<=mt}function vt(e,t){const n=Object.create(null),r=new yt(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:pt(e,t)}))}g(gt,"isDigit"),g(vt,"suggestionList");class yt{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=bt(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=bt(n),i=this._inputArray;if(r.lengtht)return;const s=this._rows;for(let e=0;e<=a;e++)s[0][e]=e;for(let e=1;e<=o;e++){const n=s[(e-1)%3],o=s[e%3];let l=o[0]=e;for(let t=1;t<=a;t++){const a=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+a);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=s[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const l=s[o%3][a];return l<=t?l:void 0}}function bt(e){const t=e.length,n=new Array(t);for(let r=0;r=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Ct(e){return St(e.source,wt(e.source,e.start))}function St(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,l=t.column+s,u=`${e.name}:${a}:${l}\n`,c=r.split(/\r\n|[\n\r]/g),d=c[i];if(d.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+xt([[a-1+" |",c[i-1]],[`${a} |`,d],["|","^".padStart(l)],[`${a+1} |`,c[i+1]]])}function xt(e){const t=e.filter((e=>{let[t,n]=e;return void 0!==n})),n=Math.max(...t.map((e=>{let[t]=e;return t.length})));return t.map((e=>{let[t,r]=e;return t.padStart(n)+(r?" "+r:"")})).join("\n")}function Nt(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}g(wt,"getLocation"),g(Ct,"printLocation"),g(St,"printSourceLocation"),g(xt,"printPrefixedLines"),g(Nt,"toNormalizedOptions");class kt extends Error{constructor(e){for(var t,n,r,i=arguments.length,o=new Array(i>1?i-1:0),a=1;ae.loc)).filter((e=>null!=e)));this.source=null!=l?l:null==p||null===(n=p[0])||void 0===n?void 0:n.source,this.positions=null!=u?u:null==p?void 0:p.map((e=>e.start)),this.locations=u&&l?u.map((e=>wt(l,e))):null==p?void 0:p.map((e=>wt(e.source,e.start)));const h=ot(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(r=null!=f?f:h)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,kt):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+Ct(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+St(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function _t(e){return void 0===e||0===e.length?void 0:e}function Ot(e,t){switch(e.kind){case Ge.NULL:return null;case Ge.INT:return parseInt(e.value,10);case Ge.FLOAT:return parseFloat(e.value);case Ge.STRING:case Ge.ENUM:case Ge.BOOLEAN:return e.value;case Ge.LIST:return e.values.map((e=>Ot(e,t)));case Ge.OBJECT:return dt(e.fields,(e=>e.name.value),(e=>Ot(e.value,t)));case Ge.VARIABLE:return null==t?void 0:t[e.name.value]}}function It(e){if(null!=e||Ue(!1,"Must provide name."),"string"==typeof e||Ue(!1,"Expected name to be a string."),0===e.length)throw new kt("Expected name to be a non-empty string.");for(let t=1;to(Ot(e,t)),this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(i=e.extensionASTNodes)&&void 0!==i?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||Ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${Ee(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||Ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||Ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}g(Kt,"GraphQLScalarType");class Qt{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>Yt(e),this._interfaces=()=>Xt(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||Ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${Ee(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:en(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Xt(e){var t;const n=zt(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||Ue(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Yt(e){const t=Wt(e.fields);return Zt(t)||Ue(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ft(t,((t,n)=>{var r;Zt(t)||Ue(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||Ue(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${Ee(t.resolve)}.`);const i=null!==(r=t.args)&&void 0!==r?r:{};return Zt(i)||Ue(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:It(n),description:t.description,type:t.type,args:Jt(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Et(t.extensions),astNode:t.astNode}}))}function Jt(e){return Object.entries(e).map((e=>{let[t,n]=e;return{name:It(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Et(n.extensions),astNode:n.astNode}}))}function Zt(e){return ot(e)&&!Array.isArray(e)}function en(e){return ft(e,(e=>({description:e.description,type:e.type,args:tn(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tn(e){return dt(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}g(Qt,"GraphQLObjectType"),g(Xt,"defineInterfaces"),g(Yt,"defineFieldMap"),g(Jt,"defineArguments"),g(Zt,"isPlainObj"),g(en,"fieldsToFieldsConfig"),g(tn,"argsToArgsConfig");class nn{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=Yt.bind(void 0,e),this._interfaces=Xt.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||Ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${Ee(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:en(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}g(nn,"GraphQLInterfaceType");class rn{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=on.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||Ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${Ee(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function on(e){const t=zt(e.types);return Array.isArray(t)||Ue(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}g(rn,"GraphQLUnionType"),g(on,"defineTypes");class an{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=ln(this.name,e.values),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=ct(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new kt(`Enum "${this.name}" cannot represent value: ${Ee(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Ee(e);throw new kt(`Enum "${this.name}" cannot represent non-string value: ${t}.`+sn(this,t))}const t=this.getValue(e);if(null==t)throw new kt(`Value "${e}" does not exist in "${this.name}" enum.`+sn(this,e));return t.value}parseLiteral(e,t){if(e.kind!==Ge.ENUM){const t=Ye(e);throw new kt(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+sn(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Ye(e);throw new kt(`Value "${t}" does not exist in "${this.name}" enum.`+sn(this,t),{nodes:e})}return n.value}toConfig(){const e=dt(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function sn(e,t){return st("the enum value",vt(t,e.getValues().map((e=>e.name))))}function ln(e,t){return Zt(t)||Ue(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map((t=>{let[n,r]=t;return Zt(r)||Ue(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${Ee(r)}.`),{name:Dt(n),description:r.description,value:void 0!==r.value?r.value:n,deprecationReason:r.deprecationReason,extensions:Et(r.extensions),astNode:r.astNode}}))}g(an,"GraphQLEnumType"),g(sn,"didYouMeanEnumValue"),g(ln,"defineEnumValues");class un{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=cn.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=ft(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function cn(e){const t=Wt(e.fields);return Zt(t)||Ue(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ft(t,((t,n)=>(!("resolve"in t)||Ue(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:It(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Et(t.extensions),astNode:t.astNode})))}g(un,"GraphQLInputObjectType"),g(cn,"defineInputFieldMap");const dn=2147483647,fn=-2147483648,pn=new Kt({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=yn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new kt(`Int cannot represent non-integer value: ${Ee(t)}`);if(n>dn||ndn||edn||t({description:{type:mn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new Ht(new qt(new Ht(Sn))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ht(Sn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Sn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Sn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ht(new qt(new Ht(wn))),resolve:e=>e.getDirectives()}})}),wn=new Qt({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},isRepeatable:{type:new Ht(gn),resolve:e=>e.isRepeatable},locations:{type:new Ht(new qt(new Ht(Cn))),resolve:e=>e.locations},args:{type:new Ht(new qt(new Ht(Nn))),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;return n?e.args:e.args.filter((e=>null==e.deprecationReason))}}})}),Cn=new an({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:_e.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_e.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_e.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_e.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_e.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_e.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_e.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_e.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_e.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_e.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_e.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_e.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_e.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_e.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_e.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_e.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_e.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_e.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_e.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Sn=new Qt({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ht(In),resolve(e){return At(e)?_n.SCALAR:Mt(e)?_n.OBJECT:Rt(e)?_n.INTERFACE:Ft(e)?_n.UNION:Pt(e)?_n.ENUM:jt(e)?_n.INPUT_OBJECT:Vt(e)?_n.LIST:Ut(e)?_n.NON_NULL:void ke(!1,`Unexpected type: "${Ee(e)}".`)}},name:{type:mn,resolve:e=>"name"in e?e.name:void 0},description:{type:mn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:mn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new Ht(xn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(Mt(e)||Rt(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new qt(new Ht(Sn)),resolve(e){if(Mt(e)||Rt(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new Ht(Sn)),resolve(e,t,n,r){let{schema:i}=r;if($t(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new Ht(kn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(Pt(e)){const t=e.getValues();return n?t:t.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new qt(new Ht(Nn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(jt(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},ofType:{type:Sn,resolve:e=>"ofType"in e?e.ofType:void 0}})}),xn=new Qt({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},args:{type:new Ht(new qt(new Ht(Nn))),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;return n?e.args:e.args.filter((e=>null==e.deprecationReason))}},type:{type:new Ht(Sn),resolve:e=>e.type},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})}),Nn=new Qt({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},type:{type:new Ht(Sn),resolve:e=>e.type},defaultValue:{type:mn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=bn(n,t);return r?Ye(r):null}},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})}),kn=new Qt({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})});let _n;var On;(On=_n||(_n={})).SCALAR="SCALAR",On.OBJECT="OBJECT",On.INTERFACE="INTERFACE",On.UNION="UNION",On.ENUM="ENUM",On.INPUT_OBJECT="INPUT_OBJECT",On.LIST="LIST",On.NON_NULL="NON_NULL";const In=new an({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:_n.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:_n.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:_n.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:_n.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:_n.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:_n.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:_n.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:_n.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Dn={name:"__schema",type:new Ht(Tn),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,r)=>{let{schema:i}=r;return i},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};e.S=Dn;const Ln={name:"__type",type:Sn,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ht(mn),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,t,n,r)=>{let{name:i}=t,{schema:o}=r;return o.getType(i)},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};e.T=Ln;const An={name:"__typename",type:new Ht(mn),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,r)=>{let{parentType:i}=r;return i.name},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};function Mn(e){let t;return Fn(e,(e=>{switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}})),t}function Rn(e,t,n){return n===Dn.name&&e.getQueryType()===t?Dn:n===Ln.name&&e.getQueryType()===t?Ln:n===An.name&&(0,r.isCompositeType)(t)?An:"getFields"in t?t.getFields()[n]:null}function Fn(e,t){const n=[];let r=e;for(;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function Pn(e){const t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i({proximity:$n(Bn(e.label),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length)).map((e=>e.entry)):Un(e,(e=>!e.isDeprecated))}function Un(e,t){const n=e.filter(t);return 0===n.length?e:n}function Bn(e){return e.toLowerCase().replaceAll(/\W/g,"")}function $n(e,t){let n=qn(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function qn(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}var Hn,Gn,zn,Wn,Kn,Qn,Xn,Yn,Jn,Zn,er,tr,nr,rr,ir,or,ar,sr,lr,ur,cr,dr,fr,pr,hr,mr,gr,vr,yr,br,Er;e.a=An,Object.freeze([Tn,wn,Cn,Sn,xn,Nn,kn,In]),g(Mn,"getDefinitionState"),g(Rn,"getFieldDef"),g(Fn,"forEachState"),g(Pn,"objectValues"),g(jn,"hintList"),g(Vn,"filterAndSortList"),g(Un,"filterNonEmpty"),g(Bn,"normalizeText"),g($n,"getProximity"),g(qn,"lexicalDistance"),function(e){function t(e){return"string"==typeof e}g(t,"is"),e.is=t}(Hn||(Hn={})),function(e){function t(e){return"string"==typeof e}g(t,"is"),e.is=t}(Gn||(Gn={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,g(t,"is"),e.is=t}(zn||(zn={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=0,e.MAX_VALUE=2147483647,g(t,"is"),e.is=t}(Wn||(Wn={})),function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=Wn.MAX_VALUE),t===Number.MAX_VALUE&&(t=Wn.MAX_VALUE),{line:e,character:t}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.uinteger(t.line)&&Ci.uinteger(t.character)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Kn||(Kn={})),function(e){function t(e,t,n,r){if(Ci.uinteger(e)&&Ci.uinteger(t)&&Ci.uinteger(n)&&Ci.uinteger(r))return{start:Kn.create(e,t),end:Kn.create(n,r)};if(Kn.is(e)&&Kn.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))}function n(e){var t=e;return Ci.objectLiteral(t)&&Kn.is(t.start)&&Kn.is(t.end)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Qn||(Qn={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return Ci.defined(t)&&Qn.is(t.range)&&(Ci.string(t.uri)||Ci.undefined(t.uri))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Xn||(Xn={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return Ci.defined(t)&&Qn.is(t.targetRange)&&Ci.string(t.targetUri)&&Qn.is(t.targetSelectionRange)&&(Qn.is(t.originSelectionRange)||Ci.undefined(t.originSelectionRange))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Yn||(Yn={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.numberRange(t.red,0,1)&&Ci.numberRange(t.green,0,1)&&Ci.numberRange(t.blue,0,1)&&Ci.numberRange(t.alpha,0,1)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Jn||(Jn={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return Ci.objectLiteral(t)&&Qn.is(t.range)&&Jn.is(t.color)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Zn||(Zn={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.label)&&(Ci.undefined(t.textEdit)||ur.is(t))&&(Ci.undefined(t.additionalTextEdits)||Ci.typedArray(t.additionalTextEdits,ur.is))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(er||(er={})),(Er=tr||(tr={})).Comment="comment",Er.Imports="imports",Er.Region="region",function(e){function t(e,t,n,r,i,o){var a={startLine:e,endLine:t};return Ci.defined(n)&&(a.startCharacter=n),Ci.defined(r)&&(a.endCharacter=r),Ci.defined(i)&&(a.kind=i),Ci.defined(o)&&(a.collapsedText=o),a}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.uinteger(t.startLine)&&Ci.uinteger(t.startLine)&&(Ci.undefined(t.startCharacter)||Ci.uinteger(t.startCharacter))&&(Ci.undefined(t.endCharacter)||Ci.uinteger(t.endCharacter))&&(Ci.undefined(t.kind)||Ci.string(t.kind))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(nr||(nr={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return Ci.defined(t)&&Xn.is(t.location)&&Ci.string(t.message)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(rr||(rr={})),(br=ir||(ir={})).Error=1,br.Warning=2,br.Information=3,br.Hint=4,(yr=or||(or={})).Unnecessary=1,yr.Deprecated=2,function(e){function t(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.href)}g(t,"is"),e.is=t}(ar||(ar={})),function(e){function t(e,t,n,r,i,o){var a={range:e,message:t};return Ci.defined(n)&&(a.severity=n),Ci.defined(r)&&(a.code=r),Ci.defined(i)&&(a.source=i),Ci.defined(o)&&(a.relatedInformation=o),a}function n(e){var t,n=e;return Ci.defined(n)&&Qn.is(n.range)&&Ci.string(n.message)&&(Ci.number(n.severity)||Ci.undefined(n.severity))&&(Ci.integer(n.code)||Ci.string(n.code)||Ci.undefined(n.code))&&(Ci.undefined(n.codeDescription)||Ci.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Ci.string(n.source)||Ci.undefined(n.source))&&(Ci.undefined(n.relatedInformation)||Ci.typedArray(n.relatedInformation,rr.is))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(sr||(sr={})),function(e){function t(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.title)&&Ci.string(t.command)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(lr||(lr={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.newText)&&Qn.is(t.range)}g(t,"replace"),e.replace=t,g(n,"insert"),e.insert=n,g(r,"del"),e.del=r,g(i,"is"),e.is=i}(ur||(ur={})),function(e){function t(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.label)&&(Ci.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Ci.string(t.description)||void 0===t.description)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(cr||(cr={})),function(e){function t(e){var t=e;return Ci.string(t)}g(t,"is"),e.is=t}(dr||(dr={})),function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}function r(e,t){return{range:e,newText:"",annotationId:t}}function i(e){var t=e;return ur.is(t)&&(cr.is(t.annotationId)||dr.is(t.annotationId))}g(t,"replace"),e.replace=t,g(n,"insert"),e.insert=n,g(r,"del"),e.del=r,g(i,"is"),e.is=i}(fr||(fr={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Ci.defined(t)&&Cr.is(t.textDocument)&&Array.isArray(t.edits)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(pr||(pr={})),function(e){function t(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"create"===t.kind&&Ci.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Ci.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ci.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(hr||(hr={})),function(e){function t(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(e){var t=e;return t&&"rename"===t.kind&&Ci.string(t.oldUri)&&Ci.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Ci.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ci.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(mr||(mr={})),function(e){function t(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"delete"===t.kind&&Ci.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Ci.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Ci.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(gr||(gr={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Ci.string(e.kind)?hr.is(e)||mr.is(e)||gr.is(e):pr.is(e)})))}g(t,"is"),e.is=t}(vr||(vr={}));var Tr,wr,Cr,Sr,xr,Nr,kr,_r,Or,Ir,Dr,Lr,Ar,Mr,Rr,Fr,Pr,jr,Vr,Ur,Br,$r,qr,Hr,Gr,zr,Wr,Kr,Qr,Xr,Yr,Jr,Zr,ei,ti,ni,ri,ii,oi,ai,si,li,ui,ci,di,fi,pi,hi,mi,gi,vi,yi,bi,Ei,Ti=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return g(e,"TextEditChangeImpl"),e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=ur.insert(e,t):dr.is(n)?(i=n,r=fr.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=fr.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=ur.replace(e,t):dr.is(n)?(i=n,r=fr.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=fr.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=ur.del(e):dr.is(t)?(r=t,n=fr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=fr.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),wi=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return g(e,"ChangeAnnotations"),e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(dr.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new wi(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(pr.is(e)){var n=new Ti(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ti(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}g(e,"WorkspaceChange"),Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Cr.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Ti(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Ti(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new wi,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(cr.is(t)||dr.is(t)?r=t:n=t,void 0===r?i=hr.create(e,n):(o=dr.is(r)?r:this._changeAnnotations.manage(r),i=hr.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,a;if(cr.is(n)||dr.is(n)?i=n:r=n,void 0===i?o=mr.create(e,t,r):(a=dr.is(i)?i:this._changeAnnotations.manage(i),o=mr.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(cr.is(t)||dr.is(t)?r=t:n=t,void 0===r?i=gr.create(e,n):(o=dr.is(r)?r:this._changeAnnotations.manage(r),i=gr.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}})(),function(e){function t(e){return{uri:e}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Tr||(Tr={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&Ci.integer(t.version)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(wr||(wr={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&(null===t.version||Ci.integer(t.version))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Cr||(Cr={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&Ci.string(t.languageId)&&Ci.integer(t.version)&&Ci.string(t.text)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Sr||(Sr={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.PlainText="plaintext",e.Markdown="markdown",g(t,"is"),e.is=t}(xr||(xr={})),function(e){function t(e){var t=e;return Ci.objectLiteral(e)&&xr.is(t.kind)&&Ci.string(t.value)}g(t,"is"),e.is=t}(Nr||(Nr={})),(Ei=kr||(kr={})).Text=1,Ei.Method=2,Ei.Function=3,Ei.Constructor=4,Ei.Field=5,Ei.Variable=6,Ei.Class=7,Ei.Interface=8,Ei.Module=9,Ei.Property=10,Ei.Unit=11,Ei.Value=12,Ei.Enum=13,Ei.Keyword=14,Ei.Snippet=15,Ei.Color=16,Ei.File=17,Ei.Reference=18,Ei.Folder=19,Ei.EnumMember=20,Ei.Constant=21,Ei.Struct=22,Ei.Event=23,Ei.Operator=24,Ei.TypeParameter=25,(bi=_r||(_r={})).PlainText=1,bi.Snippet=2,(Or||(Or={})).Deprecated=1,function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}function n(e){var t=e;return t&&Ci.string(t.newText)&&Qn.is(t.insert)&&Qn.is(t.replace)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Ir||(Ir={})),(yi=Dr||(Dr={})).asIs=1,yi.adjustIndentation=2,function(e){function t(e){var t=e;return t&&(Ci.string(t.detail)||void 0===t.detail)&&(Ci.string(t.description)||void 0===t.description)}g(t,"is"),e.is=t}(Lr||(Lr={})),function(e){function t(e){return{label:e}}g(t,"create"),e.create=t}(Ar||(Ar={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}g(t,"create"),e.create=t}(Mr||(Mr={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Ci.string(t)||Ci.objectLiteral(t)&&Ci.string(t.language)&&Ci.string(t.value)}g(t,"fromPlainText"),e.fromPlainText=t,g(n,"is"),e.is=n}(Rr||(Rr={})),function(e){function t(e){var t=e;return!!t&&Ci.objectLiteral(t)&&(Nr.is(t.contents)||Rr.is(t.contents)||Ci.typedArray(t.contents,Rr.is))&&(void 0===e.range||Qn.is(e.range))}g(t,"is"),e.is=t}(Fr||(Fr={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}g(t,"create"),e.create=t}(Pr||(Pr={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var s=r[a],l=e.offsetAt(s.range.start),u=e.offsetAt(s.range.end);if(!(u<=o))throw new Error("Overlapping edit");n=n.substring(0,l)+s.newText+n.substring(u,n.length),o=l}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);for(var a=0,s=0,l=0;a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Kn.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return Kn.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>0===this._pos,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{const e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=null,i=null;return"string"==typeof e?(i=new RegExp(e,arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"i":"g").test(t._sourceText.slice(t._pos,t._pos+e.length)),r=e):e instanceof RegExp&&(i=t._sourceText.slice(t._pos).match(e),r=null==i?void 0:i[0]),!(null==i||!("string"==typeof e||i instanceof Array&&t._sourceText.startsWith(i[0],t._pos)))&&(n&&(t._start=t._pos,r&&r.length&&(t._pos+=r.length)),i)},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{const e=this._sourceText.match(/\s*/);let t=0;if(e&&0!==e.length){const n=e[0];let r=0;for(;n.length>r;)9===n.charCodeAt(r)?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return n="string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t),n}}function ki(e){return{ofRule:e}}function _i(e,t){return{ofRule:e,isList:!0,separator:t}}function Oi(e,t){const n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every((t=>t.match&&!t.match(e)))},e}function Ii(e,t){return{style:t,match:t=>t.kind===e}}function Di(e,t){return{style:t||"punctuation",match:t=>"Punctuation"===t.kind&&t.value===e}}e.C=Ni,g(Ni,"CharacterStream"),g(ki,"opt"),g(_i,"list$1"),g(Oi,"butNot"),g(Ii,"t$2"),g(Di,"p$1");const Li=g((e=>" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e||" "===e),"isIgnored");e.i=Li;const Ai={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/};e.L=Ai;const Mi={Document:[_i("Definition")],Definition(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return r.Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[Ri("query"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],Mutation:[Ri("mutation"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],Subscription:[Ri("subscription"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],VariableDefinitions:[Di("("),_i("VariableDefinition"),Di(")")],VariableDefinition:["Variable",Di(":"),"Type",ki("DefaultValue")],Variable:[Di("$","variable"),Fi("variable")],DefaultValue:[Di("="),"Value"],SelectionSet:[Di("{"),_i("Selection"),Di("}")],Selection(e,t){return"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[Fi("property"),Di(":"),Fi("qualifier"),ki("Arguments"),_i("Directive"),ki("SelectionSet")],Field:[Fi("property"),ki("Arguments"),_i("Directive"),ki("SelectionSet")],Arguments:[Di("("),_i("Argument"),Di(")")],Argument:[Fi("attribute"),Di(":"),"Value"],FragmentSpread:[Di("..."),Fi("def"),_i("Directive")],InlineFragment:[Di("..."),ki("TypeCondition"),_i("Directive"),"SelectionSet"],FragmentDefinition:[Ri("fragment"),ki(Oi(Fi("def"),[Ri("on")])),"TypeCondition",_i("Directive"),"SelectionSet"],TypeCondition:[Ri("on"),"NamedType"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[Ii("Number","number")],StringValue:[{style:"string",match:e=>"String"===e.kind,update(e,t){t.value.startsWith('"""')&&(e.inBlockstring=!t.value.slice(3).endsWith('"""'))}}],BooleanValue:[Ii("Name","builtin")],NullValue:[Ii("Name","keyword")],EnumValue:[Fi("string-2")],ListValue:[Di("["),_i("Value"),Di("]")],ObjectValue:[Di("{"),_i("ObjectField"),Di("}")],ObjectField:[Fi("attribute"),Di(":"),"Value"],Type(e){return"["===e.value?"ListType":"NonNullType"},ListType:[Di("["),"Type",Di("]"),ki(Di("!"))],NonNullType:["NamedType",ki(Di("!"))],NamedType:[Pi("atom")],Directive:[Di("@","meta"),Fi("meta"),ki("Arguments")],DirectiveDef:[Ri("directive"),Di("@","meta"),Fi("meta"),ki("ArgumentsDef"),Ri("on"),_i("DirectiveLocation",Di("|"))],InterfaceDef:[Ri("interface"),Fi("atom"),ki("Implements"),_i("Directive"),Di("{"),_i("FieldDef"),Di("}")],Implements:[Ri("implements"),_i("NamedType",Di("&"))],DirectiveLocation:[Fi("string-2")],SchemaDef:[Ri("schema"),_i("Directive"),Di("{"),_i("OperationTypeDef"),Di("}")],OperationTypeDef:[Fi("keyword"),Di(":"),Fi("atom")],ScalarDef:[Ri("scalar"),Fi("atom"),_i("Directive")],ObjectTypeDef:[Ri("type"),Fi("atom"),ki("Implements"),_i("Directive"),Di("{"),_i("FieldDef"),Di("}")],FieldDef:[Fi("property"),ki("ArgumentsDef"),Di(":"),"Type",_i("Directive")],ArgumentsDef:[Di("("),_i("InputValueDef"),Di(")")],InputValueDef:[Fi("attribute"),Di(":"),"Type",ki("DefaultValue"),_i("Directive")],UnionDef:[Ri("union"),Fi("atom"),_i("Directive"),Di("="),_i("UnionMember",Di("|"))],UnionMember:["NamedType"],EnumDef:[Ri("enum"),Fi("atom"),_i("Directive"),Di("{"),_i("EnumValueDef"),Di("}")],EnumValueDef:[Fi("string-2"),_i("Directive")],InputDef:[Ri("input"),Fi("atom"),_i("Directive"),Di("{"),_i("InputValueDef"),Di("}")],ExtendDef:[Ri("extend"),"ExtensionDefinition"],ExtensionDefinition(e){switch(e.value){case"schema":return r.Kind.SCHEMA_EXTENSION;case"scalar":return r.Kind.SCALAR_TYPE_EXTENSION;case"type":return r.Kind.OBJECT_TYPE_EXTENSION;case"interface":return r.Kind.INTERFACE_TYPE_EXTENSION;case"union":return r.Kind.UNION_TYPE_EXTENSION;case"enum":return r.Kind.ENUM_TYPE_EXTENSION;case"input":return r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},[r.Kind.SCHEMA_EXTENSION]:["SchemaDef"],[r.Kind.SCALAR_TYPE_EXTENSION]:["ScalarDef"],[r.Kind.OBJECT_TYPE_EXTENSION]:["ObjectTypeDef"],[r.Kind.INTERFACE_TYPE_EXTENSION]:["InterfaceDef"],[r.Kind.UNION_TYPE_EXTENSION]:["UnionDef"],[r.Kind.ENUM_TYPE_EXTENSION]:["EnumDef"],[r.Kind.INPUT_OBJECT_TYPE_EXTENSION]:["InputDef"]};function Ri(e){return{style:"keyword",match:t=>"Name"===t.kind&&t.value===e}}function Fi(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){e.name=t.value}}}function Pi(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){var n;(null===(n=e.prevState)||void 0===n?void 0:n.prevState)&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}function ji(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{eatWhitespace:e=>e.eatWhile(Li),lexRules:Ai,parseRules:Mi,editorConfig:{}};return{startState(){const t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return $i(e.parseRules,t,r.Kind.DOCUMENT),t},token(t,n){return Vi(t,n,e)}}}function Vi(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:i,parseRules:o,eatWhitespace:a,editorConfig:s}=n;if(t.rule&&0===t.rule.length?qi(t):t.needsAdvance&&(t.needsAdvance=!1,Hi(t,!0)),e.sol()){const n=(null==s?void 0:s.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return"ws";const l=Wi(i,e);if(!l)return e.match(/\S+/)||e.match(/\s/),$i(Bi,t,"Invalid"),"invalidchar";if("Comment"===l.kind)return $i(Bi,t,"Comment"),"comment";const u=Ui({},t);if("Punctuation"===l.kind)if(/^[{([]/.test(l.value))void 0!==t.indentLevel&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(l.value)){const e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e.at(-1){const t=[];if(e)try{(0,r.visit)((0,r.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch(e){return[]}return t}),"collectFragmentDefs"),Yi=[r.Kind.SCHEMA_DEFINITION,r.Kind.OPERATION_TYPE_DEFINITION,r.Kind.SCALAR_TYPE_DEFINITION,r.Kind.OBJECT_TYPE_DEFINITION,r.Kind.INTERFACE_TYPE_DEFINITION,r.Kind.UNION_TYPE_DEFINITION,r.Kind.ENUM_TYPE_DEFINITION,r.Kind.INPUT_OBJECT_TYPE_DEFINITION,r.Kind.DIRECTIVE_DEFINITION,r.Kind.SCHEMA_EXTENSION,r.Kind.SCALAR_TYPE_EXTENSION,r.Kind.OBJECT_TYPE_EXTENSION,r.Kind.INTERFACE_TYPE_EXTENSION,r.Kind.UNION_TYPE_EXTENSION,r.Kind.ENUM_TYPE_EXTENSION,r.Kind.INPUT_OBJECT_TYPE_EXTENSION],Ji=g((e=>{let t=!1;if(e)try{(0,r.visit)((0,r.parse)(e),{enter(e){if("Document"!==e.kind)return!!Yi.includes(e.kind)&&(t=!0,r.BREAK)}})}catch(e){return t}return t}),"hasTypeSystemDefinitions");function Zi(e,t,n,i,o,a){var s;const l=Object.assign(Object.assign({},a),{schema:e}),u=i||go(t,n),c="Invalid"===u.state.kind?u.state.prevState:u.state,d=(null==a?void 0:a.mode)||wo(t,null==a?void 0:a.uri);if(!c)return[];const{kind:f,step:p,prevState:h}=c,m=bo(e,u.state);if(f===Ki.DOCUMENT)return d===Eo.TYPE_SYSTEM?no(u):ro(u);if(f===Ki.EXTEND_DEF)return io(u);if((null===(s=null==h?void 0:h.prevState)||void 0===s?void 0:s.kind)===Ki.EXTENSION_DEFINITION&&c.name)return jn(u,[]);if((null==h?void 0:h.kind)===r.Kind.SCALAR_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isScalarType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.OBJECT_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isObjectType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.INTERFACE_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isInterfaceType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.UNION_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isUnionType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.ENUM_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isEnumType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.INPUT_OBJECT_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isInputObjectType).map((e=>({label:e.name,kind:Si.Function}))));if(f===Ki.IMPLEMENTS||f===Ki.NAMED_TYPE&&(null==h?void 0:h.kind)===Ki.IMPLEMENTS)return so(u,c,e,t,m);if(f===Ki.SELECTION_SET||f===Ki.FIELD||f===Ki.ALIASED_FIELD)return oo(u,m,l);if(f===Ki.ARGUMENTS||f===Ki.ARGUMENT&&0===p){const{argDefs:e}=m;if(e)return jn(u,e.map((e=>{var t;return{label:e.name,insertText:e.name+": ",command:Qi,detail:String(e.type),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,kind:Si.Variable,type:e.type}})))}if((f===Ki.OBJECT_VALUE||f===Ki.OBJECT_FIELD&&0===p)&&m.objectFieldDefs){const e=Pn(m.objectFieldDefs),t=f===Ki.OBJECT_VALUE?Si.Value:Si.Field;return jn(u,e.map((e=>{var n;return{label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,kind:t,type:e.type}})))}if(f===Ki.ENUM_VALUE||f===Ki.LIST_VALUE&&1===p||f===Ki.OBJECT_FIELD&&2===p||f===Ki.ARGUMENT&&2===p)return ao(u,m,t,e);if(f===Ki.VARIABLE&&1===p){const n=(0,r.getNamedType)(m.inputType);return jn(u,fo(t,e,u).filter((e=>e.detail===(null==n?void 0:n.name))))}if(f===Ki.TYPE_CONDITION&&1===p||f===Ki.NAMED_TYPE&&null!=h&&h.kind===Ki.TYPE_CONDITION)return lo(u,m,e);if(f===Ki.FRAGMENT_SPREAD&&1===p)return uo(u,m,e,t,Array.isArray(o)?o:Xi(o));const g=Co(c);if(d===Eo.TYPE_SYSTEM&&!g.needsAdvance&&f===Ki.NAMED_TYPE||f===Ki.LIST_TYPE){if(g.kind===Ki.FIELD_DEF)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isOutputType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if(g.kind===Ki.INPUT_VALUE_DEF)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isInputType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))))}return f===Ki.VARIABLE_DEFINITION&&2===p||f===Ki.LIST_TYPE&&1===p||f===Ki.NAMED_TYPE&&h&&(h.kind===Ki.VARIABLE_DEFINITION||h.kind===Ki.LIST_TYPE||h.kind===Ki.NON_NULL_TYPE)?ho(u,e):f===Ki.DIRECTIVE?mo(u,c,e):[]}g(Zi,"getAutocompleteSuggestions");const eo=" {\n $1\n}",to=g((e=>{const{type:t}=e;if((0,r.isCompositeType)(t))return eo;if((0,r.isListType)(t)&&(0,r.isCompositeType)(t.ofType))return eo;if((0,r.isNonNullType)(t)){if((0,r.isCompositeType)(t.ofType))return eo;if((0,r.isListType)(t.ofType)&&(0,r.isCompositeType)(t.ofType.ofType))return eo}return null}),"getInsertText");function no(e){return jn(e,[{label:"extend",kind:Si.Function},{label:"type",kind:Si.Function},{label:"interface",kind:Si.Function},{label:"union",kind:Si.Function},{label:"input",kind:Si.Function},{label:"scalar",kind:Si.Function},{label:"schema",kind:Si.Function}])}function ro(e){return jn(e,[{label:"query",kind:Si.Function},{label:"mutation",kind:Si.Function},{label:"subscription",kind:Si.Function},{label:"fragment",kind:Si.Function},{label:"{",kind:Si.Constructor}])}function io(e){return jn(e,[{label:"type",kind:Si.Function},{label:"interface",kind:Si.Function},{label:"union",kind:Si.Function},{label:"input",kind:Si.Function},{label:"scalar",kind:Si.Function},{label:"schema",kind:Si.Function}])}function oo(e,t,n){var i;if(t.parentType){const{parentType:o}=t;let a=[];return"getFields"in o&&(a=Pn(o.getFields())),(0,r.isCompositeType)(o)&&a.push(r.TypeNameMetaFieldDef),o===(null===(i=null==n?void 0:n.schema)||void 0===i?void 0:i.getQueryType())&&a.push(r.SchemaMetaFieldDef,r.TypeMetaFieldDef),jn(e,a.map(((e,t)=>{var r;const i={sortText:String(t)+e.name,label:e.name,detail:String(e.type),documentation:null!==(r=e.description)&&void 0!==r?r:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:Si.Field,type:e.type};if(null==n?void 0:n.fillLeafsOnComplete){const t=to(e);t&&(i.insertText=e.name+t,i.insertTextFormat=_r.Snippet,i.command=Qi)}return i})))}return[]}function ao(e,t,n,i){const o=(0,r.getNamedType)(t.inputType),a=fo(n,i,e).filter((e=>e.detail===o.name));return o instanceof r.GraphQLEnumType?jn(e,o.getValues().map((e=>{var t;return{label:e.name,detail:String(o),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:Si.EnumMember,type:o}})).concat(a)):o===r.GraphQLBoolean?jn(e,a.concat([{label:"true",detail:String(r.GraphQLBoolean),documentation:"Not false.",kind:Si.Variable,type:r.GraphQLBoolean},{label:"false",detail:String(r.GraphQLBoolean),documentation:"Not true.",kind:Si.Variable,type:r.GraphQLBoolean}])):a}function so(e,t,n,i,o){if(t.needsSeparator)return[];const a=Pn(n.getTypeMap()).filter(r.isInterfaceType),s=a.map((e=>{let{name:t}=e;return t})),l=new Set;vo(i,((e,t)=>{var i,a,u,c,d;if(t.name&&(t.kind!==Ki.INTERFACE_DEF||s.includes(t.name)||l.add(t.name),t.kind===Ki.NAMED_TYPE&&(null===(i=t.prevState)||void 0===i?void 0:i.kind)===Ki.IMPLEMENTS))if(o.interfaceDef){if(null===(a=o.interfaceDef)||void 0===a?void 0:a.getInterfaces().find((e=>{let{name:n}=e;return n===t.name})))return;const e=n.getType(t.name),i=null===(u=o.interfaceDef)||void 0===u?void 0:u.toConfig();o.interfaceDef=new r.GraphQLInterfaceType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(o.objectTypeDef){if(null===(c=o.objectTypeDef)||void 0===c?void 0:c.getInterfaces().find((e=>{let{name:n}=e;return n===t.name})))return;const e=n.getType(t.name),i=null===(d=o.objectTypeDef)||void 0===d?void 0:d.toConfig();o.objectTypeDef=new r.GraphQLObjectType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}}));const u=o.interfaceDef||o.objectTypeDef,c=((null==u?void 0:u.getInterfaces())||[]).map((e=>{let{name:t}=e;return t}));return jn(e,a.concat([...l].map((e=>({name:e})))).filter((e=>{let{name:t}=e;return t!==(null==u?void 0:u.name)&&!c.includes(t)})).map((e=>{const t={label:e.name,kind:Si.Interface,type:e};return(null==e?void 0:e.description)&&(t.documentation=e.description),t})))}function lo(e,t,n,i){let o;if(t.parentType)if((0,r.isAbstractType)(t.parentType)){const e=(0,r.assertAbstractType)(t.parentType),i=n.getPossibleTypes(e),a=Object.create(null);i.forEach((e=>{e.getInterfaces().forEach((e=>{a[e.name]=e}))})),o=i.concat(Pn(a))}else o=[t.parentType];else o=Pn(n.getTypeMap()).filter((e=>(0,r.isCompositeType)(e)&&!e.name.startsWith("__")));return jn(e,o.map((e=>{const t=(0,r.getNamedType)(e);return{label:String(e),documentation:(null==t?void 0:t.description)||"",kind:Si.Field}})))}function uo(e,t,n,i,o){if(!i)return[];const a=n.getTypeMap(),s=Mn(e.state),l=po(i);return o&&o.length>0&&l.push(...o),jn(e,l.filter((e=>a[e.typeCondition.name.value]&&!(s&&s.kind===Ki.FRAGMENT_DEFINITION&&s.name===e.name.value)&&(0,r.isCompositeType)(t.parentType)&&(0,r.isCompositeType)(a[e.typeCondition.name.value])&&(0,r.doTypesOverlap)(n,t.parentType,a[e.typeCondition.name.value]))).map((e=>({label:e.name.value,detail:String(a[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,kind:Si.Field,type:a[e.typeCondition.name.value]}))))}g(no,"getSuggestionsForTypeSystemDefinitions"),g(ro,"getSuggestionsForExecutableDefinitions"),g(io,"getSuggestionsForExtensionDefinitions"),g(oo,"getSuggestionsForFieldNames"),g(ao,"getSuggestionsForInputValues"),g(so,"getSuggestionsForImplements"),g(lo,"getSuggestionsForFragmentTypeConditions"),g(uo,"getSuggestionsForFragmentSpread");const co=g(((e,t)=>{var n,r,i,o,a,s,l,u,c,d;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(i=null===(r=e.prevState)||void 0===r?void 0:r.prevState)||void 0===i?void 0:i.kind)===t?e.prevState.prevState:(null===(s=null===(a=null===(o=e.prevState)||void 0===o?void 0:o.prevState)||void 0===a?void 0:a.prevState)||void 0===s?void 0:s.kind)===t?e.prevState.prevState.prevState:(null===(d=null===(c=null===(u=null===(l=e.prevState)||void 0===l?void 0:l.prevState)||void 0===u?void 0:u.prevState)||void 0===c?void 0:c.prevState)||void 0===d?void 0:d.kind)===t?e.prevState.prevState.prevState.prevState:void 0}),"getParentDefinition");function fo(e,t,n){let r,i=null;const o=Object.create({});return vo(e,((e,a)=>{if((null==a?void 0:a.kind)===Ki.VARIABLE&&a.name&&(i=a.name),(null==a?void 0:a.kind)===Ki.NAMED_TYPE&&i){const e=co(a,Ki.TYPE);(null==e?void 0:e.type)&&(r=t.getType(null==e?void 0:e.type))}i&&r&&!o[i]&&(o[i]={detail:r.toString(),insertText:"$"===n.string?i:"$"+i,label:i,type:r,kind:Si.Variable},i=null,r=null)})),Pn(o)}function po(e){const t=[];return vo(e,((e,n)=>{n.kind===Ki.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:Ki.FRAGMENT_DEFINITION,name:{kind:r.Kind.NAME,value:n.name},selectionSet:{kind:Ki.SELECTION_SET,selections:[]},typeCondition:{kind:Ki.NAMED_TYPE,name:{kind:r.Kind.NAME,value:n.type}}})})),t}function ho(e,t,n){return jn(e,Pn(t.getTypeMap()).filter(r.isInputType).map((e=>({label:e.name,documentation:e.description,kind:Si.Variable}))))}function mo(e,t,n,r){var i;return(null===(i=t.prevState)||void 0===i?void 0:i.kind)?jn(e,n.getDirectives().filter((e=>yo(t.prevState,e))).map((e=>({label:e.name,documentation:e.description||"",kind:Si.Function})))):[]}function go(e,t){let n=null,r=null,i=null;const o=vo(e,((e,o,a,s)=>{if(s===t.line&&e.getCurrentPosition()>=t.character)return n=a,r=Object.assign({},o),i=e.current(),"BREAK"}));return{start:o.start,end:o.end,string:i||o.string,state:r||o.state,style:n||o.style}}function vo(e,t){const n=e.split("\n"),r=ji();let i=r.startState(),o="",a=new Ni("");for(let e=0;e{var h;switch(t.kind){case Ki.QUERY:case"ShortQuery":f=e.getQueryType();break;case Ki.MUTATION:f=e.getMutationType();break;case Ki.SUBSCRIPTION:f=e.getSubscriptionType();break;case Ki.INLINE_FRAGMENT:case Ki.FRAGMENT_DEFINITION:t.type&&(f=e.getType(t.type));break;case Ki.FIELD:case Ki.ALIASED_FIELD:f&&t.name?(s=d?Rn(e,d,t.name):null,f=s?s.type:null):s=null;break;case Ki.SELECTION_SET:d=(0,r.getNamedType)(f);break;case Ki.DIRECTIVE:o=t.name?e.getDirective(t.name):null;break;case Ki.INTERFACE_DEF:t.name&&(u=null,p=new r.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case Ki.OBJECT_TYPE_DEF:t.name&&(p=null,u=new r.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case Ki.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case Ki.FIELD:i=s&&s.args;break;case Ki.DIRECTIVE:i=o&&o.args;break;case Ki.ALIASED_FIELD:{const n=null===(h=t.prevState)||void 0===h?void 0:h.name;if(!n){i=null;break}const r=d?Rn(e,d,n):null;if(!r){i=null;break}i=r.args;break}default:i=null}else i=null;break;case Ki.ARGUMENT:if(i)for(let e=0;ee.value===t.name)):null;break;case Ki.LIST_VALUE:const g=(0,r.getNullableType)(l);l=g instanceof r.GraphQLList?g.ofType:null;break;case Ki.OBJECT_VALUE:const v=(0,r.getNamedType)(l);c=v instanceof r.GraphQLInputObjectType?v.getFields():null;break;case Ki.OBJECT_FIELD:const y=t.name&&c?c[t.name]:null;l=null==y?void 0:y.type;break;case Ki.NAMED_TYPE:t.name&&(f=e.getType(t.name))}})),{argDef:n,argDefs:i,directiveDef:o,enumValue:a,fieldDef:s,inputType:l,objectFieldDefs:c,parentType:d,type:f,interfaceDef:p,objectTypeDef:u}}var Eo,To;function wo(e,t){return(null==t?void 0:t.endsWith(".graphqls"))||Ji(e)?Eo.TYPE_SYSTEM:Eo.EXECUTABLE}function Co(e){return e.prevState&&e.kind&&[Ki.NAMED_TYPE,Ki.LIST_TYPE,Ki.TYPE,Ki.NON_NULL_TYPE].includes(e.kind)?Co(e.prevState):e}g(fo,"getVariableCompletions"),g(po,"getFragmentDefinitions"),g(ho,"getSuggestionsForVariableDefinition"),g(mo,"getSuggestionsForDirective"),g(go,"getTokenAtPosition"),g(vo,"runOnlineParser"),g(yo,"canUseDirective"),g(bo,"getTypeInfo"),(To=Eo||(Eo={})).TYPE_SYSTEM="TYPE_SYSTEM",To.EXECUTABLE="EXECUTABLE",g(wo,"getDocumentMode"),g(Co,"unwrapType");var So={exports:{}};function xo(e,t){if(null!=e)return e;var n=new Error(void 0!==t?t:"Got unexpected "+e);throw n.framesToPop=1,n}g(xo,"nullthrows"),So.exports=xo,So.exports.default=xo,Object.defineProperty(So.exports,"__esModule",{value:!0});var No=J(So.exports);const ko=g(((e,t)=>{if(!t)return[];const n=new Map,i=new Set;(0,r.visit)(e,{FragmentDefinition(e){n.set(e.name.value,!0)},FragmentSpread(e){i.has(e.name.value)||i.add(e.name.value)}});const o=new Set;i.forEach((e=>{!n.has(e)&&t.has(e)&&o.add(No(t.get(e)))}));const a=[];return o.forEach((e=>{(0,r.visit)(e,{FragmentSpread(e){!i.has(e.name.value)&&t.get(e.name.value)&&(o.add(No(t.get(e.name.value))),i.add(e.name.value))}}),n.has(e.name.value)||a.push(e)})),a}),"getFragmentDependenciesForAST");function _o(e,t){const n=Object.create(null);return t.definitions.forEach((t=>{if("OperationDefinition"===t.kind){const{variableDefinitions:i}=t;i&&i.forEach((t=>{let{variable:i,type:o}=t;const a=(0,r.typeFromAST)(e,o);a?n[i.name.value]=a:o.kind===r.Kind.NAMED_TYPE&&"Float"===o.name.value&&(n[i.name.value]=r.GraphQLFloat)}))}})),n}function Oo(e,t){const n=t?_o(t,e):void 0,i=[];return(0,r.visit)(e,{OperationDefinition(e){i.push(e)}}),{variableToType:n,operations:i}}function Io(e,t){if(t)try{const n=(0,r.parse)(t);return Object.assign(Object.assign({},Oo(n,e)),{documentAST:n})}catch(e){return}}g(_o,"collectVariables"),g(Oo,"getOperationASTFacts"),g(Io,"getOperationFacts"),globalThis&&globalThis.__awaiter;var Do=g((function(e){return"object"==typeof e?null===e:"function"!=typeof e}),"isPrimitive"),Lo=g((function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}),"isObject");function Ao(e){return!0===Lo(e)&&"[object Object]"===Object.prototype.toString.call(e)}g(Ao,"isObjectObject");var Mo=g((function(e){var t,n;return!1!==Ao(e)&&"function"==typeof(t=e.constructor)&&!1!==Ao(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}),"isPlainObject");const{deleteProperty:Ro}=Reflect,Fo=Do,Po=Mo,jo=g((e=>"object"==typeof e&&null!==e||"function"==typeof e),"isObject$1"),Vo=g((e=>"__proto__"===e||"constructor"===e||"prototype"===e),"isUnsafeKey"),Uo=g((e=>{if(!Fo(e))throw new TypeError("Object keys must be strings or symbols");if(Vo(e))throw new Error(`Cannot set unsafe key: "${e}"`)}),"validateKey"),Bo=g((e=>Array.isArray(e)?e.flat().map(String).join(","):e),"toStringKey"),$o=g(((e,t)=>{if("string"!=typeof e||!t)return e;let n=e+";";return void 0!==t.arrays&&(n+=`arrays=${t.arrays};`),void 0!==t.separator&&(n+=`separator=${t.separator};`),void 0!==t.split&&(n+=`split=${t.split};`),void 0!==t.merge&&(n+=`merge=${t.merge};`),void 0!==t.preservePaths&&(n+=`preservePaths=${t.preservePaths};`),n}),"createMemoKey"),qo=g(((e,t,n)=>{const r=Bo(t?$o(e,t):e);Uo(r);const i=Wo.cache.get(r)||n();return Wo.cache.set(r,i),i}),"memoize"),Ho=g((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.separator||".",r="/"!==n&&t.preservePaths;if("string"==typeof e&&!1!==r&&/\//.test(e))return[e];const i=[];let o="";const a=g((e=>{let t;""!==e.trim()&&Number.isInteger(t=Number(e))?i.push(t):i.push(e)}),"push");for(let t=0;tt&&"function"==typeof t.split?t.split(e):"symbol"==typeof e?[e]:Array.isArray(e)?e:qo(e,t,(()=>Ho(e,t)))),"split"),zo=g(((e,t,n,r)=>{if(Uo(t),void 0===n)Ro(e,t);else if(r&&r.merge){const i="function"===r.merge?r.merge:Object.assign;i&&Po(e[t])&&Po(n)?e[t]=i(e[t],n):e[t]=n}else e[t]=n;return e}),"assignProp"),Wo=g(((e,t,n,r)=>{if(!t||!jo(e))return e;const i=Go(t,r);let o=e;for(let e=0;e{Wo.cache=new Map};var Ko=Wo;function Qo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z",stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:6,y:6,width:2,height:2,rx:1,fill:"currentColor"}))}function Xo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1 1L7 7L13 1",stroke:"currentColor",strokeWidth:1.5}))}function Yo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 7 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6 1.04819L2 5.04819L6 9.04819",stroke:"currentColor",strokeWidth:1.75}))}function Jo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M13 8L7 2L1 8",stroke:"currentColor",strokeWidth:1.5}))}function Zo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1 1L12.9998 12.9997",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M13 1L1.00079 13.0003",stroke:"currentColor",strokeWidth:1.5}))}function ea(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"-2 -2 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M11.25 14.2105V15.235C11.25 16.3479 10.3479 17.25 9.23501 17.25H2.76499C1.65214 17.25 0.75 16.3479 0.75 15.235L0.75 8.76499C0.75 7.65214 1.65214 6.75 2.76499 6.75L3.78947 6.75",stroke:"currentColor",strokeWidth:1.5}),t.createElement("rect",{x:6.75,y:.75,width:10.5,height:10.5,rx:2.2069,stroke:"currentColor",strokeWidth:1.5}))}function ta(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M5 9L9 5",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M5 5L9 9",stroke:"currentColor",strokeWidth:1.2}))}function na(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M4 8L8 4",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 4L8 8",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z",fill:"currentColor"}))}function ra(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:10.8,height:10.8,rx:3.4,stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 8L8 4",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 4L8 8",stroke:"currentColor",strokeWidth:1.2}))}function ia(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0.5 12 12",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:7,y:5.5,width:2,height:2,rx:1,transform:"rotate(90 7 5.5)",fill:"currentColor"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8 9L10.8 9.5C10.8 10.4941 9.99411 11.3 9 11.3L3 11.3C2.00589 11.3 1.2 10.4941 1.2 9.5L1.2 9L-3.71547e-07 9L-3.93402e-07 9.5C-4.65826e-07 11.1569 1.34314 12.5 3 12.5L9 12.5C10.6569 12.5 12 11.1569 12 9.5L12 9L10.8 9ZM10.8 4L12 4L12 3.5C12 1.84315 10.6569 0.5 9 0.5L3 0.5C1.34315 0.5 -5.87117e-08 1.84315 -1.31135e-07 3.5L-1.5299e-07 4L1.2 4L1.2 3.5C1.2 2.50589 2.00589 1.7 3 1.7L9 1.7C9.99411 1.7 10.8 2.50589 10.8 3.5L10.8 4Z",fill:"currentColor"}))}function oa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 20 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H17.25C17.8023 0.75 18.25 1.19772 18.25 1.75V5.25",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H18.25C18.8023 5.25 19.25 5.69771 19.25 6.25V22.25C19.25 22.8023 18.8023 23.25 18.25 23.25H3C1.75736 23.25 0.75 22.2426 0.75 21V3Z",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5.25C1.75736 5.25 0.75 4.24264 0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H3ZM13 11L6 11V12.5L13 12.5V11Z",fill:"currentColor"}))}function aa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 20 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H17.25M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H16.25C16.8023 0.75 17.25 1.19772 17.25 1.75V5.25M0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H17.25",stroke:"currentColor",strokeWidth:1.5}),t.createElement("line",{x1:13,y1:11.75,x2:6,y2:11.75,stroke:"currentColor",strokeWidth:1.5}))}function sa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:5,y:5,width:2,height:2,rx:1,fill:"currentColor"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z",fill:"currentColor"}))}function la(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:1.1,width:10.8,height:10.8,rx:2.4,stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:5,y:5.5,width:2,height:2,rx:1,fill:"currentColor"}))}function ua(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.59375 9.52344L4.87259 12.9944L8.07872 9.41249",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square"}),t.createElement("path",{d:"M13.75 5.25V10.75H18.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square"}),t.createElement("path",{d:"M4.95427 11.9332C4.55457 10.0629 4.74441 8.11477 5.49765 6.35686C6.25089 4.59894 7.5305 3.11772 9.16034 2.11709C10.7902 1.11647 12.6901 0.645626 14.5986 0.769388C16.5071 0.893151 18.3303 1.60543 19.8172 2.80818C21.3042 4.01093 22.3818 5.64501 22.9017 7.48548C23.4216 9.32595 23.3582 11.2823 22.7203 13.0853C22.0824 14.8883 20.9013 16.4492 19.3396 17.5532C17.778 18.6572 15.9125 19.25 14 19.25",stroke:"currentColor",strokeWidth:1.5}))}function ca(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("circle",{cx:6,cy:6,r:5.4,stroke:"currentColor",strokeWidth:1.2,strokeDasharray:"4.241025 4.241025",transform:"rotate(22.5)","transform-origin":"center"}),t.createElement("circle",{cx:6,cy:6,r:1,fill:"currentColor"}))}function da(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.5 14.5653C1.5 15.211 1.75652 15.8303 2.21314 16.2869C2.66975 16.7435 3.28905 17 3.9348 17C4.58054 17 5.19984 16.7435 5.65646 16.2869C6.11307 15.8303 6.36959 15.211 6.36959 14.5653V12.1305H3.9348C3.28905 12.1305 2.66975 12.387 2.21314 12.8437C1.75652 13.3003 1.5 13.9195 1.5 14.5653Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M3.9348 1.00063C3.28905 1.00063 2.66975 1.25715 2.21314 1.71375C1.75652 2.17035 1.5 2.78964 1.5 3.43537C1.5 4.0811 1.75652 4.70038 2.21314 5.15698C2.66975 5.61358 3.28905 5.8701 3.9348 5.8701H6.36959V3.43537C6.36959 2.78964 6.11307 2.17035 5.65646 1.71375C5.19984 1.25715 4.58054 1.00063 3.9348 1.00063Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M15.0652 12.1305H12.6304V14.5653C12.6304 15.0468 12.7732 15.5175 13.0407 15.9179C13.3083 16.3183 13.6885 16.6304 14.1334 16.8147C14.5783 16.9989 15.0679 17.0472 15.5402 16.9532C16.0125 16.8593 16.4464 16.6274 16.7869 16.2869C17.1274 15.9464 17.3593 15.5126 17.4532 15.0403C17.5472 14.568 17.4989 14.0784 17.3147 13.6335C17.1304 13.1886 16.8183 12.8084 16.4179 12.5409C16.0175 12.2733 15.5468 12.1305 15.0652 12.1305Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M12.6318 5.86775H6.36955V12.1285H12.6318V5.86775Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M17.5 3.43473C17.5 2.789 17.2435 2.16972 16.7869 1.71312C16.3303 1.25652 15.711 1 15.0652 1C14.4195 1 13.8002 1.25652 13.3435 1.71312C12.8869 2.16972 12.6304 2.789 12.6304 3.43473V5.86946H15.0652C15.711 5.86946 16.3303 5.61295 16.7869 5.15635C17.2435 4.69975 17.5 4.08046 17.5 3.43473Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}))}function fa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("circle",{cx:5,cy:5,r:4.35,stroke:"currentColor",strokeWidth:1.3}),t.createElement("line",{x1:8.45962,y1:8.54038,x2:11.7525,y2:11.8333,stroke:"currentColor",strokeWidth:1.3}))}function pa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"-2 -2 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M17.2492 6V2.9569C17.2492 1.73806 16.2611 0.75 15.0423 0.75L2.9569 0.75C1.73806 0.75 0.75 1.73806 0.75 2.9569L0.75 6",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M6 4.5L9 7.5L12 4.5",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M12 13.5L9 10.5L6 13.5",stroke:"currentColor",strokeWidth:1.5}))}function ha(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z",fill:"currentColor"}),t.createElement("path",{d:"M11.5 4.5L9.5 2.5",stroke:"currentColor",strokeWidth:1.4026,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M5.5 10.5L3.5 8.5",stroke:"currentColor",strokeWidth:1.4026,strokeLinecap:"round",strokeLinejoin:"round"}))}function ma(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z",fill:"currentColor"}))}function ga(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z",fill:"currentColor"}))}function va(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M10.2852 24.0745L13.7139 18.0742",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M14.5742 24.0749L17.1457 19.7891",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z",stroke:"currentColor",strokeWidth:1.5625,strokeLinejoin:"round"}),t.createElement("path",{d:"M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z",stroke:"currentColor",strokeWidth:1.5625,strokeLinejoin:"round"}))}function ya(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M4.75 9.25H1.25V12.75",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square"}),t.createElement("path",{d:"M11.25 6.75H14.75V3.25",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square"}),t.createElement("path",{d:"M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513",stroke:"currentColor",strokeWidth:1}),t.createElement("path",{d:"M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487",stroke:"currentColor",strokeWidth:1}))}function ba(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:11.8,height:11.8,rx:5.9,stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5",stroke:"currentColor",strokeWidth:1.2}))}function Ea(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z",fill:"currentColor"}))}function Ta(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z",fill:"currentColor",stroke:"currentColor"}))}function wa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z",stroke:"currentColor",strokeWidth:1.5}))}function Ca(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{width:16,height:16,rx:2,fill:"currentColor"}))}function Sa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:11.8,height:11.8,rx:5.9,stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:5.5,y:5.5,width:2,height:2,rx:1,fill:"currentColor"}))}g(Qo,"SvgArgument"),g(Xo,"SvgChevronDown"),g(Yo,"SvgChevronLeft"),g(Jo,"SvgChevronUp"),g(Zo,"SvgClose"),g(ea,"SvgCopy"),g(ta,"SvgDeprecatedArgument"),g(na,"SvgDeprecatedEnumValue"),g(ra,"SvgDeprecatedField"),g(ia,"SvgDirective"),g(oa,"SvgDocsFilled"),g(aa,"SvgDocs"),g(sa,"SvgEnumValue"),g(la,"SvgField"),g(ua,"SvgHistory"),g(ca,"SvgImplements"),g(da,"SvgKeyboardShortcut"),g(fa,"SvgMagnifyingGlass"),g(pa,"SvgMerge"),g(ha,"SvgPen"),g(ma,"SvgPlay"),g(ga,"SvgPlus"),g(va,"SvgPrettify"),g(ya,"SvgReload"),g(ba,"SvgRootType"),g(Ea,"SvgSettings"),g(Ta,"SvgStarFilled"),g(wa,"SvgStar"),g(Ca,"SvgStop"),g(Sa,"SvgType");var xa=Object.defineProperty,Na=g(((e,t)=>xa(e,"name",{value:t,configurable:!0})),"__name$E");const ka=rs(Qo,"argument icon");e.ac=ka;const _a=rs(Xo,"chevron down icon");e.ad=_a;const Oa=rs(Yo,"chevron left icon");e.ae=Oa;const Ia=rs(Jo,"chevron up icon");e.af=Ia;const Da=rs(Zo,"close icon");e.ag=Da;const La=rs(ea,"copy icon");e.ah=La;const Aa=rs(ta,"deprecated argument icon");e.ai=Aa;const Ma=rs(na,"deprecated enum value icon");e.aj=Ma;const Ra=rs(ra,"deprecated field icon");e.ak=Ra;const Fa=rs(ia,"directive icon");e.al=Fa;const Pa=rs(oa,"filled docs icon");e.am=Pa;const ja=rs(aa,"docs icon");e.an=ja;const Va=rs(sa,"enum value icon");e.ao=Va;const Ua=rs(la,"field icon");e.ap=Ua;const Ba=rs(ua,"history icon");e.aq=Ba;const $a=rs(ca,"implements icon");e.ar=$a;const qa=rs(da,"keyboard shortcut icon");e.as=qa;const Ha=rs(fa,"magnifying glass icon");e.at=Ha;const Ga=rs(pa,"merge icon");e.au=Ga;const za=rs(ha,"pen icon");e.av=za;const Wa=rs(ma,"play icon");e.aw=Wa;const Ka=rs(ga,"plus icon");e.ax=Ka;const Qa=rs(va,"prettify icon");e.ay=Qa;const Xa=rs(ya,"reload icon");e.az=Xa;const Ya=rs(ba,"root type icon");e.aA=Ya;const Ja=rs(Ea,"settings icon");e.aB=Ja;const Za=rs(Ta,"filled star icon");e.aC=Za;const es=rs(wa,"star icon");e.aD=es;const ts=rs(Ca,"stop icon");e.aE=ts;const ns=rs(Sa,"type icon");function rs(e,t){const n=Na(g((function(n){return ce(e,m(h({},n),{title:t}))}),"IconComponent"),"IconComponent");return Object.defineProperty(n,"name",{value:e.name}),n}e.aF=ns,g(rs,"generateIcon"),Na(rs,"generateIcon");const is=(0,t.forwardRef)(((e,t)=>ce("button",m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));e.aG=is,is.displayName="UnStyledButton";const os=(0,t.forwardRef)(((e,t)=>ce("button",m(h({},e),{ref:t,className:b("graphiql-button",{success:"graphiql-button-success",error:"graphiql-button-error"}[e.state],e.className)}))));e.aH=os,os.displayName="Button";const as=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,className:b("graphiql-button-group",e.className)}))));function ss(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}e.aI=as,as.displayName="ButtonGroup",g(ss,"canUseDOM");var ls=ss()?t.useLayoutEffect:t.useEffect;function us(){var e=(0,t.useState)(Object.create(null))[1];return(0,t.useCallback)((function(){e(Object.create(null))}),[])}function cs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}g(us,"useForceUpdate"),g(cs,"_objectWithoutPropertiesLoose$b");var ds=["unstable_skipInitialRender"],fs=g((function(e){var n=e.children,r=e.type,o=void 0===r?"reach-portal":r,a=e.containerRef,s=(0,t.useRef)(null),l=(0,t.useRef)(null),u=us();return ls((function(){if(s.current){var e=s.current.ownerDocument,t=(null==a?void 0:a.current)||e.body;return l.current=null==e?void 0:e.createElement(o),t.appendChild(l.current),u(),function(){l.current&&t&&t.removeChild(l.current)}}}),[o,u,a]),l.current?(0,i.createPortal)(n,l.current):(0,t.createElement)("span",{ref:s})}),"PortalImpl"),ps=g((function(e){var n=e.unstable_skipInitialRender,r=cs(e,ds),i=(0,t.useState)(!1),o=i[0],a=i[1];return(0,t.useEffect)((function(){n&&a(!0)}),[n]),n&&!o?null:(0,t.createElement)(fs,r)}),"Portal");function hs(e){return ss()?e?e.ownerDocument:document:null}function ms(e){return"boolean"==typeof e}function gs(e){return!(!e||"[object Function]"!={}.toString.call(e))}function vs(e){return"string"==typeof e}function ys(){}function bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function ws(e,t){if(null!=e)if(gs(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Cs(){for(var e=arguments.length,n=new Array(e),r=0;r=0||(i[n]=e[n]);return i}function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0})).sort(El)}),"orderByTabIndex"),wl=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),Cl="".concat(wl,", [data-focus-guard]"),Sl=g((function(e,t){var n;return nl((null===(n=e.shadowRoot)||void 0===n?void 0:n.children)||e.children).reduce((function(e,n){return e.concat(n.matches(t?Cl:wl)?[n]:[],Sl(n))}),[])}),"getFocusablesWithShadowDom"),xl=g((function(e,t){return e.reduce((function(e,n){return e.concat(Sl(n,t),n.parentNode?nl(n.parentNode.querySelectorAll(wl)).filter((function(e){return e===n})):[])}),[])}),"getFocusables"),Nl=g((function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return nl(t).map((function(e){return xl([e])})).reduce((function(e,t){return e.concat(t)}),[])}),"getParentAutofocusables"),kl=g((function(e,t){return nl(e).filter((function(e){return ll(t,e)})).filter((function(e){return ml(e)}))}),"filterFocusable"),_l=g((function(e,t){return void 0===t&&(t=new Map),nl(e).filter((function(e){return cl(t,e)}))}),"filterAutoFocusable"),Ol=g((function(e,t,n){return Tl(kl(xl(e,n),t),!0,n)}),"getTabbableNodes"),Il=g((function(e,t){return Tl(kl(xl(e),t),!1)}),"getAllTabbableNodes"),Dl=g((function(e,t){return kl(Nl(e),t)}),"parentAutofocusables"),Ll=g((function(e,t){return(e.shadowRoot?Ll(e.shadowRoot,t):Object.getPrototypeOf(e).contains.call(e,t))||nl(e.children).some((function(e){return Ll(e,t)}))}),"contains"),Al=g((function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}),"filterNested"),Ml=g((function(e){return e.parentNode?Ml(e.parentNode):e}),"getTopParent"),Rl=g((function(e){return rl(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(Is);return e.push.apply(e,n?Al(nl(Ml(t).querySelectorAll("[".concat(Is,'="').concat(n,'"]:not([').concat(Ds,'="disabled"])')))):[t]),e}),[])}),"getAllAffectedNodes"),Fl=g((function(e){return e.activeElement?e.activeElement.shadowRoot?Fl(e.activeElement.shadowRoot):e.activeElement:void 0}),"getNestedShadowActiveElement"),Pl=g((function(){return document.activeElement?document.activeElement.shadowRoot?Fl(document.activeElement.shadowRoot):document.activeElement:void 0}),"getActiveElement"),jl=g((function(e){return e===document.activeElement}),"focusInFrame"),Vl=g((function(e){return Boolean(nl(e.querySelectorAll("iframe")).some((function(e){return jl(e)})))}),"focusInsideIframe"),Ul=g((function(e){var t=document&&Pl();return!(!t||t.dataset&&t.dataset.focusGuard)&&Rl(e).some((function(e){return Ll(e,t)||Vl(e)}))}),"focusInside"),Bl=g((function(){var e=document&&Pl();return!!e&&nl(document.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(t){return Ll(t,e)}))}),"focusIsHidden"),$l=g((function(e,t){return t.filter(hl).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}),"findSelectedRadio"),ql=g((function(e,t){return hl(e)&&e.name?$l(e,t):e}),"correctNode"),Hl=g((function(e){var t=new Set;return e.forEach((function(n){return t.add(ql(n,e))})),e.filter((function(e){return t.has(e)}))}),"correctNodes"),Gl=g((function(e){return e[0]&&e.length>1?ql(e[0],e):e[0]}),"pickFirstFocus"),zl=g((function(e,t){return e.length>1?e.indexOf(ql(e[t],e)):t}),"pickFocusable"),Wl="NEW_FOCUS",Kl=g((function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=vl(n);if(!(n&&e.indexOf(n)>=0)){var l=void 0!==n?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,d=l-u,f=t.indexOf(o),p=t.indexOf(a),h=Hl(t),m=(void 0!==n?h.indexOf(n):-1)-(r?h.indexOf(r):l),g=zl(e,0),v=zl(e,i-1);return-1===l||-1===c?Wl:!d&&c>=0?c:l<=f&&s&&Math.abs(d)>1?v:l>=p&&s&&Math.abs(d)>1?g:d&&Math.abs(m)>1?c:l<=f?v:l>p?g:d?Math.abs(d)>1?c:(i+c+d)%i:void 0}}),"newFocus"),Ql=g((function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&Ql(e.parentNode.host||e.parentNode,t),t}),"getParents"),Xl=g((function(e,t){for(var n=Ql(e),r=Ql(t),i=0;i=0)return o}return!1}),"getCommonParent"),Yl=g((function(e,t,n){var r=rl(e),i=rl(t),o=r[0],a=!1;return i.filter(Boolean).forEach((function(e){a=Xl(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=Xl(o,e);t&&(a=!a||Ll(t,a)?t:Xl(t,a))}))})),a}),"getTopCommonParent"),Jl=g((function(e,t){return e.reduce((function(e,n){return e.concat(Dl(n,t))}),[])}),"allParentAutofocusables"),Zl=g((function(e){return function(t){var n;return t.autofocus||!!(null===(n=dl(t))||void 0===n?void 0:n.autofocus)||e.indexOf(t)>=0}}),"findAutoFocused"),eu=g((function(e,t){var n=new Map;return t.forEach((function(e){return n.set(e.node,e)})),e.map((function(e){return n.get(e)})).filter(bl)}),"reorderNodes"),tu=g((function(e,t){var n=document&&Pl(),r=Rl(e).filter(yl),i=Yl(n||e,e,r),o=new Map,a=Il(r,o),s=Ol(r,o).filter((function(e){var t=e.node;return yl(t)}));if(s[0]||(s=a)[0]){var l=Il([i],o).map((function(e){return e.node})),u=eu(l,s),c=u.map((function(e){return e.node})),d=Kl(c,l,n,t);if(d===Wl){var f=_l(a.map((function(e){return e.node}))).filter(Zl(Jl(r,o)));return{node:f&&f.length?Gl(f):Gl(_l(c))}}return void 0===d?d:u[d]}}),"getFocusMerge"),nu=g((function(e){var t=Rl(e).filter(yl),n=Yl(e,e,t),r=new Map,i=Ol([n],r,!0),o=Ol(t,r).filter((function(e){var t=e.node;return yl(t)})).map((function(e){return e.node}));return i.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:vl(t)}}))}),"getFocusabledIn"),ru=g((function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()}),"focusOn"),iu=0,ou=!1,au=g((function(e,t,n){void 0===n&&(n={});var r=tu(e,t);if(!ou&&r){if(iu>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ou=!0,void setTimeout((function(){ou=!1}),1);iu++,ru(r.node,n.focusOptions),iu--}}),"setFocus");function su(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}g(su,"deferAction");var lu=g((function(){return document&&document.activeElement===document.body}),"focusOnBody"),uu=g((function(){return lu()||Bl()}),"isFreeFocus"),cu=null,du=null,fu=null,pu=!1,hu=g((function(){return!0}),"defaultWhitelist"),mu=g((function(e){return(cu.whiteList||hu)(e)}),"focusWhitelisted"),gu=g((function(e,t){fu={observerNode:e,portaledElement:t}}),"recordPortal"),vu=g((function(e){return fu&&fu.portaledElement===e}),"focusIsPortaledPair");function yu(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else{if(!a.lockItem)break;if(o!==e)return;i=null}}while((o+=n)!==t);i&&(i.node.tabIndex=0)}g(yu,"autoGuard");var bu=g((function(e){return e&&"current"in e?e.current:e}),"extractRef"),Eu=g((function(e){return e?Boolean(pu):"meanwhile"===pu}),"focusWasOutside"),Tu=g((function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))}),"checkInHost"),wu=g((function(e,t){return t.some((function(t){return Tu(e,t,t)}))}),"withinHost"),Cu=g((function(){var e=!1;if(cu){var t=cu,n=t.observed,r=t.persistentFocus,i=t.autoFocus,o=t.shards,a=t.crossFrame,s=t.focusOptions,l=n||fu&&fu.portaledElement,u=document&&document.activeElement;if(l){var c=[l].concat(o.map(bu).filter(Boolean));if(u&&!mu(u)||(r||Eu(a)||!uu()||!du&&i)&&(l&&!(Ul(c)||u&&wu(u,c)||vu(u))&&(document&&!du&&u&&!i?(u.blur&&u.blur(),document.body.focus()):(e=au(c,du,{focusOptions:s}),fu={})),pu=!1,du=document&&document.activeElement),document){var d=document&&document.activeElement,f=nu(c),p=f.map((function(e){return e.node})).indexOf(d);p>-1&&(f.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),yu(p,f.length,1,f),yu(p,-1,-1,f))}}}return e}),"activateTrap"),Su=g((function(e){Cu()&&e&&(e.stopPropagation(),e.preventDefault())}),"onTrap"),xu=g((function(){return su(Cu)}),"onBlur"),Nu=g((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||gu(n,t)}),"onFocus"),ku=g((function(){return null}),"FocusWatcher"),_u=g((function(){pu="just",setTimeout((function(){pu="meanwhile"}),0)}),"onWindowBlur"),Ou=g((function(){document.addEventListener("focusin",Su),document.addEventListener("focusout",xu),window.addEventListener("blur",_u)}),"attachHandler"),Iu=g((function(){document.removeEventListener("focusin",Su),document.removeEventListener("focusout",xu),window.removeEventListener("blur",_u)}),"detachHandler");function Du(e){return e.filter((function(e){return!e.disabled}))}function Lu(e){var t=e.slice(-1)[0];t&&!cu&&Ou();var n=cu,r=n&&t&&t.id===n.id;cu=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(du=null,r&&n.observed===t.observed||t.onActivation(),Cu(),su(Cu)):(Iu(),du=null)}g(Du,"reducePropsToState"),g(Lu,"handleStateChangeOnClient"),Gs.assignSyncMedium(Nu),zs.assignMedium(xu),Ws.assignMedium((function(e){return e({moveFocusInside:au,focusInside:Ul})}));var Au=tl(Du,Lu)(ku),Mu=t.forwardRef(g((function(e,n){return t.createElement(Ys,Ns({sideCar:Au,ref:n},e))}),"FocusLockUICombination")),Ru=Ys.propTypes||{};Ru.sideCar,xs(Ru,["sideCar"]),Mu.propTypes={};var Fu=Mu,Pu="right-scroll-bar-position",ju="width-before-scroll-bar",Vu=$s(),Uu=g((function(){}),"nothing"),Bu=t.forwardRef((function(e,n){var r=t.useRef(null),i=t.useState({onScrollCapture:Uu,onWheelCapture:Uu,onTouchMoveCapture:Uu}),o=i[0],a=i[1],s=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=Ps(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=p,T=Ms([r,n]),w=Fs(Fs({},b),o);return t.createElement(t.Fragment,null,d&&t.createElement(E,{sideCar:Vu,removeScrollBar:c,shards:f,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:r}),s?t.cloneElement(t.Children.only(l),Fs(Fs({},w),{ref:T})):t.createElement(y,Fs({},w,{className:u,ref:T}),l))}));Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Bu.classNames={fullWidth:ju,zeroRight:Pu};var $u=g((function(){return n.nc}),"getNonce");function qu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$u();return t&&e.setAttribute("nonce",t),e}function Hu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gu(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}g(qu,"makeStyleTag"),g(Hu,"injectStyles"),g(Gu,"insertStyleTag");var zu=g((function(){var e=0,t=null;return{add:function(n){0==e&&(t=qu())&&(Hu(t,n),Gu(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}}),"stylesheetSingleton"),Wu=g((function(){var e=zu();return function(n,r){t.useEffect((function(){return e.add(n),function(){e.remove()}}),[n&&r])}}),"styleHookSingleton"),Ku=g((function(){var e=Wu();return g((function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}),"Sheet")}),"styleSingleton"),Qu={left:0,top:0,right:0,gap:0},Xu=g((function(e){return parseInt(e||"",10)||0}),"parse$1"),Yu=g((function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[Xu(n),Xu(r),Xu(i)]}),"getOffset"),Ju=g((function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Qu;var t=Yu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}),"getGapWidth"),Zu=Ku(),ec=g((function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Pu," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ju," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Pu," .").concat(Pu," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ju," .").concat(ju," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")}),"getStyles$2"),tc=g((function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,o=void 0===i?"margin":i,a=t.useMemo((function(){return Ju(o)}),[o]);return t.createElement(Zu,{styles:ec(a,!n,o,r?"":"!important")})}),"RemoveScrollBar"),nc=!1;if("undefined"!=typeof window)try{var rc=Object.defineProperty({},"passive",{get:function(){return nc=!0,!0}});window.addEventListener("test",rc,rc),window.removeEventListener("test",rc,rc)}catch(e){nc=!1}var ic=!!nc&&{passive:!1},oc=g((function(e){return"TEXTAREA"===e.tagName}),"alwaysContainsScroll"),ac=g((function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!oc(e)&&"visible"===n[t])}),"elementCanBeScrolled"),sc=g((function(e){return ac(e,"overflowY")}),"elementCouldBeVScrolled"),lc=g((function(e){return ac(e,"overflowX")}),"elementCouldBeHScrolled"),uc=g((function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),fc(e,n)){var r=pc(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1}),"locationCouldBeScrolled"),cc=g((function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}),"getVScrollVariables"),dc=g((function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}),"getHScrollVariables"),fc=g((function(e,t){return"v"===e?sc(t):lc(t)}),"elementCouldBeScrolled"),pc=g((function(e,t){return"v"===e?cc(t):dc(t)}),"getScrollVariables"),hc=g((function(e,t){return"h"===e&&"rtl"===t?-1:1}),"getDirectionFactor"),mc=g((function(e,t,n,r,i){var o=hc(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var p=pc(e,s),h=p[0],m=p[1]-p[2]-o*h;(h||m)&&fc(e,s)&&(d+=m,f+=h),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(i&&0===d||!i&&a>d)||!c&&(i&&0===f||!i&&-a>f))&&(u=!0),u}),"handleScroll"),gc=g((function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]}),"getTouchXY"),vc=g((function(e){return[e.deltaX,e.deltaY]}),"getDeltaXY"),yc=g((function(e){return e&&"current"in e?e.current:e}),"extractRef"),bc=g((function(e,t){return e[0]===t[0]&&e[1]===t[1]}),"deltaCompare"),Ec=g((function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}),"generateStyle"),Tc=0,wc=[];function Cc(e){var n=t.useRef([]),r=t.useRef([0,0]),i=t.useRef(),o=t.useState(Tc++)[0],a=t.useState((function(){return Ku()}))[0],s=t.useRef(e);t.useEffect((function(){s.current=e}),[e]),t.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=js([e.lockRef.current],(e.shards||[]).map(yc),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=t.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var n,o=gc(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-o[0],u="deltaY"in e?e.deltaY:a[1]-o[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=uc(d,c);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=uc(d,c)),!f)return!1;if(!i.current&&"changedTouches"in e&&(l||u)&&(i.current=n),!n)return!0;var p=i.current||n;return mc(p,t,e,"h"===p?l:u,!0)}),[]),u=t.useCallback((function(e){var t=e;if(wc.length&&wc[wc.length-1]===a){var r="deltaY"in t?vc(t):gc(t),i=n.current.filter((function(e){return e.name===t.type&&e.target===t.target&&bc(e.delta,r)}))[0];if(i&&i.should)t.cancelable&&t.preventDefault();else if(!i){var o=(s.current.shards||[]).map(yc).filter(Boolean).filter((function(e){return e.contains(t.target)}));(o.length>0?l(t,o[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),c=t.useCallback((function(e,t,r,i){var o={name:e,delta:t,target:r,should:i};n.current.push(o),setTimeout((function(){n.current=n.current.filter((function(e){return e!==o}))}),1)}),[]),d=t.useCallback((function(e){r.current=gc(e),i.current=void 0}),[]),f=t.useCallback((function(t){c(t.type,vc(t),t.target,l(t,e.lockRef.current))}),[]),p=t.useCallback((function(t){c(t.type,gc(t),t.target,l(t,e.lockRef.current))}),[]);t.useEffect((function(){return wc.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,ic),document.addEventListener("touchmove",u,ic),document.addEventListener("touchstart",d,ic),function(){wc=wc.filter((function(e){return e!==a})),document.removeEventListener("wheel",u,ic),document.removeEventListener("touchmove",u,ic),document.removeEventListener("touchstart",d,ic)}}),[]);var h=e.removeScrollBar,m=e.inert;return t.createElement(t.Fragment,null,m?t.createElement(a,{styles:Ec(o)}):null,h?t.createElement(tc,{gapMode:"margin"}):null)}g(Cc,"RemoveScrollSideCar");var Sc=Hs(Vu,Cc),xc=t.forwardRef((function(e,n){return t.createElement(Bu,Fs({},e,{ref:n,sideCar:Sc}))}));xc.classNames=Bu.classNames;var Nc=xc,kc={exports:{}},_c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Oc(){}function Ic(){}g(Oc,"emptyFunction"),g(Ic,"emptyFunctionWithReset"),Ic.resetWarningCache=Oc;var Dc=g((function(){function e(e,t,n,r,i,o){if(o!==_c){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}g(e,"shim"),e.isRequired=e,g(t,"getShim");var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ic,resetWarningCache:Oc};return n.PropTypes=n,n}),"factoryWithThrowingShims");kc.exports=Dc();var Lc=kc.exports;function Ac(){return Ac=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Ac,"_extends$9"),g(Mc,"_objectWithoutPropertiesLoose$9");var Rc=["as","isOpen"],Fc=["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"],Pc=["as","onClick","onKeyDown"],jc=["allowPinchZoom","initialFocusRef","isOpen","onDismiss"];Lc.bool,Lc.bool,Lc.bool,Lc.func;var Vc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.isOpen,a=void 0===o||o,s=Mc(e,Rc);return(0,t.useEffect)((function(){a?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame((function(){window.__REACH_DISABLE_TOOLTIPS=!1}))}),[a]),a?(0,t.createElement)(ps,{"data-reach-dialog-wrapper":""},(0,t.createElement)(Uc,Ac({ref:n,as:i},s))):null}),"DialogOverlay")),Uc=(0,t.forwardRef)(g((function(e,n){var r=e.allowPinchZoom,i=e.as,o=void 0===i?"div":i,a=e.dangerouslyBypassFocusLock,s=void 0!==a&&a,l=e.dangerouslyBypassScrollLock,u=void 0!==l&&l,c=e.initialFocusRef,d=e.onClick,f=e.onDismiss,p=void 0===f?ys:f,h=e.onKeyDown,m=e.onMouseDown,v=e.unstable_lockFocusAcrossFrames,y=Mc(e,Fc),b=(0,t.useRef)(null),E=(0,t.useRef)(null),T=Cs(E,n),w=(0,t.useCallback)((function(){c&&c.current&&c.current.focus()}),[c]);function C(e){b.current===e.target&&(e.stopPropagation(),p(e))}function S(e){"Escape"===e.key&&(e.stopPropagation(),p(e))}function x(e){b.current=e.target}return g(C,"handleClick"),g(S,"handleKeyDown"),g(x,"handleMouseDown"),(0,t.useEffect)((function(){return E.current?qc(E.current):void 0}),[]),(0,t.createElement)(Fu,{autoFocus:!0,returnFocus:!0,onActivation:w,disabled:s,crossFrame:null==v||v},(0,t.createElement)(Nc,{allowPinchZoom:r,enabled:!u},(0,t.createElement)(o,Ac({},y,{ref:T,"data-reach-dialog-overlay":"",onClick:Ss(d,C),onKeyDown:Ss(h,S),onMouseDown:Ss(m,x)}))))}),"DialogInner")),Bc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.onClick;e.onKeyDown;var a=Mc(e,Pc);return(0,t.createElement)(i,Ac({"aria-modal":"true",role:"dialog",tabIndex:-1},a,{ref:n,"data-reach-dialog-content":"",onClick:Ss(o,(function(e){e.stopPropagation()}))}))}),"DialogContent")),$c=(0,t.forwardRef)(g((function(e,n){var r=e.allowPinchZoom,i=void 0!==r&&r,o=e.initialFocusRef,a=e.isOpen,s=e.onDismiss,l=void 0===s?ys:s,u=Mc(e,jc);return(0,t.createElement)(Vc,{allowPinchZoom:i,initialFocusRef:o,isOpen:a,onDismiss:l},(0,t.createElement)(Bc,Ac({ref:n},u)))}),"Dialog"));function qc(e){var t=[],n=[],r=hs(e);return e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var i,o;if(r!==(null==(i=e.parentNode)||null==(o=i.parentNode)?void 0:o.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(t.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=t[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):ys}function Hc(){return Hc=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(qc,"createAriaHider"),g(Hc,"_extends$8"),g(Gc,"_objectWithoutPropertiesLoose$8");var zc=["as","style"],Wc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"span":r,o=e.style,a=void 0===o?{}:o,s=Gc(e,zc);return(0,t.createElement)(i,Hc({ref:n,style:Hc({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},a)},s))}),"VisuallyHidden")),Kc=Object.defineProperty;const Qc=g(((e,t)=>Kc(e,"name",{value:t,configurable:!0})),"__name$D")(((e,t)=>Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return e[n]=r,e}),e)),"createComponentGroup"),Xc=(0,t.forwardRef)(((e,t)=>ce($c,m(h({},e),{ref:t}))));Xc.displayName="Dialog";const Yc=(0,t.forwardRef)(((e,t)=>de(is,m(h({},e),{ref:t,type:"button",className:b("graphiql-dialog-close",e.className),children:[ce(Wc,{children:"Close dialog"}),ce(Da,{})]}))));Yc.displayName="Dialog.Close";const Jc=Qc(Xc,{Close:Yc});e.aJ=Jc;var Zc=!1,ed=0;function td(){return++ed}function nd(e){var n;if("function"==typeof t.useId){var r=(0,t.useId)(e);return null!=e?e:r}var i=null!=e?e:Zc?td():null,o=(0,t.useState)(i),a=o[0],s=o[1];return ls((function(){null===a&&s(td())}),[]),(0,t.useEffect)((function(){!1===Zc&&(Zc=!0)}),[]),null!=(n=null!=e?e:a)?n:void 0}g(td,"genId"),g(nd,"useId");var rd,id=["bottom","height","left","right","top","width"],od=g((function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),id.some((function(n){return e[n]!==t[n]}))}),"rectChanged"),ad=new Map,sd=g((function e(){var t=[];ad.forEach((function(e,n){var r=n.getBoundingClientRect();od(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),rd=window.requestAnimationFrame(e)}),"run");function ld(e,t){return{observe:g((function(){var n=0===ad.size;ad.has(e)?ad.get(e).callbacks.push(t):ad.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&sd()}),"observe"),unobserve:g((function(){var n=ad.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||ad.delete(e),ad.size||cancelAnimationFrame(rd)}}),"unobserve")}}function ud(e,n,r){var i,o,a;ms(n)?i=n:(i=null==(a=null==n?void 0:n.observe)||a,o=null==n?void 0:n.onChange),gs(r)&&(o=r);var s=(0,t.useState)(e.current),l=s[0],u=s[1],c=(0,t.useRef)(!1),d=(0,t.useRef)(!1),f=(0,t.useState)(null),p=f[0],h=f[1],m=(0,t.useRef)(o);return ls((function(){m.current=o,e.current!==l&&u(e.current)})),ls((function(){l&&!c.current&&(c.current=!0,h(l.getBoundingClientRect()))}),[l]),ls((function(){if(i){var t=l;if(d.current||(d.current=!0,t=e.current),t){var n=ld(t,(function(e){null==m.current||m.current(e),h(e)}));return n.observe(),function(){n.unobserve()}}}}),[i,l,e]),p}g(ld,"observeRect"),g(ud,"useRect");var cd=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],dd=cd.join(","),fd="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function pd(e,t){t=t||{};var n,r,i,o=[],a=[],s=e.querySelectorAll(dd);for(t.includeContainer&&fd.call(e,dd)&&(s=Array.prototype.slice.apply(s)).unshift(e),n=0;n=0||(i[n]=e[n]);return i}g(Id,"_extends$7"),g(Dd,"_objectWithoutPropertiesLoose$7");var Ld=["unstable_skipInitialPortalRender"],Ad=["as","targetRef","position","unstable_observableRefs"],Md=(0,t.forwardRef)(g((function(e,n){var r=e.unstable_skipInitialPortalRender,i=Dd(e,Ld);return(0,t.createElement)(ps,{unstable_skipInitialRender:r},(0,t.createElement)(Rd,Id({ref:n},i)))}),"Popover")),Rd=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.targetRef,a=e.position,s=void 0===a?jd:a,l=e.unstable_observableRefs,u=void 0===l?[]:l,c=Dd(e,Ad),d=(0,t.useRef)(null),f=ud(d,{observe:!c.hidden}),p=ud(o,{observe:!c.hidden}),h=Cs(d,n);return Bd(o,d),(0,t.createElement)(i,Id({"data-reach-popover":"",ref:h},c,{style:Id({position:"absolute"},Fd.apply(void 0,[s,p,f].concat(u)),c.style)}))}),"PopoverImpl"));function Fd(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o=0||(i[n]=e[n]);return i}function qd(){return qd=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Gd,"createDescendantContext"),g(zd,"useDescendant"),g(Wd,"useDescendantsInit"),g(Kd,"useDescendants"),g(Qd,"DescendantProvider"),g(Xd,"useDescendantKeyDown"),g(Yd,"isRightClick"),g(Jd,"createStableCallbackHook"),g(Zd,"useStableCallback"),g(ef,"_objectWithoutPropertiesLoose$5");var tf,nf,rf=["children"];function of(e,n){return(0,t.createContext)(n)}function af(e,n){var r=(0,t.createContext)(n);function i(e){var n=e.children,i=ef(e,rf),o=(0,t.useMemo)((function(){return i}),Object.values(i));return(0,t.createElement)(r.Provider,{value:o},n)}function o(i){var o=(0,t.useContext)(r);if(o)return o;if(n)return n;throw Error(i+" must be rendered inside of a "+e+" component.")}return g(i,"Provider"),g(o,"useContext$1"),[i,o]}function sf(){for(var e=arguments.length,t=new Array(e),n=0;n0||m,matches:pf(o)}}}}),"x");try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return mf(s,l)}};return n}g(cf,"e$1"),g(df,"r$1"),g(ff,"i$1"),g(pf,"o"),g(hf,"a"),g(mf,"u"),g(gf,"c$1");var vf=g((function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))}),"s");function yf(e){var t=e.initialState,n=tf.NotStarted,r=new Set,i={_machine:e,send:function(i){n===tf.Running&&(t=e.transition(t,i),vf(t,hf(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(){return n=tf.Running,vf(t,uf),i},stop:function(){return n=tf.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}function bf(e){var n=(0,t.useRef)();return n.current||(n.current={v:e()}),n.current.v}function Ef(){return Ef=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(kf,"useMachine"),g(_f,"unwrapRefs"),g(Of,"useCreateMachine"),g(If,"_extends$4"),g(Df,"_objectWithoutPropertiesLoose$4"),(xf=wf||(wf={})).Idle="IDLE",xf.Open="OPEN",xf.Navigating="NAVIGATING",xf.Dragging="DRAGGING",xf.Interacting="INTERACTING",(Sf=Cf||(Cf={})).ButtonMouseDown="BUTTON_MOUSE_DOWN",Sf.ButtonMouseUp="BUTTON_MOUSE_UP",Sf.Blur="BLUR",Sf.ClearNavSelection="CLEAR_NAV_SELECTION",Sf.ClearTypeahead="CLEAR_TYPEAHEAD",Sf.GetDerivedData="GET_DERIVED_DATA",Sf.KeyDownEscape="KEY_DOWN_ESCAPE",Sf.KeyDownEnter="KEY_DOWN_ENTER",Sf.KeyDownSpace="KEY_DOWN_SPACE",Sf.KeyDownNavigate="KEY_DOWN_NAVIGATE",Sf.KeyDownSearch="KEY_DOWN_SEARCH",Sf.KeyDownTab="KEY_DOWN_TAB",Sf.KeyDownShiftTab="KEY_DOWN_SHIFT_TAB",Sf.OptionTouchStart="OPTION_TOUCH_START",Sf.OptionMouseMove="OPTION_MOUSE_MOVE",Sf.OptionMouseEnter="OPTION_MOUSE_ENTER",Sf.OptionMouseDown="OPTION_MOUSE_DOWN",Sf.OptionMouseUp="OPTION_MOUSE_UP",Sf.OptionClick="OPTION_CLICK",Sf.ListMouseUp="LIST_MOUSE_UP",Sf.OptionPress="OPTION_PRESS",Sf.OutsideMouseDown="OUTSIDE_MOUSE_DOWN",Sf.OutsideMouseUp="OUTSIDE_MOUSE_UP",Sf.ValueChange="VALUE_CHANGE",Sf.PopoverPointerDown="POPOVER_POINTER_DOWN",Sf.PopoverPointerUp="POPOVER_POINTER_UP",Sf.UpdateAfterTypeahead="UPDATE_AFTER_TYPEAHEAD";var Lf=df({navigationValue:null}),Af=df({typeaheadQuery:null}),Mf=df({value:g((function(e,t){return t.value}),"value")}),Rf=df({navigationValue:g((function(e,t){return t.value}),"navigationValue")}),Ff=df({navigationValue:g((function(e){var t,n=ep(e.value,e.options);return n&&!n.disabled?e.value:(null==(t=e.options.find((function(e){return!e.disabled})))?void 0:t.value)||null}),"navigationValue")});function Pf(e,t){if(t.type===Cf.Blur){var n=t.refs,r=n.list,i=n.popover,o=t.relatedTarget,a=hs(i);return!((null==a?void 0:a.activeElement)===r||!i||i.contains(o||(null==a?void 0:a.activeElement)))}return!1}function jf(e,t){if(t.type===Cf.OutsideMouseDown||t.type===Cf.OutsideMouseUp){var n=t.refs,r=n.button,i=n.popover,o=t.relatedTarget;return!(o===r||!r||r.contains(o)||!i||i.contains(o))}return!1}function Vf(e,t){return!!e.options.find((function(t){return t.value===e.navigationValue}))}function Uf(e,t){var n=t.refs,r=n.popover,i=n.list,o=t.relatedTarget;return!(r&&o&&r.contains(o)&&o!==i)&&Vf(e)}function Bf(e,t){requestAnimationFrame((function(){t.refs.list&&t.refs.list.focus()}))}function $f(e,t){t.refs.button&&t.refs.button.focus()}function qf(e,t){return!t.disabled}function Hf(e,t){return t.type!==Cf.OptionTouchStart||!t||!t.disabled}function Gf(e,t){return!("disabled"in t&&t.disabled||("value"in t?null==t.value:null==e.navigationValue))}function zf(e,t){t.callback&&t.callback(t.value)}function Wf(e,t){if(t.type===Cf.KeyDownEnter){var n=t.refs.hiddenInput;if(n&&n.form){var r=n.form.querySelector("button:not([type]),[type='submit']");r&&r.click()}}}g(Pf,"listboxLostFocus"),g(jf,"clickedOutsideOfListbox"),g(Vf,"optionIsActive"),g(Uf,"shouldNavigate"),g(Bf,"focusList"),g($f,"focusButton"),g(qf,"listboxIsNotDisabled"),g(Hf,"optionIsNavigable"),g(Gf,"optionIsSelectable"),g(zf,"selectOption"),g(Wf,"submitForm");var Kf=df({typeaheadQuery:g((function(e,t){return(e.typeaheadQuery||"")+t.query}),"typeaheadQuery")}),Qf=df({value:g((function(e,t){if(t.type===Cf.UpdateAfterTypeahead&&t.query){var n=Zf(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}),"value")}),Xf=df({navigationValue:g((function(e,t){if(t.type===Cf.UpdateAfterTypeahead&&t.query){var n=Zf(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}),"navigationValue")}),Yf=((Tf={})[Cf.GetDerivedData]={actions:df((function(e,t){return If({},e,t.data)}))},Tf[Cf.ValueChange]={actions:[Mf,zf]},Tf),Jf=g((function(e){var t,n,r,i,o,a,s=e.value;return{id:"listbox",initial:wf.Idle,context:{value:s,options:[],navigationValue:null,typeaheadQuery:null},states:(a={},a[wf.Idle]={on:If({},Yf,(t={},t[Cf.ButtonMouseDown]={target:wf.Open,actions:[Ff],cond:qf},t[Cf.KeyDownSpace]={target:wf.Navigating,actions:[Ff,Bf],cond:qf},t[Cf.KeyDownSearch]={target:wf.Idle,actions:Kf,cond:qf},t[Cf.UpdateAfterTypeahead]={target:wf.Idle,actions:[Qf],cond:qf},t[Cf.ClearTypeahead]={target:wf.Idle,actions:Af},t[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Ff,Af,Bf],cond:qf},t[Cf.KeyDownEnter]={actions:[Wf],cond:qf},t))},a[wf.Interacting]={entry:[Lf],on:If({},Yf,(n={},n[Cf.ClearNavSelection]={actions:[Lf,Bf]},n[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},n[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},n[Cf.OptionMouseDown]={target:wf.Dragging},n[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Dragging,actions:Af,cond:Vf}],n[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],n[Cf.KeyDownEnter]=wf.Interacting,n[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],n[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},n[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.OptionMouseEnter]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},n[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},n))},a[wf.Open]={on:If({},Yf,(r={},r[Cf.ClearNavSelection]={actions:[Lf]},r[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},r[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},r[Cf.OptionMouseDown]={target:wf.Dragging},r[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Dragging,cond:Vf},{target:wf.Interacting,actions:Af}],r[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],r[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],r[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},r[Cf.ListMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},r[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},r[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},r[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},r[Cf.UpdateAfterTypeahead]={actions:[Xf]},r[Cf.ClearTypeahead]={actions:Af},r[Cf.OptionMouseMove]=[{target:wf.Dragging,actions:[Rf],cond:Hf},{target:wf.Dragging}],r))},a[wf.Dragging]={on:If({},Yf,(i={},i[Cf.ClearNavSelection]={actions:[Lf]},i[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},i[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},i[Cf.OptionMouseDown]={target:wf.Dragging},i[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],i[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf,actions:Bf},{target:wf.Interacting,actions:[Af,Bf]}],i[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],i[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},i[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},i[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.OptionMouseEnter]={target:wf.Dragging,actions:[Rf,Af],cond:Hf},i[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},i[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},i[Cf.UpdateAfterTypeahead]={actions:[Xf]},i[Cf.ClearTypeahead]={actions:Af},i[Cf.OptionMouseMove]=[{target:wf.Navigating,actions:[Rf],cond:Hf},{target:wf.Navigating}],i[Cf.OptionMouseUp]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i))},a[wf.Navigating]={on:If({},Yf,(o={},o[Cf.ClearNavSelection]={actions:[Lf,Bf]},o[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},o[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},o[Cf.OptionMouseDown]={target:wf.Dragging},o[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],o[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],o[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],o[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},o[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},o[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.OptionMouseEnter]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},o[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},o[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},o[Cf.UpdateAfterTypeahead]={actions:[Xf]},o[Cf.ClearTypeahead]={actions:Af},o[Cf.OptionMouseMove]=[{target:wf.Navigating,actions:[Rf],cond:Hf},{target:wf.Navigating}],o))},a)}}),"createMachineDefinition");function Zf(e,t){return void 0===t&&(t=""),t&&e.find((function(e){return!e.disabled&&e.label&&e.label.toLowerCase().startsWith(t.toLowerCase())}))||null}function ep(e,t){return e?t.find((function(t){return t.value===e})):void 0}g(Zf,"findOptionFromTypeahead"),g(ep,"findOptionFromValue");var tp=["as","aria-labelledby","aria-label","children","defaultValue","disabled","form","name","onChange","required","value","__componentName"],np=["arrow","button","children","portal"],rp=["aria-label","arrow","as","children","onKeyDown","onMouseDown","onMouseUp"],ip=["as","children"],op=["as","position","onBlur","onKeyDown","onMouseUp","portal","unstable_observableRefs"],ap=["as"],sp=["as","children","disabled","index","label","onClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onTouchStart","value"],lp=Gd(),up=of(0,{}),cp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e["aria-labelledby"],a=e["aria-label"],s=e.children,l=e.defaultValue,u=e.disabled,c=void 0!==u&&u,d=e.form,f=e.name,p=e.onChange,h=e.required,m=e.value;e.__componentName;var v=Df(e,tp),y=(0,t.useRef)(null!=m),b=Wd(),E=b[0],T=b[1],w=(0,t.useRef)(null),C=(0,t.useRef)(null),S=(0,t.useRef)(null),x=(0,t.useRef)(null),N=(0,t.useRef)(null),k=(0,t.useRef)(null),_=(0,t.useRef)(null),O=kf(Of(Jf({value:(y.current?m:l)||null})),{button:w,hiddenInput:C,highlightedOption:S,input:x,list:N,popover:k,selectedOption:_},false),I=O[0],D=O[1];function L(e){e!==I.context.value&&(null==p||p(e))}g(L,"handleValueChange");var A=nd(v.id),M=v.id||sf("listbox-input",A),R=Cs(x,n),F=(0,t.useMemo)((function(){var e=E.find((function(e){return e.value===I.context.value}));return e?e.label:null}),[E,I.context.value]),P=Ep(I.value),j={ariaLabel:a,ariaLabelledBy:o,buttonRef:w,disabled:c,highlightedOptionRef:S,isExpanded:P,listboxId:M,listboxValueLabel:F,listRef:N,onValueChange:L,popoverRef:k,selectedOptionRef:_,send:D,state:I.value,stateData:I.context},V=(0,t.useRef)(!1);if(!y.current&&null==l&&!V.current&&E.length){V.current=!0;var U=E.find((function(e){return!e.disabled}));U&&U.value&&D({type:Cf.ValueChange,value:U.value})}return Sp(m,I.context.value,(function(){D({type:Cf.ValueChange,value:m})})),ls((function(){D({type:Cf.GetDerivedData,data:{options:E}})}),[E,D]),(0,t.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Cp(k.current,t)||D({type:Cf.OutsideMouseDown,relatedTarget:n||t})}return g(e,"handleMouseDown"),P&&window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}),[D,P]),(0,t.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Cp(k.current,t)||D({type:Cf.OutsideMouseUp,relatedTarget:n||t})}return g(e,"handleMouseUp"),P&&window.addEventListener("mouseup",e),function(){window.removeEventListener("mouseup",e)}}),[D,P]),(0,t.createElement)(i,If({},v,{ref:R,"data-reach-listbox-input":"","data-state":P?"expanded":"closed","data-value":I.context.value,id:M}),(0,t.createElement)(up.Provider,{value:j},(0,t.createElement)(Qd,{context:lp,items:E,set:T},gs(s)?s({id:M,isExpanded:P,value:I.context.value,selectedOptionRef:_,highlightedOptionRef:S,valueLabel:F,expanded:P}):s,(d||f||h)&&(0,t.createElement)("input",{ref:C,"data-reach-listbox-hidden-input":"",disabled:c,form:d,name:f,readOnly:!0,required:h,tabIndex:-1,type:"hidden",value:I.context.value||""}))))}),"ListboxInput")),dp=(0,t.forwardRef)(g((function(e,n){var r=e.arrow,i=void 0===r?"▼":r,o=e.button,a=e.children,s=e.portal,l=void 0===s||s,u=Df(e,np);return(0,t.createElement)(cp,If({},u,{__componentName:"Listbox",ref:n}),(function(e){var n=e.value,r=e.valueLabel;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(pp,{arrow:i,children:o?gs(o)?o({value:n,label:r}):o:void 0}),(0,t.createElement)(vp,{portal:l},(0,t.createElement)(yp,null,a)))}))}),"Listbox")),fp=(0,t.forwardRef)(g((function(e,n){var r=e["aria-label"],i=e.arrow,o=void 0!==i&&i,a=e.as,s=void 0===a?"span":a,l=e.children,u=e.onKeyDown,c=e.onMouseDown,d=e.onMouseUp,f=Df(e,rp),p=(0,t.useContext)(up),h=p.buttonRef,m=p.send,v=p.ariaLabelledBy,y=p.disabled,b=p.isExpanded,E=p.listboxId,T=p.stateData,w=p.listboxValueLabel,C=T.value,S=Cs(h,n),x=Tp();function N(e){Yd(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),m({type:Cf.ButtonMouseDown,disabled:y}))}function k(e){Yd(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),m({type:Cf.ButtonMouseUp}))}g(N,"handleMouseDown"),g(k,"handleMouseUp");var _=sf("button",E),O=(0,t.useMemo)((function(){return l?gs(l)?l({isExpanded:b,label:w,value:C,expanded:b}):l:w}),[l,w,b,C]);return(0,t.createElement)(s,If({"aria-disabled":y||void 0,"aria-expanded":b||void 0,"aria-haspopup":"listbox","aria-labelledby":r?void 0:[v,_].filter(Boolean).join(" "),"aria-label":r,role:"button",tabIndex:y?-1:0},f,{ref:S,"data-reach-listbox-button":"",id:_,onKeyDown:Ss(u,x),onMouseDown:Ss(c,N),onMouseUp:Ss(d,k)}),O,o&&(0,t.createElement)(mp,null,ms(o)?null:o))}),"ListboxButton")),pp=(0,t.memo)(fp),hp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"span":r,o=e.children,a=Df(e,ip),s=(0,t.useContext)(up).isExpanded;return(0,t.createElement)(i,If({"aria-hidden":!0},a,{ref:n,"data-reach-listbox-arrow":"","data-expanded":s?"":void 0}),gs(o)?o({isExpanded:s,expanded:s}):o||"▼")}),"ListboxArrow")),mp=(0,t.memo)(hp),gp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.position,a=void 0===o?Vd:o,s=e.onBlur,l=e.onKeyDown,u=e.onMouseUp,c=e.portal,d=void 0===c||c,f=e.unstable_observableRefs,p=Df(e,op),h=(0,t.useContext)(up),m=h.isExpanded,v=h.buttonRef,y=h.popoverRef,b=h.send,E=Cs(y,n),T=Tp();function w(){b({type:Cf.ListMouseUp})}g(w,"handleMouseUp");var C=If({hidden:!m,tabIndex:-1},p,{ref:E,"data-reach-listbox-popover":"",onMouseUp:Ss(u,w),onBlur:Ss(s,S),onKeyDown:Ss(l,T)});function S(e){var t=e.nativeEvent;requestAnimationFrame((function(){b({type:Cf.Blur,relatedTarget:t.relatedTarget||t.target})}))}return g(S,"handleBlur"),d?(0,t.createElement)(Md,If({},C,{as:i,targetRef:v,position:a,unstable_observableRefs:f,unstable_skipInitialPortalRender:!0})):(0,t.createElement)(i,C)}),"ListboxPopover")),vp=(0,t.memo)(gp),yp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"ul":r,o=Df(e,ap),a=(0,t.useContext)(up),s=a.listRef,l=a.ariaLabel,u=a.ariaLabelledBy,c=a.isExpanded,d=a.listboxId,f=a.stateData,p=f.value,h=f.navigationValue,m=Cs(n,s);return(0,t.createElement)(i,If({"aria-activedescendant":wp(c?h:p),"aria-labelledby":l?void 0:u,"aria-label":l,role:"listbox",tabIndex:-1},o,{ref:m,"data-reach-listbox-list":"",id:sf("listbox",d)}))}),"ListboxList")),bp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"li":r,o=e.children,a=e.disabled,s=e.index,l=e.label,u=e.onClick,c=e.onMouseDown,d=e.onMouseEnter,f=e.onMouseLeave,p=e.onMouseMove,h=e.onMouseUp,m=e.onTouchStart,v=e.value,y=Df(e,sp),b=(0,t.useContext)(up),E=b.highlightedOptionRef,T=b.selectedOptionRef,w=b.send,C=b.isExpanded,S=b.onValueChange,x=b.state,N=b.stateData,k=N.value,_=N.navigationValue,O=(0,t.useState)(l),I=O[0],D=O[1],L=l||I||"",A=lf((0,t.useRef)(null),null),M=A[0],R=A[1];zd((0,t.useMemo)((function(){return{element:M,value:v,label:L,disabled:!!a}}),[a,M,L,v]),lp,s);var F=(0,t.useCallback)((function(e){!l&&e&&D((function(t){return e.textContent&&t!==e.textContent?e.textContent:t||""}))}),[l]),P=!!_&&_===v,j=k===v,V=Cs(F,n,R,j?T:null,P?E:null);function U(){w({type:Cf.OptionMouseEnter,value:v,disabled:!!a})}function B(){w({type:Cf.OptionTouchStart,value:v,disabled:!!a})}function $(){w({type:Cf.ClearNavSelection})}function q(e){Yd(e.nativeEvent)||(e.preventDefault(),w({type:Cf.OptionMouseDown}))}function H(e){Yd(e.nativeEvent)||w({type:Cf.OptionMouseUp,value:v,callback:S,disabled:!!a})}function G(e){Yd(e.nativeEvent)||w({type:Cf.OptionClick,value:v,callback:S,disabled:!!a})}function z(){x!==wf.Open&&_===v||w({type:Cf.OptionMouseMove,value:v,disabled:!!a})}return g(U,"handleMouseEnter"),g(B,"handleTouchStart"),g($,"handleMouseLeave"),g(q,"handleMouseDown"),g(H,"handleMouseUp"),g(G,"handleClick"),g(z,"handleMouseMove"),(0,t.createElement)(i,If({"aria-selected":(C?P:j)||void 0,"aria-disabled":a||void 0,role:"option"},y,{ref:V,id:wp(v),"data-reach-listbox-option":"","data-current-nav":P?"":void 0,"data-current-selected":j?"":void 0,"data-label":L,"data-value":v,onClick:Ss(u,G),onMouseDown:Ss(c,q),onMouseEnter:Ss(d,U),onMouseLeave:Ss(f,$),onMouseMove:Ss(p,z),onMouseUp:Ss(h,H),onTouchStart:Ss(m,B)}),o)}),"ListboxOption"));function Ep(e){return[wf.Navigating,wf.Open,wf.Dragging,wf.Interacting].includes(e)}function Tp(){var e=(0,t.useContext)(up),n=e.send,r=e.disabled,i=e.onValueChange,o=e.stateData,a=o.navigationValue,s=o.typeaheadQuery,l=Kd(lp),u=Zd(i);(0,t.useEffect)((function(){s&&n({type:Cf.UpdateAfterTypeahead,query:s,callback:u});var e=window.setTimeout((function(){null!=s&&n({type:Cf.ClearTypeahead})}),1e3);return function(){window.clearTimeout(e)}}),[u,n,s]);var c=l.findIndex((function(e){return e.value===a}));return Ss((function(e){var t=e.key,o=vs(t)&&1===t.length,s=l.find((function(e){return e.value===a}));switch(t){case"Enter":return void n({type:Cf.KeyDownEnter,value:a,callback:i,disabled:!!(null!=s&&s.disabled||r)});case" ":return e.preventDefault(),void n({type:Cf.KeyDownSpace,value:a,callback:i,disabled:!!(null!=s&&s.disabled||r)});case"Escape":return void n({type:Cf.KeyDownEscape});case"Tab":var u=e.shiftKey?Cf.KeyDownShiftTab:Cf.KeyDownTab;return void n({type:u});default:return void(o&&n({type:Cf.KeyDownSearch,query:t,disabled:r}))}}),Xd(lp,{currentIndex:c,orientation:"vertical",key:"index",rotate:!0,filter:g((function(e){return!e.disabled}),"filter"),callback:g((function(e){n({type:Cf.KeyDownNavigate,value:l[e].value,disabled:r})}),"callback")}))}function wp(e){var n=(0,t.useContext)(up).listboxId;return e?sf("option-"+e,n):void 0}function Cp(e,t){return!(!e||!e.contains(t))}function Sp(e,n,r){(0,t.useRef)(null!=e).current&&e!==n&&r()}function xp(e){var n=(0,t.useRef)(null);return(0,t.useEffect)((function(){n.current=e}),[e]),n.current}function Np(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function kp(){return kp=Object.assign||function(e){for(var t=1;t8||n>8)&&(C.current=!0)}V||null==j||p||E({type:Vp,payload:{index:j,dropdownRef:T}})}function K(){C.current=!0,V||null==j||p||E({type:Vp,payload:{index:j}})}function Q(e){Yd(e.nativeEvent)||(C.current?i?M.current?M.current=!1:O.current&&O.current.click():p||B():C.current=!0)}return S.current[j]=f,g(B,"select"),g($,"handleClick"),g(q,"handleDragStart"),g(H,"handleMouseDown"),g(G,"handleMouseEnter"),g(z,"handleMouseLeave"),g(W,"handleMouseMove"),g(K,"handleFocus"),g(Q,"handleMouseUp"),(0,t.useEffect)((function(){if(_){var e=window.setTimeout((function(){C.current=!0}),400);return function(){window.clearTimeout(e)}}C.current=!1}),[_,C]),(0,t.useEffect)((function(){var e=hs(O.current);return e.addEventListener("mouseup",t),function(){e.removeEventListener("mouseup",t)};function t(){M.current=!1}}),[]),{data:{disabled:p},props:kp({id:Jp(j),tabIndex:-1},y,{ref:U,"data-disabled":p?"":void 0,"data-selected":V?"":void 0,"data-valuetext":D,onClick:Ss(o,$),onDragStart:Ss(a,q),onMouseDown:Ss(s,H),onMouseEnter:Ss(l,G),onMouseLeave:Ss(u,z),onMouseMove:Ss(c,W),onFocus:Ss(h,K),onMouseUp:Ss(d,Q)})}}function Qp(e){e.id;var n=e.onKeyDown,r=e.ref,i=Np(e,Ip),o=Hp("useDropdownItems"),a=o.dispatch,s=o.triggerRef,l=o.dropdownRef,u=o.selectCallbacks,c=o.dropdownId,d=o.state,f=d.isExpanded,p=d.triggerId,h=d.selectionIndex,m=d.typeaheadQuery,v=nh(),y=Cs(l,r);(0,t.useEffect)((function(){var e=Yp(v,m);m&&null!=e&&a({type:Vp,payload:{index:e,dropdownRef:l}});var t=window.setTimeout((function(){return m&&a({type:jp,payload:""})}),1e3);return function(){return window.clearTimeout(t)}}),[a,v,m,l]);var b=xp(v.length),E=xp(v[h]),T=xp(h);(0,t.useEffect)((function(){h>v.length-1?a({type:Vp,payload:{index:v.length-1,dropdownRef:l}}):b!==v.length&&h>-1&&E&&T===h&&v[h]!==E&&a({type:Vp,payload:{index:v.findIndex((function(e){return e.key===(null==E?void 0:E.key)})),dropdownRef:l}})}),[l,a,v,b,E,T,h]);var w=Ss(g((function(e){var t=e.key;if(f)switch(t){case"Enter":case" ":var n=v.find((function(e){return e.index===h}));n&&!n.disabled&&(e.preventDefault(),n.isLink&&n.element?n.element.click():(Zp(s.current),u.current[n.index]&&u.current[n.index](),a({type:Ap})));break;case"Escape":Zp(s.current),a({type:Mp});break;case"Tab":e.preventDefault();break;default:if(vs(t)&&1===t.length){var r=m+t.toLowerCase();a({type:jp,payload:r})}}}),"handleKeyDown"),Xd(Bp,{currentIndex:h,orientation:"vertical",rotate:!1,filter:g((function(e){return!e.disabled}),"filter"),callback:g((function(e){a({type:Vp,payload:{index:e,dropdownRef:l}})}),"callback"),key:"index"}));return{data:{activeDescendant:Jp(h)||void 0,triggerId:p},props:kp({tabIndex:-1},i,{ref:y,id:c,onKeyDown:Ss(n,w)})}}function Xp(e){var n=e.onBlur,r=e.portal,i=void 0===r||r,o=e.position,a=e.ref,s=Np(e,Dp),l=Hp("useDropdownPopover"),u=l.triggerRef,c=l.triggerClickedRef,d=l.dispatch,f=l.dropdownRef,p=l.popoverRef,h=l.state.isExpanded,m=Cs(p,a);return(0,t.useEffect)((function(){if(h){var e=hs(p.current);return g(t,"listener"),e.addEventListener("mousedown",t),function(){e.removeEventListener("mousedown",t)}}function t(e){c.current?c.current=!1:eh(p.current,e.target)||d({type:Mp})}}),[c,u,d,f,p,h]),{data:{portal:i,position:o,targetRef:u,isExpanded:h},props:kp({ref:m,hidden:!h,onBlur:Ss(n,(function(e){e.currentTarget.contains(e.relatedTarget)||d({type:Mp})}))},s)}}function Yp(e,t){if(void 0===t&&(t=""),!t)return null;var n=e.find((function(e){var n,r,i;return!e.disabled&&(null==(n=e.element)||null==(r=n.dataset)||null==(i=r.valuetext)?void 0:i.toLowerCase().startsWith(t))}));return n?e.indexOf(n):null}function Jp(e){var t=Hp("useItemId").dropdownId;return null!=e&&e>-1?sf("option-"+e,t):void 0}function Zp(e){e&&e.focus()}function eh(e,t){return!(!e||!e.contains(t))}function th(e,t){switch(void 0===t&&(t={}),t.type){case Ap:case Mp:return kp({},e,{isExpanded:!1,selectionIndex:-1});case Rp:return kp({},e,{isExpanded:!0,selectionIndex:0});case Fp:return kp({},e,{isExpanded:!0,selectionIndex:t.payload.index});case Pp:return kp({},e,{isExpanded:!0,selectionIndex:-1});case Vp:var n=t.payload.dropdownRef,r=void 0===n?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var i=hs(r.current);r.current!==(null==i?void 0:i.activeElement)&&r.current.focus()}return kp({},e,{selectionIndex:null!=t.payload.max?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e;case Lp:return kp({},e,{selectionIndex:-1});case Up:return kp({},e,{triggerId:t.payload});case jp:return void 0!==t.payload?kp({},e,{typeaheadQuery:t.payload}):e;default:return e}}function nh(){return Kd(Bp)}g(Wp,"useDropdownTrigger"),g(Kp,"useDropdownItem"),g(Qp,"useDropdownItems"),g(Xp,"useDropdownPopover"),g(Yp,"findItemFromTypeahead"),g(Jp,"useItemId"),g(Zp,"focus"),g(eh,"popoverContainsEventTarget"),g(th,"reducer$1"),g(nh,"useDropdownDescendants");var rh={exports:{}},ih={},oh="function"==typeof Symbol&&Symbol.for,ah=oh?Symbol.for("react.element"):60103,sh=oh?Symbol.for("react.portal"):60106,lh=oh?Symbol.for("react.fragment"):60107,uh=oh?Symbol.for("react.strict_mode"):60108,ch=oh?Symbol.for("react.profiler"):60114,dh=oh?Symbol.for("react.provider"):60109,fh=oh?Symbol.for("react.context"):60110,ph=oh?Symbol.for("react.async_mode"):60111,hh=oh?Symbol.for("react.concurrent_mode"):60111,mh=oh?Symbol.for("react.forward_ref"):60112,gh=oh?Symbol.for("react.suspense"):60113,vh=oh?Symbol.for("react.suspense_list"):60120,yh=oh?Symbol.for("react.memo"):60115,bh=oh?Symbol.for("react.lazy"):60116,Eh=oh?Symbol.for("react.block"):60121,Th=oh?Symbol.for("react.fundamental"):60117,wh=oh?Symbol.for("react.responder"):60118,Ch=oh?Symbol.for("react.scope"):60119;function Sh(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ah:switch(e=e.type){case ph:case hh:case lh:case ch:case uh:case gh:return e;default:switch(e=e&&e.$$typeof){case fh:case mh:case bh:case yh:case dh:return e;default:return t}}case sh:return t}}}function xh(e){return Sh(e)===hh}function Nh(){return Nh=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Sh,"z"),g(xh,"A"),ih.AsyncMode=ph,ih.ConcurrentMode=hh,ih.ContextConsumer=fh,ih.ContextProvider=dh,ih.Element=ah,ih.ForwardRef=mh,ih.Fragment=lh,ih.Lazy=bh,ih.Memo=yh,ih.Portal=sh,ih.Profiler=ch,ih.StrictMode=uh,ih.Suspense=gh,ih.isAsyncMode=function(e){return xh(e)||Sh(e)===ph},ih.isConcurrentMode=xh,ih.isContextConsumer=function(e){return Sh(e)===fh},ih.isContextProvider=function(e){return Sh(e)===dh},ih.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ah},ih.isForwardRef=function(e){return Sh(e)===mh},ih.isFragment=function(e){return Sh(e)===lh},ih.isLazy=function(e){return Sh(e)===bh},ih.isMemo=function(e){return Sh(e)===yh},ih.isPortal=function(e){return Sh(e)===sh},ih.isProfiler=function(e){return Sh(e)===ch},ih.isStrictMode=function(e){return Sh(e)===uh},ih.isSuspense=function(e){return Sh(e)===gh},ih.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===lh||e===hh||e===ch||e===uh||e===gh||e===vh||"object"==typeof e&&null!==e&&(e.$$typeof===bh||e.$$typeof===yh||e.$$typeof===dh||e.$$typeof===fh||e.$$typeof===mh||e.$$typeof===Th||e.$$typeof===wh||e.$$typeof===Ch||e.$$typeof===Eh)},ih.typeOf=Sh,rh.exports=ih,g(Nh,"_extends$2"),g(kh,"_objectWithoutPropertiesLoose$2");var _h=["as","id","children"],Oh=["as"],Ih=["as"],Dh=["as"],Lh=["as"],Ah=["portal"],Mh=["as"],Rh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?t.Fragment:r,o=e.id,a=e.children,s=kh(e,_h),l=(0,t.useMemo)((function(){try{return rh.exports.isFragment((0,t.createElement)(i,null))}catch(e){return!1}}),[i])?{}:Nh({ref:n,id:o,"data-reach-menu":""},s);return(0,t.createElement)(i,l,(0,t.createElement)(zp,{id:o,children:a}))})),Fh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"button":r,o=Wp(Nh({},kh(e,Oh),{ref:n})),a=o.data,s=a.isExpanded,l=a.controls,u=o.props;return(0,t.createElement)(i,Nh({"aria-expanded":!!s||void 0,"aria-haspopup":!0,"aria-controls":l},u,{"data-reach-menu-button":""}))})),Ph=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Kp(Nh({},kh(e,Ih),{ref:n})),a=o.data.disabled,s=o.props;return(0,t.createElement)(i,Nh({role:"menuitem"},s,{"aria-disabled":a||void 0,"data-reach-menu-item":""}))})),jh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=kh(e,Dh);return(0,t.createElement)(Ph,Nh({},o,{ref:n,as:i}))})),Vh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Qp(Nh({},kh(e,Lh),{ref:n})),a=o.data,s=a.activeDescendant,l=a.triggerId,u=o.props;return(0,t.createElement)(i,Nh({"aria-activedescendant":s,"aria-labelledby":l||void 0,role:"menu"},u,{"data-reach-menu-items":""}))})),Uh=(0,t.forwardRef)((function(e,n){var r=e.portal,i=void 0===r||r,o=kh(e,Ah);return(0,t.createElement)(Bh,{portal:i},(0,t.createElement)(Vh,Nh({},o,{ref:n,"data-reach-menu-list":""})))})),Bh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Xp(Nh({},kh(e,Mh),{ref:n})),a=o.data,s=a.portal,l=a.targetRef,u=a.position,c=o.props,d={"data-reach-menu-popover":""};return s?(0,t.createElement)(Md,Nh({},c,d,{as:i,targetRef:l,position:u,unstable_skipInitialPortalRender:!0})):(0,t.createElement)(i,Nh({},c,d))}));const $h=(0,t.forwardRef)(((e,t)=>ce(Fh,m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));$h.displayName="MenuButton";const qh=Qc(Rh,{Button:$h,Item:jh,List:Uh});e.aK=qh;const Hh=(0,t.forwardRef)(((e,t)=>ce(pp,m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));Hh.displayName="ListboxButton";const Gh=Qc(dp,{Button:Hh,Input:cp,Option:bp,Popover:vp});e.aL=Gh;var zh={};var Wh={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},Kh=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Qh={},Xh={};function Yh(e){var t,n,r=Xh[e];if(r)return r;for(r=Xh[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}g(Yh,"getEncodeCache"),g(Jh,"encode$1"),Jh.defaultChars=";/?:@&=+$,-_.!~*'()#",Jh.componentChars="-_.!~*'()";var Zh=Jh,em={};function tm(e){var t,n,r=em[e];if(r)return r;for(r=em[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),r.push(n);for(t=0;t=55296&&l<=57343?"���":String.fromCharCode(l),t+=6):240==(248&i)&&t+91114111?u+="����":(l-=65536,u+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):u+="�";return u}))}g(tm,"getDecodeCache"),g(nm,"decode$1"),nm.defaultChars=";/?:@&=+$,#",nm.componentChars="";var rm=nm,im=g((function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}),"format");function om(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}g(om,"Url");var am=/^([a-z0-9.+-]+:)/i,sm=/:[0-9]*$/,lm=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,um=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),cm=["'"].concat(um),dm=["%","/","?",";","#"].concat(cm),fm=["/","?","#"],pm=/^[+a-z0-9A-Z_-]{0,63}$/,hm=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,mm={javascript:!0,"javascript:":!0},gm={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vm(e,t){if(e&&e instanceof om)return e;var n=new om;return n.parse(e,t),n}g(vm,"urlParse"),om.prototype.parse=function(e,t){var n,r,i,o,a,s=e;if(s=s.trim(),!t&&1===e.split("#").length){var l=lm.exec(s);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=am.exec(s);if(u&&(i=(u=u[0]).toLowerCase(),this.protocol=u,s=s.substr(u.length)),(t||u||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(a="//"===s.substr(0,2))||u&&mm[u]||(s=s.substr(2),this.slashes=!0)),!mm[u]&&(a||u&&!gm[u])){var c,d,f=-1;for(n=0;n127?v+="x":v+=g[y];if(!v.match(pm)){var E=m.slice(0,n),T=m.slice(n+1),w=g.match(hm);w&&(E.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=E.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var C=s.indexOf("#");-1!==C&&(this.hash=s.substr(C),s=s.slice(0,C));var S=s.indexOf("?");return-1!==S&&(this.search=s.substr(S),s=s.slice(0,S)),s&&(this.pathname=s),gm[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},om.prototype.parseHost=function(e){var t=sm.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ym=vm;Qh.encode=Zh,Qh.decode=rm,Qh.format=im,Qh.parse=ym;var bm={},Em=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tm=/[\0-\x1F\x7F-\x9F]/,wm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;bm.Any=Em,bm.Cc=Tm,bm.Cf=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,bm.P=Kh,bm.Z=wm,function(e){function t(e){return Object.prototype.toString.call(e)}function n(e){return"[object String]"===t(e)}g(t,"_class"),g(n,"isString");var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function o(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}function a(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function s(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function l(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}g(i,"has"),g(o,"assign"),g(a,"arrayReplaceAt"),g(s,"isValidEntityCode"),g(l,"fromCodePoint");var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(u.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),d=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,f=Wh;function p(e,t){var n=0;return i(f,t)?f[t]:35===t.charCodeAt(0)&&d.test(t)&&s(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?l(n):e}function h(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}function m(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||p(e,n)}))}g(p,"replaceEntityPattern"),g(h,"unescapeMd"),g(m,"unescapeAll");var v=/[&<>"]/,y=/[&<>"]/g,b={"&":"&","<":"<",">":">",'"':"""};function E(e){return b[e]}function T(e){return v.test(e)?e.replace(y,E):e}g(E,"replaceUnsafeChar"),g(T,"escapeHtml");var w=/[.?*+^$[\]\\(){}|-]/g;function C(e){return e.replace(w,"\\$&")}function S(e){switch(e){case 9:case 32:return!0}return!1}function x(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}g(C,"escapeRE"),g(S,"isSpace"),g(x,"isWhiteSpace");var N=Kh;function k(e){return N.test(e)}function _(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function O(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}g(k,"isPunctChar"),g(_,"isMdAsciiPunct"),g(O,"normalizeReference"),e.lib={},e.lib.mdurl=Qh,e.lib.ucmicro=bm,e.assign=o,e.isString=n,e.has=i,e.unescapeMd=h,e.unescapeAll=m,e.isValidEntityCode=s,e.fromCodePoint=l,e.escapeHtml=T,e.arrayReplaceAt=a,e.isSpace=S,e.isWhiteSpace=x,e.isMdAsciiPunct=_,e.isPunctChar=k,e.escapeRE=C,e.normalizeReference=O}(zh);var Cm={},Sm=g((function(e,t,n){var r,i,o,a,s=-1,l=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos32)return a;if(41===r){if(0===i)break;i--}t++}return o===t||0!==i||(a.str=xm(e.slice(o,t)),a.lines=0,a.pos=t,a.ok=!0),a}),"parseLinkDestination"),km=zh.unescapeAll,_m=g((function(e,t,n){var r,i,o=0,a=t,s={ok:!1,pos:0,lines:0,str:""};if(t>=n)return s;if(34!==(i=e.charCodeAt(t))&&39!==i&&40!==i)return s;for(t++,40===i&&(i=41);t"+Dm(e[t].content)+""},Lm.code_block=function(e,t,n,r,i){var o=e[t];return""+Dm(e[t].content)+"\n"},Lm.fence=function(e,t,n,r,i){var o,a,s,l,u,c=e[t],d=c.info?Im(c.info).trim():"",f="",p="";return d&&(f=(s=d.split(/(\s+)/g))[0],p=s.slice(2).join("")),0===(o=n.highlight&&n.highlight(c.content,f,p)||Dm(c.content)).indexOf(""+o+"\n"):"
"+o+"
\n"},Lm.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},Lm.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},Lm.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},Lm.text=function(e,t){return Dm(e[t].content)},Lm.html_block=function(e,t){return e[t].content},Lm.html_inline=function(e,t){return e[t].content},g(Am,"Renderer$1"),Am.prototype.renderAttrs=g((function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")}),"renderToken"),Am.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,s=e.length;a\s]/i.test(e)}function Hm(e){return/^<\/a\s*>/i.test(e)}g(qm,"isLinkOpen"),g(Hm,"isLinkClose");var Gm=g((function(e){var t,n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y=e.tokens;if(e.md.options.linkify)for(n=0,r=y.length;n=0;t--)if("link_close"!==(a=i[t]).type){if("html_inline"===a.type&&(qm(a.content)&&p>0&&p--,Hm(a.content)&&p++),!(p>0)&&"text"===a.type&&e.md.linkify.test(a.content)){for(u=a.content,v=e.md.linkify.match(u),s=[],f=a.level,d=0,l=0;ld&&((o=new e.Token("text","",0)).content=u.slice(d,c),o.level=f,s.push(o)),(o=new e.Token("link_open","a",1)).attrs=[["href",m]],o.level=f++,o.markup="linkify",o.info="auto",s.push(o),(o=new e.Token("text","",0)).content=g,o.level=f,s.push(o),(o=new e.Token("link_close","a",-1)).level=--f,o.markup="linkify",o.info="auto",s.push(o),d=v[l].lastIndex);d=0;t--)"text"!==(n=e[t]).type||r||(n.content=n.content.replace(Km,Xm)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function Jm(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||r||zm.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}g(Xm,"replaceFn"),g(Ym,"replace_scoped"),g(Jm,"replace_rare");var Zm=g((function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Wm.test(e.tokens[t].content)&&Ym(e.tokens[t].children),zm.test(e.tokens[t].content)&&Jm(e.tokens[t].children))}),"replace"),eg=zh.isWhiteSpace,tg=zh.isPunctChar,ng=zh.isMdAsciiPunct,rg=/['"]/,ig=/['"]/g,og="’";function ag(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function sg(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,E,T,w;for(E=[],n=0;n=0&&!(E[y].level<=l);y--);if(E.length=y+1,"text"===r.type){a=0,s=(i=r.content).length;e:for(;a=0)c=i.charCodeAt(o.index-1);else for(y=n-1;y>=0&&"softbreak"!==e[y].type&&"hardbreak"!==e[y].type;y--)if(e[y].content){c=e[y].content.charCodeAt(e[y].content.length-1);break}if(d=32,a=48&&c<=57&&(v=g=!1),g&&v&&(g=f,v=p),g||v){if(v)for(y=E.length-1;y>=0&&(u=E[y],!(E[y].level=0;t--)"inline"===e.tokens[t].type&&rg.test(e.tokens[t].content)&&sg(e.tokens[t].children,e)}),"smartquotes");function ug(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}g(ug,"Token$3"),ug.prototype.attrIndex=g((function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n=0&&(n=this.attrs[t][1]),n}),"attrGet"),ug.prototype.attrJoin=g((function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t}),"attrJoin");var cg=ug,dg=cg;function fg(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}g(fg,"StateCore"),fg.prototype.Token=dg;var pg=fg,hg=Fm,mg=[["normalize",Vm],["block",Um],["inline",Bm],["linkify",Gm],["replacements",Zm],["smartquotes",lg]];function gg(){this.ruler=new hg;for(var e=0;en)return!1;if(u=t+1,e.sCount[u]=4)return!1;if((a=e.bMarks[u]+e.tShift[u])>=e.eMarks[u])return!1;if(124!==(E=e.src.charCodeAt(a++))&&45!==E&&58!==E)return!1;if(a>=e.eMarks[u])return!1;if(124!==(T=e.src.charCodeAt(a++))&&45!==T&&58!==T&&!yg(T))return!1;if(45===E&&yg(T))return!1;for(;a=4)return!1;if((c=Eg(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),0===(d=c.length)||d!==p.length)return!1;if(r)return!0;for(v=e.parentType,e.parentType="table",b=e.md.block.ruler.getRules("blockquote"),(f=e.push("table_open","table",1)).map=m=[t,0],(f=e.push("thead_open","thead",1)).map=[t,t+1],(f=e.push("tr_open","tr",1)).map=[t,t+1],s=0;s=4)break;for((c=Eg(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),u===t+2&&((f=e.push("tbody_open","tbody",1)).map=g=[t+2,0]),(f=e.push("tr_open","tr",1)).map=[u,u+1],s=0;s=4))break;i=++r}return e.line=i,(o=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}),"code"),Cg=g((function(e,t,n,r){var i,o,a,s,l,u,c,d=!1,f=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(f+3>p)return!1;if(126!==(i=e.src.charCodeAt(f))&&96!==i)return!1;if(l=f,(o=(f=e.skipChars(f,i))-l)<3)return!1;if(c=e.src.slice(l,f),a=e.src.slice(f,p),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=t;!(++s>=n||(f=l=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.sCount[s]=4||(f=e.skipChars(f,i))-l=4)return!1;if(62!==e.src.charCodeAt(x++))return!1;if(r)return!0;for(s=f=e.sCount[t]+1,32===e.src.charCodeAt(x)?(x++,s++,f++,i=!1,b=!0):9===e.src.charCodeAt(x)?(b=!0,(e.bsCount[t]+f)%4==3?(x++,s++,f++,i=!1):i=!0):b=!1,p=[e.bMarks[t]],e.bMarks[t]=x;x=N,v=[e.sCount[t]],e.sCount[t]=f-s,y=[e.tShift[t]],e.tShift[t]=x-e.bMarks[t],T=e.md.block.ruler.getRules("blockquote"),g=e.parentType,e.parentType="blockquote",d=t+1;d=(N=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(x++)||C){if(u)break;for(E=!1,a=0,l=T.length;a=N,h.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(b?1:0),v.push(e.sCount[d]),e.sCount[d]=f-s,y.push(e.tShift[d]),e.tShift[d]=x-e.bMarks[d]}for(m=e.blkIndent,e.blkIndent=0,(w=e.push("blockquote_open","blockquote",1)).markup=">",w.map=c=[t,0],e.md.block.tokenize(e,t,d),(w=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=S,e.parentType=g,c[1]=e.line,a=0;a=4)return!1;if(42!==(i=e.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(o=1;l=o)return-1;if((n=e.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=o)return-1;if(!((n=e.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-r>=10)return-1}return i=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(L=!0),(N=Ig(e,t))>=0){if(c=!0,_=e.bMarks[t]+e.tShift[t],g=Number(e.src.slice(_,N-1)),L&&1!==g)return!1}else{if(!((N=Og(e,t))>=0))return!1;c=!1}if(L&&e.skipSpaces(N)>=e.eMarks[t])return!1;if(m=e.src.charCodeAt(N-1),r)return!0;for(h=e.tokens.length,c?(D=e.push("ordered_list_open","ol",1),1!==g&&(D.attrs=[["start",g]])):D=e.push("bullet_list_open","ul",1),D.map=p=[t,0],D.markup=String.fromCharCode(m),y=t,k=!1,I=e.md.block.ruler.getRules("list"),T=e.parentType,e.parentType="list";y=v?1:b-u)>4&&(l=1),s=u+l,(D=e.push("list_item_open","li",1)).markup=String.fromCharCode(m),D.map=d=[t,0],c&&(D.info=e.src.slice(_,N-1)),S=e.tight,C=e.tShift[t],w=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=s,e.tight=!0,e.tShift[t]=o-e.bMarks[t],e.sCount[t]=b,o>=v&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!k||(A=!1),k=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=C,e.sCount[t]=w,e.tight=S,(D=e.push("list_item_close","li",-1)).markup=String.fromCharCode(m),y=t=e.line,d[1]=y,o=e.bMarks[t],y>=n)break;if(e.sCount[y]=4)break;for(O=!1,a=0,f=I.length;a=4)return!1;if(91!==e.src.charCodeAt(T))return!1;for(;++T3||e.sCount[C]<0)){for(v=!1,u=0,c=y.length;u`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",jg="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Vg=new RegExp("^(?:"+Pg+"|"+jg+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),Ug=new RegExp("^(?:"+Pg+"|"+jg+")");Fg.HTML_TAG_RE=Vg,Fg.HTML_OPEN_CLOSE_TAG_RE=Ug;var Bg=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$g=Fg.HTML_OPEN_CLOSE_TAG_RE,qg=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp($g.source+"\\s*$"),/^$/,!1]],Hg=g((function(e,t,n,r){var i,o,a,s,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(s=e.src.slice(l,u),i=0;i=4)return!1;if(35!==(i=e.src.charCodeAt(l))||l>=u)return!1;for(o=1,i=e.src.charCodeAt(++l);35===i&&l6||ll&&Gg(e.src.charCodeAt(a-1))&&(u=a),e.line=t+1,(s=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),s.map=[t,e.line],(s=e.push("inline","",0)).content=e.src.slice(l,u).trim(),s.map=[t,e.line],s.children=[],(s=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),0))}),"heading"),Wg=g((function(e,t,n){var r,i,o,a,s,l,u,c,d,f,p=t+1,h=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(f=e.parentType,e.parentType="paragraph";p3)){if(e.sCount[p]>=e.blkIndent&&(l=e.bMarks[p]+e.tShift[p])<(u=e.eMarks[p])&&(45===(d=e.src.charCodeAt(l))||61===d)&&(l=e.skipChars(l,d),(l=e.skipSpaces(l))>=u)){c=61===d?1:2;break}if(!(e.sCount[p]<0)){for(i=!1,o=0,a=h.length;o3||e.sCount[l]<0)){for(r=!1,i=0,o=u.length;i0&&this.level++,this.tokens.push(r),r},Yg.prototype.isEmpty=g((function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}),"isEmpty"),Yg.prototype.skipEmptyLines=g((function(e){for(var t=this.lineMax;et;)if(!Xg(this.src.charCodeAt(--e)))return e+1;return e}),"skipSpacesBack"),Yg.prototype.skipChars=g((function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e}),"skipCharsBack"),Yg.prototype.getLines=g((function(e,t,n,r){var i,o,a,s,l,u,c,d=e;if(e>=t)return"";for(u=new Array(t-e),i=0;dn?new Array(o-n+1).join(" ")+this.src.slice(s,l):this.src.slice(s,l)}return u.join("")}),"getLines"),Yg.prototype.Token=Qg;var Jg=Yg,Zg=Fm,ev=[["table",Tg,["paragraph","reference"]],["code",wg],["fence",Cg,["paragraph","reference","blockquote","list"]],["blockquote",xg,["paragraph","reference","blockquote","list"]],["hr",kg,["paragraph","reference","blockquote","list"]],["list",Lg,["paragraph","reference","blockquote"]],["reference",Rg],["html_block",Hg,["paragraph","reference","blockquote"]],["heading",zg,["paragraph","reference","blockquote"]],["lheading",Wg],["paragraph",Kg]];function tv(){this.ruler=new Zg;for(var e=0;e=n))&&!(e.sCount[a]=l){e.line=n;break}for(r=0;r=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach((function(e){lv[e.charCodeAt(0)]=1}));var cv=g((function(e,t){var n,r=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1&&t[n-1].marker===r.marker,a=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=e.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}hv.tokenize=g((function(e,t){var n,r,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n=p)return!1;if(h=s,(l=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",h=s;s=p||41!==e.src.charCodeAt(s))&&(m=!0),s++}if(m){if(void 0===e.env.references)return!1;if(s=0?i=e.src.slice(h,s++):s=o+1):s=o+1,i||(i=e.src.slice(a,o)),!(u=e.env.references[gv(i)]))return e.pos=f,!1;c=u.href,d=u.title}return t||(e.pos=a,e.posMax=o,e.push("link_open","a",1).attrs=n=[["href",c]],d&&n.push(["title",d]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=s,e.posMax=p,!0}),"link"),bv=zh.normalizeReference,Ev=zh.isSpace,Tv=g((function(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,h,m="",g=e.pos,v=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(s=e.pos+2,(a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((l=a+1)=v)return!1;for(h=l,(c=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok&&(m=e.md.normalizeLink(c.str),e.md.validateLink(m)?l=c.pos:m=""),h=l;l=v||41!==e.src.charCodeAt(l))return e.pos=g,!1;l++}else{if(void 0===e.env.references)return!1;if(l=0?o=e.src.slice(h,l++):l=a+1):l=a+1,o||(o=e.src.slice(s,a)),!(u=e.env.references[bv(o)]))return e.pos=g,!1;m=u.href,d=u.title}return t||(i=e.src.slice(s,a),e.md.inline.parse(i,e.md,e.env,p=[]),(f=e.push("image","img",0)).attrs=n=[["src",m],["alt",""]],f.children=p,f.content=i,d&&n.push(["title",d])),e.pos=l,e.posMax=v,!0}),"image"),wv=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Cv=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,Sv=g((function(e,t){var n,r,i,o,a,s,l=e.pos;if(60!==e.src.charCodeAt(l))return!1;for(a=e.pos,s=e.posMax;;){if(++l>=s)return!1;if(60===(o=e.src.charCodeAt(l)))return!1;if(62===o)break}return n=e.src.slice(a+1,l),Cv.test(n)?(r=e.md.normalizeLink(n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0)):!!wv.test(n)&&(r=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0))}),"autolink"),xv=Fg.HTML_TAG_RE;function Nv(e){var t=32|e;return t>=97&&t<=122}g(Nv,"isLetter");var kv=g((function(e,t){var n,r,i,o=e.pos;return!(!e.md.options.html||(i=e.posMax,60!==e.src.charCodeAt(o)||o+2>=i||33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!Nv(n)||!(r=e.src.slice(o).match(xv))||(t||(e.push("html_inline","",0).content=e.src.slice(o,o+r[0].length)),e.pos+=r[0].length,0)))}),"html_inline"),_v=Wh,Ov=zh.has,Iv=zh.isValidEntityCode,Dv=zh.fromCodePoint,Lv=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Av=/^&([a-z][a-z0-9]{1,31});/i,Mv=g((function(e,t){var n,r,i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1a;r-=o.jump+1)if((o=t[r]).marker===i.marker&&o.open&&o.end<0&&(l=!1,(o.close||i.open)&&(o.length+i.length)%3==0&&(o.length%3==0&&i.length%3==0||(l=!0)),!l)){u=r>0&&!t[r-1].open?t[r-1].jump+1:0,i.jump=n-r+u,i.open=!1,o.end=n,o.jump=u,o.close=!1,s=-1;break}-1!==s&&(c[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}g(Rv,"processDelimiters");var Fv=g((function(e){var t,n=e.tokens_meta,r=e.tokens_meta.length;for(Rv(0,e.delimiters),t=0;t0&&r++,"text"===i[t].type&&t+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},$v.prototype.scanDelims=function(e,t){var n,r,i,o,a,s,l,u,c,d=e,f=!0,p=!0,h=this.posMax,m=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;d=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Wv.prototype.parse=function(e,t,n,r){var i,o,a,s=new this.State(e,t,n,r);for(this.tokenize(s),a=(o=this.ruler2.getRules("")).length,i=0;i|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),"re");function Xv(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function Yv(e){return Object.prototype.toString.call(e)}function Jv(e){return"[object String]"===Yv(e)}function Zv(e){return"[object Object]"===Yv(e)}function ey(e){return"[object RegExp]"===Yv(e)}function ty(e){return"[object Function]"===Yv(e)}function ny(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}g(Xv,"assign"),g(Yv,"_class"),g(Jv,"isString"),g(Zv,"isObject"),g(ey,"isRegExp"),g(ty,"isFunction"),g(ny,"escapeRE");var ry={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function iy(e){return Object.keys(e||{}).reduce((function(e,t){return e||ry.hasOwnProperty(t)}),!1)}g(iy,"isOptionsObj");var oy={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},ay="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",sy="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function ly(e){e.__index__=-1,e.__text_cache__=""}function uy(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function cy(){return function(e,t){t.normalize(e)}}function dy(e){var t=e.re=Qv(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push(ay),n.push(t.src_xn),t.src_tlds=n.join("|"),g(r,"untpl"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var i=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},g(o,"schemaError"),Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,Zv(n))return ey(n.validate)?r.validate=uy(n.validate):ty(n.validate)?r.validate=n.validate:o(t,n),void(ty(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});Jv(n)?i.push(t):o(t,n)}})),i.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var a=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(ny).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),ly(e)}function fy(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function py(e,t){var n=new fy(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function hy(e,t){if(!(this instanceof hy))return new hy(e,t);t||iy(e)&&(t=e,e={}),this.__opts__=Xv({},ry,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Xv({},oy,e),this.__compiled__={},this.__tlds__=sy,this.__tlds_replaced__=!1,this.re={},dy(this)}g(ly,"resetScanCache"),g(uy,"createValidator"),g(cy,"createNormalizer"),g(dy,"compile"),g(fy,"Match"),g(py,"createMatch"),g(hy,"LinkifyIt$1"),hy.prototype.add=g((function(e,t){return this.__schemas__[e]=t,dy(this),this}),"add"),hy.prototype.set=g((function(e){return this.__opts__=Xv(this.__opts__,e),this}),"set"),hy.prototype.test=g((function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,s,l;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(i=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||l=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0}),"test"),hy.prototype.pretest=g((function(e){return this.re.pretest.test(e)}),"pretest"),hy.prototype.testSchemaAt=g((function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0}),"testSchemaAt"),hy.prototype.match=g((function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(py(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(py(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null}),"match"),hy.prototype.tlds=g((function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),dy(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,dy(this),this)}),"tlds"),hy.prototype.normalize=g((function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)}),"normalize"),hy.prototype.onCompile=g((function(){}),"onCompile");var my=hy;const gy=2147483647,vy=36,yy=/^xn--/,by=/[^\0-\x7E]/,Ey=/[\x2E\u3002\uFF0E\uFF61]/g,Ty={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},wy=Math.floor,Cy=String.fromCharCode;function Sy(e){throw new RangeError(Ty[e])}function xy(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Ny(e,t){const n=e.split("@");let r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+xy((e=e.replace(Ey,".")).split("."),t).join(".")}function ky(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e)),"ucs2encode"),Oy=g((function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:vy}),"basicToDigit"),Iy=g((function(e,t){return e+22+75*(e<26)-((0!=t)<<5)}),"digitToBasic"),Dy=g((function(e,t,n){let r=0;for(e=n?wy(e/700):e>>1,e+=wy(e/t);e>455;r+=vy)e=wy(e/35);return wy(r+36*e/(e+38))}),"adapt"),Ly=g((function(e){const t=[],n=e.length;let r=0,i=128,o=72,a=e.lastIndexOf("-");a<0&&(a=0);for(let n=0;n=128&&Sy("not-basic"),t.push(e.charCodeAt(n));for(let s=a>0?a+1:0;s=n&&Sy("invalid-input");const a=Oy(e.charCodeAt(s++));(a>=vy||a>wy((gy-r)/t))&&Sy("overflow"),r+=a*t;const l=i<=o?1:i>=o+26?26:i-o;if(awy(gy/u)&&Sy("overflow"),t*=u}const l=t.length+1;o=Dy(r-a,l,0==a),wy(r/l)>gy-i&&Sy("overflow"),i+=wy(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)}),"decode"),Ay=g((function(e){const t=[];let n=(e=ky(e)).length,r=128,i=0,o=72;for(const n of e)n<128&&t.push(Cy(n));let a=t.length,s=a;for(a&&t.push("-");s=r&&twy((gy-i)/l)&&Sy("overflow"),i+=(n-r)*l,r=n;for(const n of e)if(ngy&&Sy("overflow"),n==r){let e=i;for(let n=vy;;n+=vy){const r=n<=o?1:n>=o+26?26:n-o;if(e=0))try{t.hostname=zy.toASCII(t.hostname)}catch(e){}return Gy.encode(Gy.format(t))}function Zy(e){var t=Gy.parse(e,!0);if(t.hostname&&(!t.protocol||Yy.indexOf(t.protocol)>=0))try{t.hostname=zy.toUnicode(t.hostname)}catch(e){}return Gy.decode(Gy.format(t),Gy.decode.defaultChars+"%")}function eb(e,t){if(!(this instanceof eb))return new eb(e,t);t||jy.isString(e)||(t=e||{},e="default"),this.inline=new qy,this.block=new $y,this.core=new By,this.renderer=new Uy,this.linkify=new Hy,this.validateLink=Xy,this.normalizeLink=Jy,this.normalizeLinkText=Zy,this.utils=jy,this.helpers=jy.assign({},Vy),this.options={},this.configure(e),t&&this.set(t)}g(Jy,"normalizeLink"),g(Zy,"normalizeLinkText"),g(eb,"MarkdownIt"),eb.prototype.set=function(e){return jy.assign(this.options,e),this},eb.prototype.configure=function(e){var t,n=this;if(jy.isString(e)&&!(e=Wy[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},eb.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},eb.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},eb.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},eb.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},eb.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},eb.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},eb.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const tb=new eb({breaks:!0,linkify:!0}),nb=(0,t.forwardRef)(((e,t)=>{var n=e,{children:r,onlyShowFirstChild:i,type:o}=n,a=v(n,["children","onlyShowFirstChild","type"]);return ce("div",m(h({},a),{ref:t,className:b(`graphiql-markdown-${o}`,i&&"graphiql-markdown-preview",a.className),dangerouslySetInnerHTML:{__html:tb.render(r)}}))}));e.aM=nb,nb.displayName="MarkdownContent";const rb=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,className:b("graphiql-spinner",e.className)}))));function ib(e){var t,n,r=hs(e),i=r.defaultView||window;return r?{width:null!=(t=r.documentElement.clientWidth)?t:i.innerWidth,height:null!=(n=r.documentElement.clientHeight)?n:i.innerHeight}:{width:0,height:0}}function ob(){return ob=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}e.aN=rb,rb.displayName="Spinner",g(ib,"getDocumentDimensions"),g(ob,"_extends$1"),g(ab,"_objectWithoutPropertiesLoose$1");var sb,lb,ub,cb,db,fb,pb,hb,mb,gb,vb=["children","label","ariaLabel","id","DEBUG_STYLE"],yb=["label","ariaLabel","isVisible","id"],bb=["ariaLabel","aria-label","as","id","isVisible","label","position","style","triggerRect"],Eb=["type"],Tb=100,wb=500;(gb=pb||(pb={})).Idle="IDLE",gb.Focused="FOCUSED",gb.Visible="VISIBLE",gb.LeavingVisible="LEAVING_VISIBLE",gb.Dismissed="DISMISSED",(mb=hb||(hb={})).Blur="BLUR",mb.Focus="FOCUS",mb.GlobalMouseMove="GLOBAL_MOUSE_MOVE",mb.MouseDown="MOUSE_DOWN",mb.MouseEnter="MOUSE_ENTER",mb.MouseLeave="MOUSE_LEAVE",mb.MouseMove="MOUSE_MOVE",mb.Rest="REST",mb.SelectWithKeyboard="SELECT_WITH_KEYBOARD",mb.TimeComplete="TIME_COMPLETE";var Cb,Sb,xb={initial:pb.Idle,states:(fb={},fb[pb.Idle]={enter:Mb,on:(sb={},sb[hb.MouseEnter]=pb.Focused,sb[hb.Focus]=pb.Visible,sb)},fb[pb.Focused]={enter:Ib,leave:Db,on:(lb={},lb[hb.MouseMove]=pb.Focused,lb[hb.MouseLeave]=pb.Idle,lb[hb.MouseDown]=pb.Dismissed,lb[hb.Blur]=pb.Idle,lb[hb.Rest]=pb.Visible,lb)},fb[pb.Visible]={on:(ub={},ub[hb.Focus]=pb.Focused,ub[hb.MouseEnter]=pb.Focused,ub[hb.MouseLeave]=pb.LeavingVisible,ub[hb.Blur]=pb.LeavingVisible,ub[hb.MouseDown]=pb.Dismissed,ub[hb.SelectWithKeyboard]=pb.Dismissed,ub[hb.GlobalMouseMove]=pb.LeavingVisible,ub)},fb[pb.LeavingVisible]={enter:Lb,leave:g((function(){Ab(),Mb()}),"leave"),on:(cb={},cb[hb.MouseEnter]=pb.Visible,cb[hb.Focus]=pb.Visible,cb[hb.TimeComplete]=pb.Idle,cb)},fb[pb.Dismissed]={leave:g((function(){Mb()}),"leave"),on:(db={},db[hb.MouseLeave]=pb.Idle,db[hb.Blur]=pb.Idle,db)},fb)},Nb={value:xb.initial,context:{id:null}},kb=[];function _b(e){return kb.push(e),function(){kb.splice(kb.indexOf(e),1)}}function Ob(){kb.forEach((function(e){return e(Nb)}))}function Ib(){window.clearTimeout(Cb),Cb=window.setTimeout((function(){$b({type:hb.Rest})}),Tb)}function Db(){window.clearTimeout(Cb)}function Lb(){window.clearTimeout(Sb),Sb=window.setTimeout((function(){return $b({type:hb.TimeComplete})}),wb)}function Ab(){window.clearTimeout(Sb)}function Mb(){Nb.context.id=null}function Rb(e){var n=void 0===e?{}:e,r=n.id,i=n.onPointerEnter,o=n.onPointerMove,a=n.onPointerLeave,s=n.onPointerDown,l=n.onMouseEnter,u=n.onMouseMove,c=n.onMouseLeave,d=n.onMouseDown,f=n.onFocus,p=n.onBlur,h=n.onKeyDown,m=n.disabled,v=n.ref,y=n.DEBUG_STYLE,b=String(nd(r)),E=(0,t.useState)(!!y||Hb(b,!0)),T=E[0],w=E[1],C=(0,t.useRef)(null),S=Cs(v,C),x=ud(C,{observe:T});function N(e,t){return"undefined"!=typeof window&&"PointerEvent"in window?e:Ss(e,t)}function k(e){return g((function(t){"mouse"===t.pointerType&&e(t)}),"onPointerEvent")}function _(){$b({type:hb.MouseEnter,id:b})}function O(){$b({type:hb.MouseMove,id:b})}function I(){$b({type:hb.MouseLeave})}function D(){Nb.context.id===b&&$b({type:hb.MouseDown})}function L(){window.__REACH_DISABLE_TOOLTIPS||$b({type:hb.Focus,id:b})}function A(){Nb.context.id===b&&$b({type:hb.Blur})}function M(e){"Enter"!==e.key&&" "!==e.key||$b({type:hb.SelectWithKeyboard})}return(0,t.useEffect)((function(){return _b((function(){w(Hb(b))}))}),[b]),(0,t.useEffect)((function(){var e=hs(C.current);function t(e){"Escape"!==e.key&&"Esc"!==e.key||Nb.value!==pb.Visible||$b({type:hb.SelectWithKeyboard})}return g(t,"listener"),e.addEventListener("keydown",t),function(){return e.removeEventListener("keydown",t)}}),[]),Bb({disabled:m,isVisible:T,ref:C}),g(N,"wrapMouseEvent"),g(k,"wrapPointerEventHandler"),g(_,"handleMouseEnter"),g(O,"handleMouseMove"),g(I,"handleMouseLeave"),g(D,"handleMouseDown"),g(L,"handleFocus"),g(A,"handleBlur"),g(M,"handleKeyDown"),[{"aria-describedby":T?sf("tooltip",b):void 0,"data-state":T?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:S,onPointerEnter:Ss(i,k(_)),onPointerMove:Ss(o,k(O)),onPointerLeave:Ss(a,k(I)),onPointerDown:Ss(s,k(D)),onMouseEnter:N(l,_),onMouseMove:N(u,O),onMouseLeave:N(c,I),onMouseDown:N(d,D),onFocus:Ss(f,L),onBlur:Ss(p,A),onKeyDown:Ss(h,M)},{id:b,triggerRect:x,isVisible:T},T]}g(_b,"subscribe"),g(Ob,"notify"),g(Ib,"startRestTimer"),g(Db,"clearRestTimer"),g(Lb,"startLeavingVisibleTimer"),g(Ab,"clearLeavingVisibleTimer"),g(Mb,"clearContextId"),g(Rb,"useTooltip");var Fb=(0,t.forwardRef)((function(e,n){var r=e.children,i=e.label,o=e.ariaLabel,a=e.id,s=e.DEBUG_STYLE,l=ab(e,vb),u=t.Children.only(r),c=Rb({id:a,onPointerEnter:u.props.onPointerEnter,onPointerMove:u.props.onPointerMove,onPointerLeave:u.props.onPointerLeave,onPointerDown:u.props.onPointerDown,onMouseEnter:u.props.onMouseEnter,onMouseMove:u.props.onMouseMove,onMouseLeave:u.props.onMouseLeave,onMouseDown:u.props.onMouseDown,onFocus:u.props.onFocus,onBlur:u.props.onBlur,onKeyDown:u.props.onKeyDown,disabled:u.props.disabled,ref:u.ref,DEBUG_STYLE:s}),d=c[0],f=c[1];return(0,t.createElement)(t.Fragment,null,(0,t.cloneElement)(u,d),(0,t.createElement)(Pb,ob({ref:n,label:i,"aria-label":o},f,l)))}));e.aQ=Fb;var Pb=(0,t.forwardRef)(g((function(e,n){var r=e.label,i=e.ariaLabel,o=e.isVisible,a=e.id,s=ab(e,yb);return o?(0,t.createElement)(ps,null,(0,t.createElement)(jb,ob({ref:n,label:r,"aria-label":i,isVisible:o},s,{id:sf("tooltip",String(a))}))):null}),"TooltipPopup")),jb=(0,t.forwardRef)(g((function(e,n){var r=e.ariaLabel,i=e["aria-label"],o=e.as,a=void 0===o?"div":o,s=e.id,l=e.isVisible,u=e.label,c=e.position,d=void 0===c?Ub:c,f=e.style,p=e.triggerRect,h=ab(e,bb),m=null!=(i||r),g=(0,t.useRef)(null),v=Cs(n,g),y=ud(g,{observe:l});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(a,ob({role:m?void 0:"tooltip"},h,{ref:v,"data-reach-tooltip":"",id:m?void 0:s,style:ob({},f,Vb(d,p,y))}),u),m&&(0,t.createElement)(Wc,{role:"tooltip",id:s},i||r))}),"TooltipContent"));function Vb(e,t,n){return n?e(t,n):{visibility:"hidden"}}g(Vb,"getStyles");var Ub=g((function(e,t,n){void 0===n&&(n=8);var r=ib(),i=r.width,o=r.height;if(!e||!t)return{};var a={top:e.top-t.height<0,right:i{var n=e,{isActive:r}=n,i=v(n,["isActive"]);return ce("div",m(h({},i),{ref:t,role:"tab","aria-selected":r,className:b("graphiql-tab",r&&"graphiql-tab-active",i.className),children:i.children}))}));Gb.displayName="Tab";const zb=(0,t.forwardRef)(((e,t)=>ce(is,m(h({},e),{ref:t,type:"button",className:b("graphiql-tab-button",e.className),children:e.children}))));zb.displayName="Tab.Button";const Wb=(0,t.forwardRef)(((e,t)=>ce(Fb,{label:"Close Tab",children:ce(is,m(h({"aria-label":"Close Tab"},e),{ref:t,type:"button",className:b("graphiql-tab-close",e.className),children:ce(Da,{})}))})));Wb.displayName="Tab.Close";const Kb=Qc(Gb,{Button:zb,Close:Wb});e.aO=Kb;const Qb=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,role:"tablist",className:b("graphiql-tabs",e.className),children:e.children}))));e.aP=Qb,Qb.displayName="Tabs";var Xb=Object.defineProperty,Yb=g(((e,t)=>Xb(e,"name",{value:t,configurable:!0})),"__name$C");const Jb=Q("HistoryContext");function Zb(e){var n;const r=ve(),i=(0,t.useRef)(new z(r||new q(null),e.maxHistoryLength||tE)),[o,a]=(0,t.useState)((null==(n=i.current)?void 0:n.queries)||[]),s=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o}=e;var s;null==(s=i.current)||s.updateHistory(t,n,r,o),a(i.current.queries)}),[]),l=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o,label:s,favorite:l}=e;i.current.editLabel(t,n,r,o,s,l),a(i.current.queries)}),[]),u=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o,label:s,favorite:l}=e;i.current.toggleFavorite(t,n,r,o,s,l),a(i.current.queries)}),[]),c=(0,t.useMemo)((()=>({addToHistory:s,editLabel:l,items:o,toggleFavorite:u})),[s,l,o,u]);return ce(Jb.Provider,{value:c,children:e.children})}e.X=Jb,g(Zb,"HistoryContextProvider"),Yb(Zb,"HistoryContextProvider");const eE=X(Jb);e.Z=eE;const tE=20;var nE=Object.defineProperty,rE=g(((e,t)=>nE(e,"name",{value:t,configurable:!0})),"__name$B");function iE(){const{items:e}=eE({nonNull:!0}),n=e.slice().reverse();return de("section",{"aria-label":"History",className:"graphiql-history",children:[ce("div",{className:"graphiql-history-header",children:"History"}),ce("ul",{className:"graphiql-history-items",children:n.map(((e,r)=>de(t.Fragment,{children:[ce(oE,{item:e}),e.favorite&&n[r+1]&&!n[r+1].favorite?ce("div",{className:"graphiql-history-item-spacer"}):null]},`${r}:${e.label||e.query}`)))})]})}function oE(e){const{editLabel:n,toggleFavorite:r}=eE({nonNull:!0,caller:oE}),{headerEditor:i,queryEditor:o,variableEditor:a}=iS({nonNull:!0,caller:oE}),s=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,c]=(0,t.useState)(!1);(0,t.useEffect)((()=>{u&&s.current&&s.current.focus()}),[u]);const d=e.item.label||e.item.operationName||aE(e.item.query);return ce("li",{className:b("graphiql-history-item",u&&"editable"),children:de(fe,u?{children:[ce("input",{type:"text",defaultValue:e.item.label,ref:s,onKeyDown:t=>{27===t.keyCode?c(!1):13===t.keyCode&&(c(!1),n(m(h({},e.item),{label:t.currentTarget.value})))},placeholder:"Type a label"}),ce(is,{type:"button",ref:l,onClick:()=>{var t;c(!1),n(m(h({},e.item),{label:null==(t=s.current)?void 0:t.value}))},children:"Save"}),ce(is,{type:"button",ref:l,onClick:()=>{c(!1)},children:ce(Da,{})})]}:{children:[ce(is,{type:"button",className:"graphiql-history-item-label",onClick:()=>{var t,n,r;null==o||o.setValue(null!=(t=e.item.query)?t:""),null==a||a.setValue(null!=(n=e.item.variables)?n:""),null==i||i.setValue(null!=(r=e.item.headers)?r:"")},children:d}),ce(Fb,{label:"Edit label",children:ce(is,{type:"button",className:"graphiql-history-item-action",onClick:e=>{e.stopPropagation(),c(!0)},"aria-label":"Edit label",children:ce(za,{"aria-hidden":"true"})})}),ce(Fb,{label:e.item.favorite?"Remove favorite":"Add favorite",children:ce(is,{type:"button",className:"graphiql-history-item-action",onClick:t=>{t.stopPropagation(),r(e.item)},"aria-label":e.item.favorite?"Remove favorite":"Add favorite",children:e.item.favorite?ce(Za,{"aria-hidden":"true"}):ce(es,{"aria-hidden":"true"})})})]})})}function aE(e){return null==e?void 0:e.split("\n").map((e=>e.replace(/#(.*)/,""))).join(" ").replaceAll("{"," { ").replaceAll("}"," } ").replaceAll(/[\s]{2,}/g," ")}g(iE,"History"),rE(iE,"History"),g(oE,"HistoryItem"),rE(oE,"HistoryItem"),g(aE,"formatQuery"),rE(aE,"formatQuery");var sE=Object.defineProperty,lE=g(((e,t)=>sE(e,"name",{value:t,configurable:!0})),"__name$A");const uE=Q("ExecutionContext");function cE(e){let{fetcher:n,getDefaultFieldNames:i,children:o,operationName:a}=e;if(!n)throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop.");const{externalFragments:s,headerEditor:l,queryEditor:u,responseEditor:c,variableEditor:d,updateActiveTabValues:f}=iS({nonNull:!0,caller:cE}),p=eE(),m=dC({getDefaultFieldNames:i,caller:cE}),[g,y]=(0,t.useState)(!1),[b,E]=(0,t.useState)(null),T=(0,t.useRef)(0),S=(0,t.useCallback)((()=>{null==b||b.unsubscribe(),y(!1),E(null)}),[b]),x=(0,t.useCallback)((async()=>{var e,t;if(!u||!c)return;if(b)return void S();const i=lE((e=>{c.setValue(e),f({response:e})}),"setResponse");T.current+=1;const o=T.current;let g=m()||u.getValue();const x=null==d?void 0:d.getValue();let N;try{N=fE({json:x,errorMessageParse:"Variables are invalid JSON",errorMessageType:"Variables are not a JSON object."})}catch(e){return void i(e instanceof Error?e.message:`${e}`)}const k=null==l?void 0:l.getValue();let _;try{_=fE({json:k,errorMessageParse:"Headers are invalid JSON",errorMessageType:"Headers are not a JSON object."})}catch(e){return void i(e instanceof Error?e.message:`${e}`)}if(s){const e=u.documentAST?ko(u.documentAST,s):[];e.length>0&&(g+="\n"+e.map((e=>(0,r.print)(e))).join("\n"))}i(""),y(!0);const O=null!=(e=null!=a?a:u.operationName)?e:void 0;null==p||p.addToHistory({query:g,variables:x,headers:k,operationName:O});try{let e={data:{}};const r=lE((t=>{if(o!==T.current)return;let n=!!Array.isArray(t)&&t;if(!n&&"object"==typeof t&&null!==t&&"hasNext"in t&&(n=[t]),n){const t={data:e.data},r=[...(null==e?void 0:e.errors)||[],...n.flatMap((e=>e.errors)).filter(Boolean)];r.length&&(t.errors=r);for(const r of n){const n=r,{path:i,data:o,errors:a}=n,s=v(n,["path","data","errors"]);if(i){if(!o)throw new Error(`Expected part to contain a data property, but got ${r}`);Ko(t.data,i,o,{merge:!0})}else o&&(t.data=o);e=h(h({},t),s)}y(!1),i(D(e))}else{const e=D(t);y(!1),i(e)}}),"handleResponse"),a=n({query:g,variables:N,operationName:O},{headers:null!=_?_:void 0,documentAST:null!=(t=u.documentAST)?t:void 0}),s=await Promise.resolve(a);if(w(s))E(s.subscribe({next(e){r(e)},error(e){y(!1),e&&i(I(e)),E(null)},complete(){y(!1),E(null)}}));else if(C(s)){E({unsubscribe:()=>{var e,t;return null==(t=(e=s[Symbol.asyncIterator]()).return)?void 0:t.call(e)}});for await(const e of s)r(e);y(!1),E(null)}else r(s)}catch(e){y(!1),i(I(e)),E(null)}}),[m,s,n,l,p,a,u,c,S,b,f,d]),N=Boolean(b),k=(0,t.useMemo)((()=>({isFetching:g,isSubscribed:N,operationName:null!=a?a:null,run:x,stop:S})),[g,N,a,x,S]);return ce(uE.Provider,{value:k,children:o})}e.r=uE,g(cE,"ExecutionContextProvider"),lE(cE,"ExecutionContextProvider");const dE=X(uE);function fE(e){let t,{json:n,errorMessageParse:r,errorMessageType:i}=e;try{t=n&&""!==n.trim()?JSON.parse(n):void 0}catch(e){throw new Error(`${r}: ${e instanceof Error?e.message:e}.`)}const o="object"==typeof t&&null!==t&&!Array.isArray(t);if(void 0!==t&&!o)throw new Error(i);return t}e.v=dE,g(fE,"tryParseJsonObject"),lE(fE,"tryParseJsonObject");var pE=Object.defineProperty,hE=g(((e,t)=>pE(e,"name",{value:t,configurable:!0})),"__name$z");const mE="graphiql",gE="sublime";let vE=!1;"object"==typeof window&&(vE=0===window.navigator.platform.toLowerCase().indexOf("mac"));const yE={[vE?"Cmd-F":"Ctrl-F"]:"findPersistent","Cmd-G":"findPersistent","Ctrl-G":"findPersistent","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"};async function bE(e,t){const r=await Promise.resolve().then(n.t.bind(n,535,23)).then((function(e){return e.c})).then((e=>"function"==typeof e?e:e.default));return await Promise.all(!1===(null==t?void 0:t.useCommonAddons)?e:[Promise.resolve().then(n.t.bind(n,6980,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,9171,23)).then((function(e){return e.m})),Promise.resolve().then(n.t.bind(n,5728,23)).then((function(e){return e.c})),Promise.resolve().then(n.t.bind(n,4468,23)).then((function(e){return e.b})),Promise.resolve().then(n.t.bind(n,8419,23)).then((function(e){return e.f})),Promise.resolve().then(n.t.bind(n,4054,23)).then((function(e){return e.l})),Promise.resolve().then(n.t.bind(n,9407,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4471,23)).then((function(e){return e.j})),Promise.resolve().then(n.t.bind(n,8058,23)).then((function(e){return e.d})),Promise.resolve().then(n.t.bind(n,2568,23)).then((function(e){return e.s})),...e]),r}g(bE,"importCodeMirror"),hE(bE,"importCodeMirror");var EE=g((function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;rNE(e,"name",{value:t,configurable:!0})),"__name$y");const _E=kE((e=>e?(0,r.print)(e):""),"printDefault");function OE(e){let{field:t}=e;if(!("defaultValue"in t)||void 0===t.defaultValue)return null;const n=(0,r.astFromValue)(t.defaultValue,t.type);return n?de(fe,{children:[" = ",ce("span",{className:"graphiql-doc-explorer-default-value",children:_E(n)})]}):null}g(OE,"DefaultValue"),kE(OE,"DefaultValue");var IE=Object.defineProperty,DE=g(((e,t)=>IE(e,"name",{value:t,configurable:!0})),"__name$x");const LE=Q("SchemaContext");function AE(e){if(!e.fetcher)throw new TypeError("The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop.");const{initialHeaders:n,headerEditor:i}=iS({nonNull:!0,caller:AE}),[o,a]=(0,t.useState)(),[s,l]=(0,t.useState)(!1),[u,c]=(0,t.useState)(null),d=(0,t.useRef)(0);(0,t.useEffect)((()=>{a((0,r.isSchema)(e.schema)||null===e.schema||void 0===e.schema?e.schema:void 0),d.current++}),[e.schema]);const f=(0,t.useRef)(n);(0,t.useEffect)((()=>{i&&(f.current=i.getValue())}));const{introspectionQuery:p,introspectionQueryName:h,introspectionQuerySansSubscriptions:m}=RE({inputValueDeprecation:e.inputValueDeprecation,introspectionQueryName:e.introspectionQueryName,schemaDescription:e.schemaDescription}),{fetcher:v,onSchemaChange:y,dangerouslyAssumeSchemaIsValid:b,children:T}=e,w=(0,t.useCallback)((()=>{if((0,r.isSchema)(e.schema)||null===e.schema)return;const t=++d.current,n=e.schema;async function i(){if(n)return n;const e=FE(f.current);if(!e.isValidJSON)return void c("Introspection failed as headers are invalid.");const t=e.headers?{headers:e.headers}:{},r=x(v({query:p,operationName:h},t));if(!E(r))return void c("Fetcher did not return a Promise for introspection.");l(!0),c(null);let i=await r;if("object"!=typeof i||null===i||!("data"in i)){const e=x(v({query:m,operationName:h},t));if(!E(e))throw new Error("Fetcher did not return a Promise for introspection.");i=await e}if(l(!1),(null==i?void 0:i.data)&&"__schema"in i.data)return i.data;const o="string"==typeof i?i:D(i);c(o)}g(i,"fetchIntrospectionData"),DE(i,"fetchIntrospectionData"),i().then((e=>{if(t===d.current&&e)try{const t=(0,r.buildClientSchema)(e);a(t),null==y||y(t)}catch(e){c(I(e))}})).catch((e=>{t===d.current&&(c(I(e)),l(!1))}))}),[v,h,p,m,y,e.schema]);(0,t.useEffect)((()=>{w()}),[w]),(0,t.useEffect)((()=>{function e(e){82===e.keyCode&&e.shiftKey&&e.ctrlKey&&w()}return g(e,"triggerIntrospection"),DE(e,"triggerIntrospection"),window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}));const C=(0,t.useMemo)((()=>!o||b?[]:(0,r.validateSchema)(o)),[o,b]),S=(0,t.useMemo)((()=>({fetchError:u,introspect:w,isFetching:s,schema:o,validationErrors:C})),[u,w,s,o,C]);return ce(LE.Provider,{value:S,children:T})}e.a4=LE,g(AE,"SchemaContextProvider"),DE(AE,"SchemaContextProvider");const ME=X(LE);function RE(e){let{inputValueDeprecation:n,introspectionQueryName:i,schemaDescription:o}=e;return(0,t.useMemo)((()=>{const e=i||"IntrospectionQuery";let t=(0,r.getIntrospectionQuery)({inputValueDeprecation:n,schemaDescription:o});i&&(t=t.replace("query IntrospectionQuery",`query ${e}`));const a=t.replace("subscriptionType { name }","");return{introspectionQueryName:e,introspectionQuery:t,introspectionQuerySansSubscriptions:a}}),[n,i,o])}function FE(e){let t=null,n=!0;try{e&&(t=JSON.parse(e))}catch{n=!1}return{headers:t,isValidJSON:n}}e.a6=ME,g(RE,"useIntrospectionQuery"),DE(RE,"useIntrospectionQuery"),g(FE,"parseHeaderString"),DE(FE,"parseHeaderString");var PE=Object.defineProperty,jE=g(((e,t)=>PE(e,"name",{value:t,configurable:!0})),"__name$w");const VE={name:"Docs"},UE=Q("ExplorerContext");function BE(e){const{schema:n,validationErrors:i}=ME({nonNull:!0,caller:BE}),[o,a]=(0,t.useState)([VE]),s=(0,t.useCallback)((e=>{a((t=>t.at(-1).def===e.def?t:[...t,e]))}),[]),l=(0,t.useCallback)((()=>{a((e=>e.length>1?e.slice(0,-1):e))}),[]),u=(0,t.useCallback)((()=>{a((e=>1===e.length?e:[VE]))}),[]);(0,t.useEffect)((()=>{null==n||i.length>0?u():a((e=>{if(1===e.length)return e;const t=[VE];let i=null;for(const o of e)if(o!==VE)if(o.def)if((0,r.isNamedType)(o.def)){const e=n.getType(o.def.name);if(!e)break;t.push({name:o.name,def:e}),i=e}else{if(null===i)break;if((0,r.isObjectType)(i)||(0,r.isInputObjectType)(i)){const e=i.getFields()[o.name];if(!e)break;t.push({name:o.name,def:e})}else{if((0,r.isScalarType)(i)||(0,r.isEnumType)(i)||(0,r.isInterfaceType)(i)||(0,r.isUnionType)(i))break;{const e=i;if(!e.args.find((e=>e.name===o.name)))break;t.push({name:o.name,def:e})}}}else i=null,t.push(o);return t}))}),[u,n,i]);const c=(0,t.useMemo)((()=>({explorerNavStack:o,push:s,pop:l,reset:u})),[o,s,l,u]);return ce(UE.Provider,{value:c,children:e.children})}e.z=UE,g(BE,"ExplorerContextProvider"),jE(BE,"ExplorerContextProvider");const $E=X(UE);e.U=$E;var qE=Object.defineProperty,HE=g(((e,t)=>qE(e,"name",{value:t,configurable:!0})),"__name$v");function GE(e,t){return(0,r.isNonNullType)(e)?de(fe,{children:[GE(e.ofType,t),"!"]}):(0,r.isListType)(e)?de(fe,{children:["[",GE(e.ofType,t),"]"]}):t(e)}g(GE,"renderType"),HE(GE,"renderType");var zE=Object.defineProperty,WE=g(((e,t)=>zE(e,"name",{value:t,configurable:!0})),"__name$u");function KE(e){const{push:t}=$E({nonNull:!0,caller:KE});return e.type?GE(e.type,(e=>ce("a",{className:"graphiql-doc-explorer-type-name",onClick:n=>{n.preventDefault(),t({name:e.name,def:e})},href:"#",children:e.name}))):null}g(KE,"TypeLink"),WE(KE,"TypeLink");var QE=Object.defineProperty,XE=g(((e,t)=>QE(e,"name",{value:t,configurable:!0})),"__name$t");function YE(e){let{arg:t,showDefaultValue:n,inline:r}=e;const i=de("span",{children:[ce("span",{className:"graphiql-doc-explorer-argument-name",children:t.name}),": ",ce(KE,{type:t.type}),!1!==n&&ce(OE,{field:t})]});return r?i:de("div",{className:"graphiql-doc-explorer-argument",children:[i,t.description?ce(nb,{type:"description",children:t.description}):null,t.deprecationReason?de("div",{className:"graphiql-doc-explorer-argument-deprecation",children:[ce("div",{className:"graphiql-doc-explorer-argument-deprecation-label",children:"Deprecated"}),ce(nb,{type:"deprecation",children:t.deprecationReason})]}):null]})}g(YE,"Argument"),XE(YE,"Argument");var JE=Object.defineProperty,ZE=g(((e,t)=>JE(e,"name",{value:t,configurable:!0})),"__name$s");function eT(e){return e.children?de("div",{className:"graphiql-doc-explorer-deprecation",children:[ce("div",{className:"graphiql-doc-explorer-deprecation-label",children:"Deprecated"}),ce(nb,{type:"deprecation",onlyShowFirstChild:!0,children:e.children})]}):null}g(eT,"DeprecationReason"),ZE(eT,"DeprecationReason");var tT=Object.defineProperty,nT=g(((e,t)=>tT(e,"name",{value:t,configurable:!0})),"__name$r");function rT(e){let{directive:t}=e;return de("span",{className:"graphiql-doc-explorer-directive",children:["@",t.name.value]})}g(rT,"Directive"),nT(rT,"Directive");var iT=Object.defineProperty,oT=g(((e,t)=>iT(e,"name",{value:t,configurable:!0})),"__name$q");function aT(e){const t=sT[e.title];return de("div",{children:[de("div",{className:"graphiql-doc-explorer-section-title",children:[ce(t,{}),e.title]}),ce("div",{className:"graphiql-doc-explorer-section-content",children:e.children})]})}g(aT,"ExplorerSection"),oT(aT,"ExplorerSection");const sT={Arguments:ka,"Deprecated Arguments":Aa,"Deprecated Enum Values":Ma,"Deprecated Fields":Ra,Directives:Fa,"Enum Values":Va,Fields:Ua,Implements:$a,Implementations:ns,"Possible Types":ns,"Root Types":Ya,Type:ns};var lT=Object.defineProperty,uT=g(((e,t)=>lT(e,"name",{value:t,configurable:!0})),"__name$p");function cT(e){return de(fe,{children:[e.field.description?ce(nb,{type:"description",children:e.field.description}):null,ce(eT,{children:e.field.deprecationReason}),ce(aT,{title:"Type",children:ce(KE,{type:e.field.type})}),ce(dT,{field:e.field}),ce(fT,{field:e.field})]})}function dT(e){let{field:n}=e;const[r,i]=(0,t.useState)(!1);if(!("args"in n))return null;const o=[],a=[];for(const e of n.args)e.deprecationReason?a.push(e):o.push(e);return de(fe,{children:[o.length>0?ce(aT,{title:"Arguments",children:o.map((e=>ce(YE,{arg:e},e.name)))}):null,a.length>0?r||0===o.length?ce(aT,{title:"Deprecated Arguments",children:a.map((e=>ce(YE,{arg:e},e.name)))}):ce(os,{type:"button",onClick:()=>{i(!0)},children:"Show Deprecated Arguments"}):null]})}function fT(e){let{field:t}=e;var n;const r=(null==(n=t.astNode)?void 0:n.directives)||[];return r&&0!==r.length?ce(aT,{title:"Directives",children:r.map((e=>ce("div",{children:ce(rT,{directive:e})},e.name.value)))}):null}g(cT,"FieldDocumentation"),uT(cT,"FieldDocumentation"),g(dT,"Arguments"),uT(dT,"Arguments"),g(fT,"Directives"),uT(fT,"Directives");var pT=Object.defineProperty,hT=g(((e,t)=>pT(e,"name",{value:t,configurable:!0})),"__name$o");function mT(e){var t,n,r,i;const o=e.schema.getQueryType(),a=null==(n=(t=e.schema).getMutationType)?void 0:n.call(t),s=null==(i=(r=e.schema).getSubscriptionType)?void 0:i.call(r);return de(fe,{children:[ce(nb,{type:"description",children:e.schema.description||"A GraphQL schema provides a root type for each kind of operation."}),de(aT,{title:"Root Types",children:[o?de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"query"}),": ",ce(KE,{type:o})]}):null,a&&de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"mutation"}),": ",ce(KE,{type:a})]}),s&&de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"subscription"}),": ",ce(KE,{type:s})]})]})]})}function gT(e,n){var r=(0,t.useRef)(!1);(0,t.useEffect)((function(){r.current?e():r.current=!0}),n)}function vT(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function yT(){return yT=Object.assign||function(e){for(var t=1;tl&&e.push({highlight:!1,start:l,end:u}),o.index===s.lastIndex&&s.lastIndex++}return e}),[])}function wT(e){var t=e.chunksToHighlight,n=e.totalLength,r=[];if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r;function o(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})}}function CT(e){return e}function ST(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}g(mT,"SchemaDocumentation"),hT(mT,"SchemaDocumentation"),g(gT,"useUpdateEffect"),g(vT,"_objectWithoutPropertiesLoose"),g(yT,"_extends"),g(bT,"findAll"),g(ET,"combineChunks"),g(TT,"defaultFindChunks"),g(wT,"fillInChunks"),g(CT,"defaultSanitize"),g(ST,"escapeRegExpFn");var xT,NT,kT,_T,OT,IT={combineChunks:ET,fillInChunks:wT,findAll:bT,findChunks:TT},DT=["onSelect","openOnFocus","children","as","aria-label","aria-labelledby"],LT=["as","selectOnClick","autocomplete","onClick","onChange","onKeyDown","onBlur","onFocus","value"],AT=["as","children","portal","onKeyDown","onBlur","position"],MT=["persistSelection","as"],RT=["as","children","index","value","onClick"],FT="IDLE",PT="SUGGESTING",jT="NAVIGATING",VT="INTERACTING",UT="CLEAR",BT="CHANGE",$T="INITIAL_CHANGE",qT="NAVIGATE",HT="SELECT_WITH_KEYBOARD",GT="SELECT_WITH_CLICK",zT="ESCAPE",WT="BLUR",KT="INTERACT",QT="FOCUS",XT="OPEN_WITH_BUTTON",YT="OPEN_WITH_INPUT_CLICK",JT="CLOSE_WITH_BUTTON",ZT={initial:FT,states:(OT={},OT[FT]={on:(xT={},xT[WT]=FT,xT[UT]=FT,xT[BT]=PT,xT[$T]=FT,xT[QT]=PT,xT[qT]=jT,xT[XT]=PT,xT[YT]=PT,xT)},OT[PT]={on:(NT={},NT[BT]=PT,NT[QT]=PT,NT[qT]=jT,NT[UT]=FT,NT[zT]=FT,NT[WT]=FT,NT[GT]=FT,NT[KT]=VT,NT[JT]=FT,NT)},OT[jT]={on:(kT={},kT[BT]=PT,kT[QT]=PT,kT[UT]=FT,kT[WT]=FT,kT[zT]=FT,kT[qT]=jT,kT[GT]=FT,kT[HT]=FT,kT[JT]=FT,kT[KT]=VT,kT)},OT[VT]={on:(_T={},_T[UT]=FT,_T[BT]=PT,_T[QT]=PT,_T[WT]=FT,_T[zT]=FT,_T[qT]=jT,_T[JT]=FT,_T[GT]=FT,_T)},OT)},ew=g((function(e,t){var n=yT({},e,{lastEventType:t.type});switch(t.type){case BT:case $T:return yT({},n,{navigationValue:null,value:t.value});case qT:case XT:case YT:return yT({},n,{navigationValue:nw(n,t)});case UT:return yT({},n,{value:"",navigationValue:null});case WT:case zT:return yT({},n,{navigationValue:null});case GT:return yT({},n,{value:t.isControlled?e.value:t.value,navigationValue:null});case HT:return yT({},n,{value:t.isControlled?e.value:e.navigationValue,navigationValue:null});case JT:return yT({},n,{navigationValue:null});case KT:return n;case QT:return yT({},n,{navigationValue:nw(n,t)});default:return n}}),"reducer");function tw(e){return[PT,jT,VT].includes(e)}function nw(e,t){return t.value?t.value:t.persistSelection?e.value:null}g(tw,"popoverIsExpanded"),g(nw,"findNavigationValue");var rw=Gd(),iw=of(0,{}),ow=of(0,{}),aw=(0,t.forwardRef)((function(e,n){var r,i=e.onSelect,o=e.openOnFocus,a=void 0!==o&&o,s=e.children,l=e.as,u=void 0===l?"div":l,c=e["aria-label"],d=e["aria-labelledby"],f=vT(e,DT),p=Wd(),h=p[0],m=p[1],g=(0,t.useRef)(),v=(0,t.useRef)(),y=(0,t.useRef)(),b=(0,t.useRef)(!1),E=(0,t.useRef)(!1),T=mw(ZT,ew,{value:"",navigationValue:null}),w=T[0],C=T[1],S=T[2];fw(C.lastEventType,g);var x=nd(f.id),N=x?sf("listbox",x):"listbox",k=(0,t.useRef)(!1),_=tw(w),O={ariaLabel:c,ariaLabelledby:d,autocompletePropRef:b,buttonRef:y,comboboxId:x,data:C,inputRef:g,isExpanded:_,listboxId:N,onSelect:i||ys,openOnFocus:a,persistSelectionRef:E,popoverRef:v,state:w,transition:S,isControlledRef:k};return(0,t.createElement)(Qd,{context:rw,items:h,set:m},(0,t.createElement)(iw.Provider,{value:O},(0,t.createElement)(u,yT({},f,{"data-reach-combobox":"","data-state":vw(w),"data-expanded":_||void 0,ref:n}),gs(s)?s({id:x,isExpanded:_,navigationValue:null!=(r=C.navigationValue)?r:null,state:w}):s)))})),sw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"input":r,o=e.selectOnClick,a=void 0!==o&&o,s=e.autocomplete,l=void 0===s||s,u=e.onClick,c=e.onChange,d=e.onKeyDown,f=e.onBlur,p=e.onFocus,h=e.value,m=vT(e,LT),v=(0,t.useRef)(h).current,y=(0,t.useRef)(!1);gT((function(){y.current=!0}),[h]);var b=(0,t.useContext)(iw),E=b.data,T=E.navigationValue,w=E.value,C=E.lastEventType,S=b.inputRef,x=b.state,N=b.transition,k=b.listboxId,_=b.autocompletePropRef,O=b.openOnFocus,I=b.isExpanded,D=b.ariaLabel,L=b.ariaLabelledby,A=b.persistSelectionRef,M=b.isControlledRef,R=Cs(S,n),F=(0,t.useRef)(!1),P=pw(),j=hw(),V=void 0!==h;(0,t.useEffect)((function(){M.current=V}),[V]),ls((function(){_.current=l}),[l,_]);var U=(0,t.useCallback)((function(e){""===e.trim()?N(UT,{isControlled:V}):e!==v||y.current?N(BT,{value:e}):N($T,{value:e})}),[v,N,V]);function B(e){var t=e.target.value;V||U(t)}function $(){a&&(F.current=!0),O&&C!==GT&&N(QT,{persistSelection:A.current})}function q(){var e;F.current&&(F.current=!1,null==(e=S.current)||e.select()),O&&x===FT&&N(YT)}(0,t.useEffect)((function(){!V||h===w||""===h.trim()&&""===(w||"").trim()||U(h)}),[h,U,V,w]),g(B,"handleChange"),g($,"handleFocus"),g(q,"handleClick");var H=!l||x!==jT&&x!==VT?h||w:T||h||w;return(0,t.createElement)(i,yT({"aria-activedescendant":T?String(gw(T)):void 0,"aria-autocomplete":"both","aria-controls":k,"aria-expanded":I,"aria-haspopup":"listbox","aria-label":D,"aria-labelledby":D?void 0:L,role:"combobox"},m,{"data-reach-combobox-input":"","data-state":vw(x),ref:R,onBlur:Ss(f,j),onChange:Ss(c,B),onClick:Ss(u,q),onFocus:Ss(p,$),onKeyDown:Ss(d,P),value:H||""}))})),lw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.children,a=e.portal,s=void 0===a||a,l=e.onKeyDown,u=e.onBlur,c=e.position,d=void 0===c?Vd:c,f=vT(e,AT),p=(0,t.useContext)(iw),h=p.popoverRef,m=p.inputRef,g=p.isExpanded,v=p.state,y=Cs(h,n),b=pw(),E=hw(),T={"data-reach-combobox-popover":"","data-state":vw(v),onKeyDown:Ss(l,b),onBlur:Ss(u,E),hidden:!g,tabIndex:-1,children:o};return s?(0,t.createElement)(Md,yT({as:i},f,{ref:y,"data-expanded":g||void 0,position:d,targetRef:m,unstable_skipInitialPortalRender:!0},T)):(0,t.createElement)(i,yT({ref:y},f,T))})),uw=(0,t.forwardRef)((function(e,n){var r=e.persistSelection,i=void 0!==r&&r,o=e.as,a=void 0===o?"ul":o,s=vT(e,MT),l=(0,t.useContext)(iw),u=l.persistSelectionRef,c=l.listboxId;return i&&(u.current=!0),(0,t.createElement)(a,yT({role:"listbox"},s,{ref:n,"data-reach-combobox-list":"",id:c}))})),cw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"li":r,o=e.children,a=e.index,s=e.value,l=e.onClick,u=vT(e,RT),c=(0,t.useContext)(iw),d=c.onSelect,f=c.data.navigationValue,p=c.transition,h=c.isControlledRef,m=lf((0,t.useRef)(null),null),v=m[0],y=m[1],b=zd((0,t.useMemo)((function(){return{element:v,value:s}}),[s,v]),rw,a),E=Cs(n,y),T=f===s,w=g((function(){d&&d(s),p(GT,{value:s,isControlled:h.current})}),"handleClick");return(0,t.createElement)(ow.Provider,{value:{value:s,index:b}},(0,t.createElement)(i,yT({"aria-selected":T,role:"option"},u,{"data-reach-combobox-option":"",ref:E,id:String(gw(s)),"data-highlighted":T?"":void 0,tabIndex:-1,onClick:Ss(l,w)}),o?gs(o)?o({value:s,index:b}):o:(0,t.createElement)(dw,null)))}));function dw(){var e=(0,t.useContext)(ow).value,n=(0,t.useContext)(iw).data.value,r=(0,t.useMemo)((function(){return IT.findAll({searchWords:yw(n||"").split(/\s+/),textToHighlight:e})}),[n,e]);return(0,t.createElement)(t.Fragment,null,r.length?r.map((function(n,r){var i=e.slice(n.start,n.end);return(0,t.createElement)("span",{key:r,"data-reach-combobox-option-text":"","data-user-value":!!n.highlight||void 0,"data-suggested-value":!n.highlight||void 0},i)})):e)}function fw(e,t){ls((function(){var n;e!==qT&&e!==zT&&e!==GT&&e!==XT||null==(n=t.current)||n.focus()}),[t,e])}function pw(){var e=(0,t.useContext)(iw),n=e.data.navigationValue,r=e.onSelect,i=e.state,o=e.transition,a=e.autocompletePropRef,s=e.persistSelectionRef,l=e.isControlledRef,u=Kd(rw);return g((function(e){var t=u.findIndex((function(e){return e.value===n}));function c(){return t===u.length-1?a.current?null:f():u[(t+1)%u.length]}function d(){return 0===t?a.current?null:p():-1===t?p():u[(t-1+u.length)%u.length]}function f(){return u[0]}function p(){return u[u.length-1]}switch(g(c,"getNextOption"),g(d,"getPreviousOption"),g(f,"getFirstOption"),g(p,"getLastOption"),e.key){case"ArrowDown":if(e.preventDefault(),!u||!u.length)return;if(i===FT)o(qT,{persistSelection:s.current});else{var h=c();o(qT,{value:h?h.value:null})}break;case"ArrowUp":if(e.preventDefault(),!u||0===u.length)return;if(i===FT)o(qT);else{var m=d();o(qT,{value:m?m.value:null})}break;case"Home":case"PageUp":if(e.preventDefault(),!u||0===u.length)return;i===FT?o(qT):o(qT,{value:f().value});break;case"End":case"PageDown":if(e.preventDefault(),!u||0===u.length)return;i===FT?o(qT):o(qT,{value:p().value});break;case"Escape":i!==FT&&o(zT);break;case"Enter":i===jT&&null!==n&&(e.preventDefault(),r&&r(n),o(HT,{isControlled:l.current}))}}),"handleKeyDown")}function hw(){var e=(0,t.useContext)(iw),n=e.state,r=e.transition,i=e.popoverRef,o=e.inputRef,a=e.buttonRef;return g((function(e){var t=i.current,s=o.current,l=a.current,u=e.relatedTarget;u!==s&&u!==l&&t&&(t.contains(u)?n!==VT&&r(KT):r(WT))}),"handleBlur")}function mw(e,n,r){var i=(0,t.useState)(e.initial),o=i[0],a=i[1],s=(0,t.useReducer)(n,r),l=s[0],u=s[1];return[o,l,g((function(t,n){void 0===n&&(n={});var r=e.states[o],i=r&&r.on[t];if(i)return u(yT({type:t,state:o,nextState:o},n)),void a(i)}),"transition")]}function gw(e){var t=0;if(0===e.length)return t;for(var n=0;nbw(e,"name",{value:t,configurable:!0})),"__name$n");function Tw(e,t){let n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o{n=null,t(...i)}),e)}}g(Tw,"debounce"),Ew(Tw,"debounce");var ww=Object.defineProperty,Cw=g(((e,t)=>ww(e,"name",{value:t,configurable:!0})),"__name$m");function Sw(){const{explorerNavStack:e,push:n}=$E({nonNull:!0,caller:Sw}),i=(0,t.useRef)(null),o=(0,t.useRef)(null),a=xw(),[s,l]=(0,t.useState)(""),[u,c]=(0,t.useState)(a(s)),d=(0,t.useMemo)((()=>Tw(200,(e=>{c(a(e))}))),[a]);(0,t.useEffect)((()=>{d(s)}),[d,s]),(0,t.useEffect)((()=>{function e(e){e.metaKey&&75===e.keyCode&&i.current&&i.current.focus()}return g(e,"handleKeyDown"),Cw(e,"handleKeyDown"),window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[]);const f=e.at(-1);return 1===e.length||(0,r.isObjectType)(f.def)||(0,r.isInterfaceType)(f.def)||(0,r.isInputObjectType)(f.def)?de(aw,{"aria-label":`Search ${f.name}...`,onSelect:e=>{const t=e;n("field"in t?{name:t.field.name,def:t.field}:{name:t.type.name,def:t.type})},children:[de("div",{className:"graphiql-doc-explorer-search-input",onClick:()=>{i.current&&i.current.focus()},children:[ce(Ha,{}),ce(sw,{autocomplete:!1,onChange:e=>{l(e.target.value)},onKeyDown:e=>{if(!e.isDefaultPrevented()){const e=o.current;if(!e)return;window.requestAnimationFrame((()=>{const t=e.querySelector("[aria-selected=true]");if(!(t instanceof HTMLElement))return;const n=t.offsetTop-e.scrollTop,r=e.scrollTop+e.clientHeight-(t.offsetTop+t.clientHeight);r<0&&(e.scrollTop-=r),n<0&&(e.scrollTop+=n)}))}e.stopPropagation()},placeholder:"⌘ K",ref:i,value:s})]}),ce(lw,{portal:!1,ref:o,children:de(uw,{children:[u.within.map(((e,t)=>ce(cw,{index:t,value:e,children:ce(_w,{field:e.field,argument:e.argument})},`within-${t}`))),u.within.length>0&&u.types.length+u.fields.length>0?ce("div",{className:"graphiql-doc-explorer-search-divider",children:"Other results"}):null,u.types.map(((e,t)=>ce(cw,{index:u.within.length+t,value:e,children:ce(kw,{type:e.type})},`type-${t}`))),u.fields.map(((e,t)=>de(cw,{index:u.within.length+u.types.length+t,value:e,children:[ce(kw,{type:e.type}),".",ce(_w,{field:e.field,argument:e.argument})]},`field-${t}`))),u.within.length+u.types.length+u.fields.length===0?ce("div",{className:"graphiql-doc-explorer-search-empty",children:"No results found"}):null]})})]}):null}function xw(e){const{explorerNavStack:n}=$E({nonNull:!0,caller:e||xw}),{schema:i}=ME({nonNull:!0,caller:e||xw}),o=n.at(-1);return(0,t.useCallback)((e=>{const t={within:[],types:[],fields:[]};if(!i)return t;const n=o.def,a=i.getTypeMap();let s=Object.keys(a);n&&(s=s.filter((e=>e!==n.name)),s.unshift(n.name));for(const i of s){if(t.within.length+t.types.length+t.fields.length>=100)break;const o=a[i];if(n!==o&&Nw(i,e)&&t.types.push({type:o}),!(0,r.isObjectType)(o)&&!(0,r.isInterfaceType)(o)&&!(0,r.isInputObjectType)(o))continue;const s=o.getFields();for(const r in s){const i=s[r];let a;if(!Nw(r,e)){if(!("args"in i))continue;if(a=i.args.filter((t=>Nw(t.name,e))),0===a.length)continue}t[n===o?"within":"fields"].push(...a?a.map((e=>({type:o,field:i,argument:e}))):[{type:o,field:i}])}}return t}),[o.def,i])}function Nw(e,t){try{const n=t.replaceAll(/[^_0-9A-Za-z]/g,(e=>"\\"+e));return-1!==e.search(new RegExp(n,"i"))}catch{return e.toLowerCase().includes(t.toLowerCase())}}function kw(e){return ce("span",{className:"graphiql-doc-explorer-search-type",children:e.type.name})}function _w(e){return de(fe,{children:[ce("span",{className:"graphiql-doc-explorer-search-field",children:e.field.name}),e.argument?de(fe,{children:["(",ce("span",{className:"graphiql-doc-explorer-search-argument",children:e.argument.name}),":"," ",GE(e.argument.type,(e=>ce(kw,{type:e}))),")"]}):null]})}g(Sw,"Search"),Cw(Sw,"Search"),g(xw,"useSearchResults"),Cw(xw,"useSearchResults"),g(Nw,"isMatch"),Cw(Nw,"isMatch"),g(kw,"Type"),Cw(kw,"Type"),g(_w,"Field$1"),Cw(_w,"Field");var Ow=Object.defineProperty,Iw=g(((e,t)=>Ow(e,"name",{value:t,configurable:!0})),"__name$l");function Dw(e){const{push:t}=$E({nonNull:!0});return ce("a",{className:"graphiql-doc-explorer-field-name",onClick:n=>{n.preventDefault(),t({name:e.field.name,def:e.field})},href:"#",children:e.field.name})}g(Dw,"FieldLink"),Iw(Dw,"FieldLink");var Lw=Object.defineProperty,Aw=g(((e,t)=>Lw(e,"name",{value:t,configurable:!0})),"__name$k");function Mw(e){return(0,r.isNamedType)(e.type)?de(fe,{children:[e.type.description?ce(nb,{type:"description",children:e.type.description}):null,ce(Rw,{type:e.type}),ce(Fw,{type:e.type}),ce(jw,{type:e.type}),ce(Uw,{type:e.type})]}):null}function Rw(e){let{type:t}=e;return(0,r.isObjectType)(t)&&t.getInterfaces().length>0?ce(aT,{title:"Implements",children:t.getInterfaces().map((e=>ce("div",{children:ce(KE,{type:e})},e.name)))}):null}function Fw(e){let{type:n}=e;const[i,o]=(0,t.useState)(!1);if(!(0,r.isObjectType)(n)&&!(0,r.isInterfaceType)(n)&&!(0,r.isInputObjectType)(n))return null;const a=n.getFields(),s=[],l=[];for(const e of Object.keys(a).map((e=>a[e])))e.deprecationReason?l.push(e):s.push(e);return de(fe,{children:[s.length>0?ce(aT,{title:"Fields",children:s.map((e=>ce(Pw,{field:e},e.name)))}):null,l.length>0?i||0===s.length?ce(aT,{title:"Deprecated Fields",children:l.map((e=>ce(Pw,{field:e},e.name)))}):ce(os,{type:"button",onClick:()=>{o(!0)},children:"Show Deprecated Fields"}):null]})}function Pw(e){let{field:t}=e;const n="args"in t?t.args.filter((e=>!e.deprecationReason)):[];return de("div",{className:"graphiql-doc-explorer-item",children:[de("div",{children:[ce(Dw,{field:t}),n.length>0?de(fe,{children:["(",ce("span",{children:n.map((e=>1===n.length?ce(YE,{arg:e,inline:!0},e.name):ce("div",{className:"graphiql-doc-explorer-argument-multiple",children:ce(YE,{arg:e,inline:!0})},e.name)))}),")"]}):null,": ",ce(KE,{type:t.type}),ce(OE,{field:t})]}),t.description?ce(nb,{type:"description",onlyShowFirstChild:!0,children:t.description}):null,ce(eT,{children:t.deprecationReason})]})}function jw(e){let{type:n}=e;const[i,o]=(0,t.useState)(!1);if(!(0,r.isEnumType)(n))return null;const a=[],s=[];for(const e of n.getValues())e.deprecationReason?s.push(e):a.push(e);return de(fe,{children:[a.length>0?ce(aT,{title:"Enum Values",children:a.map((e=>ce(Vw,{value:e},e.name)))}):null,s.length>0?i||0===a.length?ce(aT,{title:"Deprecated Enum Values",children:s.map((e=>ce(Vw,{value:e},e.name)))}):ce(os,{type:"button",onClick:()=>{o(!0)},children:"Show Deprecated Values"}):null]})}function Vw(e){let{value:t}=e;return de("div",{className:"graphiql-doc-explorer-item",children:[ce("div",{className:"graphiql-doc-explorer-enum-value",children:t.name}),t.description?ce(nb,{type:"description",children:t.description}):null,t.deprecationReason?ce(nb,{type:"deprecation",children:t.deprecationReason}):null]})}function Uw(e){let{type:t}=e;const{schema:n}=ME({nonNull:!0});return n&&(0,r.isAbstractType)(t)?ce(aT,{title:(0,r.isInterfaceType)(t)?"Implementations":"Possible Types",children:n.getPossibleTypes(t).map((e=>ce("div",{children:ce(KE,{type:e})},e.name)))}):null}g(Mw,"TypeDocumentation"),Aw(Mw,"TypeDocumentation"),g(Rw,"ImplementsInterfaces"),Aw(Rw,"ImplementsInterfaces"),g(Fw,"Fields"),Aw(Fw,"Fields"),g(Pw,"Field"),Aw(Pw,"Field"),g(jw,"EnumValues"),Aw(jw,"EnumValues"),g(Vw,"EnumValue"),Aw(Vw,"EnumValue"),g(Uw,"PossibleTypes"),Aw(Uw,"PossibleTypes");var Bw=Object.defineProperty,$w=g(((e,t)=>Bw(e,"name",{value:t,configurable:!0})),"__name$j");function qw(){const{fetchError:e,isFetching:t,schema:n,validationErrors:i}=ME({nonNull:!0,caller:qw}),{explorerNavStack:o,pop:a}=$E({nonNull:!0,caller:qw}),s=o.at(-1);let l,u=null;return e?u=ce("div",{className:"graphiql-doc-explorer-error",children:"Error fetching schema"}):i.length>0?u=de("div",{className:"graphiql-doc-explorer-error",children:["Schema is invalid: ",i[0].message]}):t?u=ce(rb,{}):n?1===o.length?u=ce(mT,{schema:n}):(0,r.isType)(s.def)?u=ce(Mw,{type:s.def}):s.def&&(u=ce(cT,{field:s.def})):u=ce("div",{className:"graphiql-doc-explorer-error",children:"No GraphQL schema available"}),o.length>1&&(l=o.at(-2).name),de("section",{className:"graphiql-doc-explorer","aria-label":"Documentation Explorer",children:[de("div",{className:"graphiql-doc-explorer-header",children:[de("div",{className:"graphiql-doc-explorer-header-content",children:[l&&de("a",{href:"#",className:"graphiql-doc-explorer-back",onClick:e=>{e.preventDefault(),a()},"aria-label":`Go back to ${l}`,children:[ce(Oa,{}),l]}),ce("div",{className:"graphiql-doc-explorer-title",children:s.name})]}),ce("div",{className:"graphiql-doc-explorer-search",children:ce(Sw,{},s.name)})]}),ce("div",{className:"graphiql-doc-explorer-content",children:u})]})}g(qw,"DocExplorer"),$w(qw,"DocExplorer");var Hw=Object.defineProperty,Gw=g(((e,t)=>Hw(e,"name",{value:t,configurable:!0})),"__name$i");const zw={title:"Documentation Explorer",icon:Gw(g((function(){const e=Xw();return(null==e?void 0:e.visiblePlugin)===zw?ce(Pa,{}):ce(ja,{})}),"Icon"),"Icon"),content:qw};e._=zw;const Ww={title:"History",icon:Ba,content:iE};e.$=Ww;const Kw=Q("PluginContext");function Qw(e){const n=ve(),r=$E(),i=eE(),o=Boolean(r),a=Boolean(i),s=(0,t.useMemo)((()=>{const t=[],n={};o&&(t.push(zw),n[zw.title]=!0),a&&(t.push(Ww),n[Ww.title]=!0);for(const r of e.plugins||[]){if("string"!=typeof r.title||!r.title)throw new Error("All GraphiQL plugins must have a unique title");if(n[r.title])throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${r.title}'`);t.push(r),n[r.title]=!0}return t}),[o,a,e.plugins]),[l,u]=(0,t.useState)((()=>{const t=null==n?void 0:n.get(Yw);return s.find((e=>e.title===t))||(t&&(null==n||n.set(Yw,"")),e.visiblePlugin&&s.find((t=>("string"==typeof e.visiblePlugin?t.title:t)===e.visiblePlugin))||null)})),{onTogglePluginVisibility:c,children:d}=e,f=(0,t.useCallback)((e=>{const t=e&&s.find((t=>("string"==typeof e?t.title:t)===e))||null;u((e=>t===e?e:(null==c||c(t),t)))}),[c,s]);(0,t.useEffect)((()=>{e.visiblePlugin&&f(e.visiblePlugin)}),[s,e.visiblePlugin,f]);const p=(0,t.useMemo)((()=>({plugins:s,setVisiblePlugin:f,visiblePlugin:l})),[s,f,l]);return ce(Kw.Provider,{value:p,children:d})}e.a0=Kw,g(Qw,"PluginContextProvider"),Gw(Qw,"PluginContextProvider");const Xw=X(Kw);e.a2=Xw;const Yw="visiblePlugin";var Jw=Object.defineProperty,Zw=g(((e,t)=>Jw(e,"name",{value:t,configurable:!0})),"__name$h");function eC(e,t,n,i,o,a){function s(e){if(!(n&&i&&o&&e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget.innerText,r=n.getType(t);r&&(o.setVisiblePlugin(zw),i.push({name:r.name,def:r}),null==a||a(r))}bE([],{useCommonAddons:!1}).then((e=>{let n,i,o,a,l,u,c,d,f;e.on(t,"select",((e,t)=>{if(!n){const e=t.parentNode;n=document.createElement("div"),n.className="CodeMirror-hint-information",e.appendChild(n);const r=document.createElement("header");r.className="CodeMirror-hint-information-header",n.appendChild(r),i=document.createElement("span"),i.className="CodeMirror-hint-information-field-name",r.appendChild(i),o=document.createElement("span"),o.className="CodeMirror-hint-information-type-name-pill",r.appendChild(o),a=document.createElement("span"),o.appendChild(a),l=document.createElement("a"),l.className="CodeMirror-hint-information-type-name",l.href="javascript:void 0",l.addEventListener("click",s),o.appendChild(l),u=document.createElement("span"),o.appendChild(u),c=document.createElement("div"),c.className="CodeMirror-hint-information-description",n.appendChild(c),d=document.createElement("div"),d.className="CodeMirror-hint-information-deprecation",n.appendChild(d);const p=document.createElement("span");p.className="CodeMirror-hint-information-deprecation-label",p.innerText="Deprecated",d.appendChild(p),f=document.createElement("div"),f.className="CodeMirror-hint-information-deprecation-reason",d.appendChild(f);const h=parseInt(window.getComputedStyle(n).paddingBottom.replace(/px$/,""),10)||0,m=parseInt(window.getComputedStyle(n).maxHeight.replace(/px$/,""),10)||0,g=Zw((()=>{n&&(n.style.paddingTop=e.scrollTop+h+"px",n.style.maxHeight=e.scrollTop+m+"px")}),"handleScroll");let v;e.addEventListener("scroll",g),e.addEventListener("DOMNodeRemoved",v=Zw((t=>{t.target===e&&(e.removeEventListener("scroll",g),e.removeEventListener("DOMNodeRemoved",v),n&&n.removeEventListener("click",s),n=null,i=null,o=null,a=null,l=null,u=null,c=null,d=null,f=null,v=null)}),"onRemoveFn"))}if(i&&(i.innerText=e.text),o&&a&&l&&u)if(e.type){o.style.display="inline";const t=Zw((e=>{(0,r.isNonNullType)(e)?(u.innerText="!"+u.innerText,t(e.ofType)):(0,r.isListType)(e)?(a.innerText+="[",u.innerText="]"+u.innerText,t(e.ofType)):l.innerText=e.name}),"renderType");a.innerText="",u.innerText="",t(e.type)}else a.innerText="",l.innerText="",u.innerText="",o.style.display="none";c&&(e.description?(c.style.display="block",c.innerHTML=tb.render(e.description)):(c.style.display="none",c.innerHTML="")),d&&f&&(e.deprecationReason?(d.style.display="block",f.innerHTML=tb.render(e.deprecationReason)):(d.style.display="none",f.innerHTML=""))}))})),g(s,"onClickHintInformation"),Zw(s,"onClickHintInformation")}g(eC,"onHasCompletion"),Zw(eC,"onHasCompletion");var tC=Object.defineProperty,nC=g(((e,t)=>tC(e,"name",{value:t,configurable:!0})),"__name$g");function rC(e,n){(0,t.useEffect)((()=>{e&&"string"==typeof n&&n!==e.getValue()&&e.setValue(n)}),[e,n])}function iC(e,n,r){(0,t.useEffect)((()=>{e&&e.setOption(n,r)}),[e,n,r])}function oC(e,n,r,i,o){const{updateActiveTabValues:a}=iS({nonNull:!0,caller:o}),s=ve();(0,t.useEffect)((()=>{if(!e)return;const t=Tw(500,(e=>{s&&null!==r&&s.set(r,e)})),o=Tw(100,(e=>{a({[i]:e})})),l=nC(((e,r)=>{if(!r)return;const i=e.getValue();t(i),o(i),null==n||n(i)}),"handleChange");return e.on("change",l),()=>e.off("change",l)}),[n,e,s,r,i,a])}function aC(e,n,r){const{schema:i}=ME({nonNull:!0,caller:r}),o=$E(),a=Xw();(0,t.useEffect)((()=>{if(!e)return;const t=nC(((e,t)=>{eC(0,t,i,o,a,(e=>{null==n||n({kind:"Type",type:e,schema:i||void 0})}))}),"handleCompletion");return e.on("hasCompletion",t),()=>e.off("hasCompletion",t)}),[n,e,o,a,i])}function sC(e,n,r){(0,t.useEffect)((()=>{if(e){for(const t of n)e.removeKeyMap(t);if(r){const t={};for(const e of n)t[e]=()=>r();e.addKeyMap(t)}}}),[e,n,r])}function lC(){let{caller:e,onCopyQuery:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:r}=iS({nonNull:!0,caller:e||lC});return(0,t.useCallback)((()=>{if(!r)return;const e=r.getValue();xE(e),null==n||n(e)}),[r,n])}function uC(){let{caller:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:n}=iS({nonNull:!0,caller:e||uC}),{schema:i}=ME({nonNull:!0,caller:uC});return(0,t.useCallback)((()=>{const e=null==n?void 0:n.documentAST,t=null==n?void 0:n.getValue();e&&t&&n.setValue((0,r.print)(U(e,i)))}),[n,i])}function cC(){let{caller:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:n,headerEditor:i,variableEditor:o}=iS({nonNull:!0,caller:e||cC});return(0,t.useCallback)((()=>{if(o){const e=o.getValue();try{const t=JSON.stringify(JSON.parse(e),null,2);t!==e&&o.setValue(t)}catch{}}if(i){const e=i.getValue();try{const t=JSON.stringify(JSON.parse(e),null,2);t!==e&&i.setValue(t)}catch{}}if(n){const e=n.getValue(),t=(0,r.print)((0,r.parse)(e));t!==e&&n.setValue(t)}}),[n,o,i])}function dC(){let{getDefaultFieldNames:e,caller:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{schema:r}=ME({nonNull:!0,caller:n||dC}),{queryEditor:i}=iS({nonNull:!0,caller:n||dC});return(0,t.useCallback)((()=>{if(!i)return;const t=i.getValue(),{insertions:n,result:o}=L(r,t,e);return n&&n.length>0&&i.operation((()=>{const e=i.getCursor(),t=i.indexFromPos(e);i.setValue(o||"");let r=0;const a=n.map((e=>{let{index:t,string:n}=e;return i.markText(i.posFromIndex(t+r),i.posFromIndex(t+(r+=n.length)),{className:"auto-inserted-leaf",clearOnEnter:!0,title:"Automatically added leaf fields"})}));setTimeout((()=>a.forEach((e=>e.clear()))),7e3);let s=t;n.forEach((e=>{let{index:n,string:r}=e;nfC(e,"name",{value:t,configurable:!0})),"__name$f");function hC(){let{editorTheme:e=mE,keyMap:r=gE,onEdit:i,readOnly:o=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;const{initialHeaders:s,headerEditor:l,setHeaderEditor:u,shouldPersistHeaders:c}=iS({nonNull:!0,caller:a||hC}),d=dE(),f=uC({caller:a||hC}),p=cC({caller:a||hC}),h=(0,t.useRef)(null);return(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,8888,23)).then((function(e){return e.j}))]).then((n=>{if(!t)return;const r=h.current;if(!r)return;const i=n(r,{value:s,lineNumbers:!0,tabSize:2,mode:{name:"javascript",json:!0},theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!o&&"nocursor",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yE});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!1,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!1,container:r})},"Alt-Space"(){i.showHint({completeSingle:!1,container:r})},"Shift-Space"(){i.showHint({completeSingle:!1,container:r})}}),i.on("keyup",((e,t)=>{const n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),u(i)})),()=>{t=!1}}),[e,s,o,u]),iC(l,"keyMap",r),oC(l,i,c?mC:null,"headers",hC),sC(l,["Cmd-Enter","Ctrl-Enter"],null==d?void 0:d.run),sC(l,["Shift-Ctrl-P"],p),sC(l,["Shift-Ctrl-M"],f),h}g(hC,"useHeaderEditor"),pC(hC,"useHeaderEditor");const mC="headers";var gC=Object.defineProperty,vC=g(((e,t)=>gC(e,"name",{value:t,configurable:!0})),"__name$e");const yC=Array.from({length:11},((e,t)=>String.fromCharCode(8192+t))).concat(["\u2028","\u2029"," "," "]),bC=new RegExp("["+yC.join("")+"]","g");function EC(e){return e.replace(bC," ")}g(EC,"normalizeWhitespace"),vC(EC,"normalizeWhitespace");var TC=Object.defineProperty,wC=g(((e,t)=>TC(e,"name",{value:t,configurable:!0})),"__name$d");function CC(){let{editorTheme:e=mE,keyMap:r=gE,onClickReference:i,onCopyQuery:o,onEdit:a,readOnly:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;const{schema:u}=ME({nonNull:!0,caller:l||CC}),{externalFragments:c,initialQuery:d,queryEditor:f,setOperationName:p,setQueryEditor:v,validationRules:y,variableEditor:b,updateActiveTabValues:E}=iS({nonNull:!0,caller:l||CC}),T=dE(),w=ve(),C=$E(),S=Xw(),x=lC({caller:l||CC,onCopyQuery:o}),N=uC({caller:l||CC}),k=cC({caller:l||CC}),_=(0,t.useRef)(null),O=(0,t.useRef)(),I=(0,t.useRef)((()=>{}));(0,t.useEffect)((()=>{I.current=e=>{if(C&&S){switch(S.setVisiblePlugin(zw),e.kind){case"Type":C.push({name:e.type.name,def:e.type});break;case"Field":C.push({name:e.field.name,def:e.field});break;case"Argument":e.field&&C.push({name:e.field.name,def:e.field});break;case"EnumValue":e.type&&C.push({name:e.type.name,def:e.type})}null==i||i(e)}}}),[C,i,S]),(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,6754,23)).then((function(e){return e.c})),Promise.resolve().then(n.t.bind(n,9509,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4840,23)),Promise.resolve().then(n.t.bind(n,9444,23)),Promise.resolve().then(n.t.bind(n,9890,23)),Promise.resolve().then(n.t.bind(n,5980,23)),Promise.resolve().then(n.t.bind(n,9863,23))]).then((n=>{if(!t)return;O.current=n;const r=_.current;if(!r)return;const i=n(r,{value:d,lineNumbers:!0,tabSize:2,foldGutter:!0,mode:"graphql",theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!s&&"nocursor",lint:{schema:void 0,validationRules:null,externalFragments:void 0},hintOptions:{schema:void 0,closeOnUnfocus:!1,completeSingle:!1,container:r,externalFragments:void 0},info:{schema:void 0,renderDescription:e=>tb.render(e),onClick:e=>{I.current(e)}},jump:{schema:void 0,onClick:e=>{I.current(e)}},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:m(h({},yE),{"Cmd-S"(){},"Ctrl-S"(){}})});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!0,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!0,container:r})},"Alt-Space"(){i.showHint({completeSingle:!0,container:r})},"Shift-Space"(){i.showHint({completeSingle:!0,container:r})},"Shift-Alt-Space"(){i.showHint({completeSingle:!0,container:r})}}),i.on("keyup",((e,t)=>{kC.test(t.key)&&e.execCommand("autocomplete")}));let o=!1;i.on("startCompletion",(()=>{o=!0})),i.on("endCompletion",(()=>{o=!1})),i.on("keydown",((e,t)=>{"Escape"===t.key&&o&&t.stopPropagation()})),i.on("beforeChange",((e,t)=>{var n;if("paste"===t.origin){const e=t.text.map(EC);null==(n=t.update)||n.call(t,t.from,t.to,e)}})),i.documentAST=null,i.operationName=null,i.operations=null,i.variableToType=null,v(i)})),()=>{t=!1}}),[e,d,s,v]),iC(f,"keyMap",r),(0,t.useEffect)((()=>{if(!f)return;function e(e){var t,n,r,i,o;const a=Io(u,e.getValue()),s=B(null!=(t=e.operations)?t:void 0,null!=(n=e.operationName)?n:void 0,null==a?void 0:a.operations);return e.documentAST=null!=(r=null==a?void 0:a.documentAST)?r:null,e.operationName=null!=s?s:null,e.operations=null!=(i=null==a?void 0:a.operations)?i:null,b&&(b.state.lint.linterOptions.variableToType=null==a?void 0:a.variableToType,b.options.lint.variableToType=null==a?void 0:a.variableToType,b.options.hintOptions.variableToType=null==a?void 0:a.variableToType,null==(o=O.current)||o.signal(b,"change",b)),a?m(h({},a),{operationName:s}):null}g(e,"getAndUpdateOperationFacts"),wC(e,"getAndUpdateOperationFacts");const t=Tw(100,(t=>{var n;const r=t.getValue();null==w||w.set(_C,r);const i=t.operationName,o=e(t);void 0!==(null==o?void 0:o.operationName)&&(null==w||w.set(OC,o.operationName)),null==a||a(r,null==o?void 0:o.documentAST),(null==o?void 0:o.operationName)&&i!==o.operationName&&p(o.operationName),E({query:r,operationName:null!=(n=null==o?void 0:o.operationName)?n:null})}));return e(f),f.on("change",t),()=>f.off("change",t)}),[a,f,u,p,w,b,E]),SC(f,null!=u?u:null,O),xC(f,null!=y?y:null,O),NC(f,c,O),aC(f,i||null,CC);const D=null==T?void 0:T.run,L=(0,t.useCallback)((()=>{var e;if(!(D&&f&&f.operations&&f.hasFocus()))return void(null==D||D());const t=f.indexFromPos(f.getCursor());let n;for(const r of f.operations)r.loc&&r.loc.start<=t&&r.loc.end>=t&&(n=null==(e=r.name)?void 0:e.value);n&&n!==f.operationName&&p(n),D()}),[f,D,p]);return sC(f,["Cmd-Enter","Ctrl-Enter"],L),sC(f,["Shift-Ctrl-C"],x),sC(f,["Shift-Ctrl-P","Shift-Ctrl-F"],k),sC(f,["Shift-Ctrl-M"],N),_}function SC(e,n,r){(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.schema!==n;e.state.lint.linterOptions.schema=n,e.options.lint.schema=n,e.options.hintOptions.schema=n,e.options.info.schema=n,e.options.jump.schema=n,t&&r.current&&r.current.signal(e,"change",e)}),[e,n,r])}function xC(e,n,r){(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.validationRules!==n;e.state.lint.linterOptions.validationRules=n,e.options.lint.validationRules=n,t&&r.current&&r.current.signal(e,"change",e)}),[e,n,r])}function NC(e,n,r){const i=(0,t.useMemo)((()=>[...n.values()]),[n]);(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.externalFragments!==i;e.state.lint.linterOptions.externalFragments=i,e.options.lint.externalFragments=i,e.options.hintOptions.externalFragments=i,t&&r.current&&r.current.signal(e,"change",e)}),[e,i,r])}g(CC,"useQueryEditor"),wC(CC,"useQueryEditor"),g(SC,"useSynchronizeSchema"),wC(SC,"useSynchronizeSchema"),g(xC,"useSynchronizeValidationRules"),wC(xC,"useSynchronizeValidationRules"),g(NC,"useSynchronizeExternalFragments"),wC(NC,"useSynchronizeExternalFragments");const kC=/^[a-zA-Z0-9_@(]$/,_C="query",OC="operationName";var IC=Object.defineProperty,DC=g(((e,t)=>IC(e,"name",{value:t,configurable:!0})),"__name$c");function LC(e){let{defaultQuery:t,defaultHeaders:n,headers:r,defaultTabs:i,query:o,variables:a,storage:s}=e;const l=null==s?void 0:s.get(QC);try{if(!l)throw new Error("Storage for tabs is empty");const e=JSON.parse(l);if(AC(e)){const t=GC({query:o,variables:a,headers:r});let n=-1;for(let r=0;r=0)e.activeTabIndex=n;else{const n=o?zC(o):null;e.tabs.push({id:HC(),hash:t,title:n||KC,query:o,variables:a,headers:r,operationName:n,response:null}),e.activeTabIndex=e.tabs.length-1}return e}throw new Error("Storage for tabs is invalid")}catch{return{activeTabIndex:0,tabs:(i||[{query:null!=o?o:t,variables:a,headers:null!=r?r:n}]).map($C)}}}function AC(e){return e&&"object"==typeof e&&!Array.isArray(e)&&RC(e,"activeTabIndex")&&"tabs"in e&&Array.isArray(e.tabs)&&e.tabs.every(MC)}function MC(e){return e&&"object"==typeof e&&!Array.isArray(e)&&FC(e,"id")&&FC(e,"title")&&PC(e,"query")&&PC(e,"variables")&&PC(e,"headers")&&PC(e,"operationName")&&PC(e,"response")}function RC(e,t){return t in e&&"number"==typeof e[t]}function FC(e,t){return t in e&&"string"==typeof e[t]}function PC(e,t){return t in e&&("string"==typeof e[t]||null===e[t])}function jC(e){let{queryEditor:n,variableEditor:r,headerEditor:i,responseEditor:o}=e;return(0,t.useCallback)((e=>{var t,a,s,l,u;const c=null!=(t=null==n?void 0:n.getValue())?t:null,d=null!=(a=null==r?void 0:r.getValue())?a:null,f=null!=(s=null==i?void 0:i.getValue())?s:null,p=null!=(l=null==n?void 0:n.operationName)?l:null;return qC(e,{query:c,variables:d,headers:f,response:null!=(u=null==o?void 0:o.getValue())?u:null,operationName:p})}),[n,r,i,o])}function VC(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return JSON.stringify(e,((e,n)=>"hash"===e||"response"===e||!t&&"headers"===e?null:n))}function UC(e){let{storage:n,shouldPersistHeaders:r}=e;const i=(0,t.useMemo)((()=>Tw(500,(e=>{null==n||n.set(QC,e)}))),[n]);return(0,t.useCallback)((e=>{i(VC(e,r))}),[r,i])}function BC(e){let{queryEditor:n,variableEditor:r,headerEditor:i,responseEditor:o}=e;return(0,t.useCallback)((e=>{let{query:t,variables:a,headers:s,response:l}=e;null==n||n.setValue(null!=t?t:""),null==r||r.setValue(null!=a?a:""),null==i||i.setValue(null!=s?s:""),null==o||o.setValue(null!=l?l:"")}),[i,n,o,r])}function $C(){let{query:e=null,variables:t=null,headers:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:HC(),hash:GC({query:e,variables:t,headers:n}),title:e&&zC(e)||KC,query:e,variables:t,headers:n,operationName:null,response:null}}function qC(e,t){return m(h({},e),{tabs:e.tabs.map(((n,r)=>{if(r!==e.activeTabIndex)return n;const i=h(h({},n),t);return m(h({},i),{hash:GC(i),title:i.operationName||(i.query?zC(i.query):void 0)||KC})}))})}function HC(){const e=DC((()=>Math.floor(65536*(1+Math.random())).toString(16).slice(1)),"s4");return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function GC(e){var t,n,r;return[null!=(t=e.query)?t:"",null!=(n=e.variables)?n:"",null!=(r=e.headers)?r:""].join("|")}function zC(e){var t;const n=/^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m.exec(e);return null!=(t=null==n?void 0:n[2])?t:null}function WC(e){const t=null==e?void 0:e.get(QC);if(t){const n=JSON.parse(t);null==e||e.set(QC,JSON.stringify(n,((e,t)=>"headers"===e?null:t)))}}g(LC,"getDefaultTabState"),DC(LC,"getDefaultTabState"),g(AC,"isTabsState"),DC(AC,"isTabsState"),g(MC,"isTabState"),DC(MC,"isTabState"),g(RC,"hasNumberKey"),DC(RC,"hasNumberKey"),g(FC,"hasStringKey"),DC(FC,"hasStringKey"),g(PC,"hasStringOrNullKey"),DC(PC,"hasStringOrNullKey"),g(jC,"useSynchronizeActiveTabValues"),DC(jC,"useSynchronizeActiveTabValues"),g(VC,"serializeTabState"),DC(VC,"serializeTabState"),g(UC,"useStoreTabs"),DC(UC,"useStoreTabs"),g(BC,"useSetEditorValues"),DC(BC,"useSetEditorValues"),g($C,"createTab"),DC($C,"createTab"),g(qC,"setPropertiesInActiveTab"),DC(qC,"setPropertiesInActiveTab"),g(HC,"guid"),DC(HC,"guid"),g(GC,"hashFromTabContents"),DC(GC,"hashFromTabContents"),g(zC,"fuzzyExtractOperationName"),DC(zC,"fuzzyExtractOperationName"),g(WC,"clearHeadersFromTabs"),DC(WC,"clearHeadersFromTabs");const KC="",QC="tabState";var XC=Object.defineProperty,YC=g(((e,t)=>XC(e,"name",{value:t,configurable:!0})),"__name$b");function JC(){let{editorTheme:e=mE,keyMap:r=gE,onClickReference:i,onEdit:o,readOnly:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;const{initialVariables:l,variableEditor:u,setVariableEditor:c}=iS({nonNull:!0,caller:s||JC}),d=dE(),f=uC({caller:s||JC}),p=cC({caller:s||JC}),h=(0,t.useRef)(null),m=(0,t.useRef)();return(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,4712,23)),Promise.resolve().then(n.t.bind(n,8535,23)),Promise.resolve().then(n.t.bind(n,3340,23))]).then((n=>{if(!t)return;m.current=n;const r=h.current;if(!r)return;const i=n(r,{value:l,lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!a&&"nocursor",foldGutter:!0,lint:{variableToType:void 0},hintOptions:{closeOnUnfocus:!1,completeSingle:!1,container:r,variableToType:void 0},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yE});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!1,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!1,container:r})},"Alt-Space"(){i.showHint({completeSingle:!1,container:r})},"Shift-Space"(){i.showHint({completeSingle:!1,container:r})}}),i.on("keyup",((e,t)=>{const n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),c(i)})),()=>{t=!1}}),[e,l,a,c]),iC(u,"keyMap",r),oC(u,o,ZC,"variables",JC),aC(u,i||null,JC),sC(u,["Cmd-Enter","Ctrl-Enter"],null==d?void 0:d.run),sC(u,["Shift-Ctrl-P"],p),sC(u,["Shift-Ctrl-M"],f),h}g(JC,"useVariableEditor"),YC(JC,"useVariableEditor");const ZC="variables";var eS=Object.defineProperty,tS=g(((e,t)=>eS(e,"name",{value:t,configurable:!0})),"__name$a");const nS=Q("EditorContext");function rS(e){const n=ve(),[i,o]=(0,t.useState)(null),[a,s]=(0,t.useState)(null),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(null),[f,p]=(0,t.useState)((()=>{const t=null!==(null==n?void 0:n.get(oS));return!1!==e.shouldPersistHeaders&&t?"true"===(null==n?void 0:n.get(oS)):Boolean(e.shouldPersistHeaders)}));rC(i,e.headers),rC(a,e.query),rC(l,e.response),rC(c,e.variables);const g=UC({storage:n,shouldPersistHeaders:f}),[v]=(0,t.useState)((()=>{var t,r,i,o,a,s,l,u,c;const d=null!=(r=null!=(t=e.query)?t:null==n?void 0:n.get(_C))?r:null,f=null!=(o=null!=(i=e.variables)?i:null==n?void 0:n.get(ZC))?o:null,p=null!=(s=null!=(a=e.headers)?a:null==n?void 0:n.get(mC))?s:null,h=null!=(l=e.response)?l:"",m=LC({query:d,variables:f,headers:p,defaultTabs:e.defaultTabs||e.initialTabs,defaultQuery:e.defaultQuery||aS,defaultHeaders:e.defaultHeaders,storage:n});return g(m),{query:null!=(u=null!=d?d:0===m.activeTabIndex?m.tabs[0].query:null)?u:"",variables:null!=f?f:"",headers:null!=(c=null!=p?p:e.defaultHeaders)?c:"",response:h,tabState:m}})),[y,b]=(0,t.useState)(v.tabState),E=(0,t.useCallback)((e=>{var t;if(e){null==n||n.set(mC,null!=(t=null==i?void 0:i.getValue())?t:"");const e=VC(y,!0);null==n||n.set(QC,e)}else null==n||n.set(mC,""),WC(n);p(e),null==n||n.set(oS,e.toString())}),[n,y,i]),T=(0,t.useRef)(void 0);(0,t.useEffect)((()=>{const t=Boolean(e.shouldPersistHeaders);T.current!==t&&(E(t),T.current=t)}),[e.shouldPersistHeaders,E]);const w=jC({queryEditor:a,variableEditor:c,headerEditor:i,responseEditor:l}),C=BC({queryEditor:a,variableEditor:c,headerEditor:i,responseEditor:l}),{onTabChange:S,defaultHeaders:x,children:N}=e,k=(0,t.useCallback)((()=>{b((e=>{const t=w(e),n={tabs:[...t.tabs,$C({headers:x})],activeTabIndex:t.tabs.length};return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[x,S,C,g,w]),_=(0,t.useCallback)((e=>{b((t=>{const n=m(h({},w(t)),{activeTabIndex:e});return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[S,C,g,w]),O=(0,t.useCallback)((e=>{b((t=>{const n={tabs:t.tabs.filter(((t,n)=>e!==n)),activeTabIndex:Math.max(t.activeTabIndex-1,0)};return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[S,C,g]),I=(0,t.useCallback)((e=>{b((t=>{const n=qC(t,e);return g(n),null==S||S(n),n}))}),[S,g]),{onEditOperationName:D}=e,L=(0,t.useCallback)((e=>{a&&(a.operationName=e,I({operationName:e}),null==D||D(e))}),[D,a,I]),A=(0,t.useMemo)((()=>{const t=new Map;if(Array.isArray(e.externalFragments))for(const n of e.externalFragments)t.set(n.name.value,n);else if("string"==typeof e.externalFragments)(0,r.visit)((0,r.parse)(e.externalFragments,{}),{FragmentDefinition(e){t.set(e.name.value,e)}});else if(e.externalFragments)throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects.");return t}),[e.externalFragments]),M=(0,t.useMemo)((()=>e.validationRules||[]),[e.validationRules]),R=(0,t.useMemo)((()=>m(h({},y),{addTab:k,changeTab:_,closeTab:O,updateActiveTabValues:I,headerEditor:i,queryEditor:a,responseEditor:l,variableEditor:c,setHeaderEditor:o,setQueryEditor:s,setResponseEditor:u,setVariableEditor:d,setOperationName:L,initialQuery:v.query,initialVariables:v.variables,initialHeaders:v.headers,initialResponse:v.response,externalFragments:A,validationRules:M,shouldPersistHeaders:f,setShouldPersistHeaders:E})),[y,k,_,O,I,i,a,l,c,L,v,A,M,f,E]);return ce(nS.Provider,{value:R,children:N})}e.E=nS,g(rS,"EditorContextProvider"),tS(rS,"EditorContextProvider");const iS=X(nS);e.f=iS;const oS="shouldPersistHeaders",aS='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify query: Shift-Ctrl-P (or press the prettify button)\n#\n# Merge fragments: Shift-Ctrl-M (or press the merge button)\n#\n# Run Query: Ctrl-Enter (or press the play button)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n';var sS=Object.defineProperty,lS=g(((e,t)=>sS(e,"name",{value:t,configurable:!0})),"__name$9");function uS(e){var n=e,{isHidden:r}=n,i=v(n,["isHidden"]);const{headerEditor:o}=iS({nonNull:!0,caller:uS}),a=hC(i,uS);return(0,t.useEffect)((()=>{o&&!r&&o.refresh()}),[o,r]),ce("div",{className:b("graphiql-editor",r&&"hidden"),ref:a})}g(uS,"HeaderEditor"),lS(uS,"HeaderEditor");var cS=Object.defineProperty,dS=g(((e,t)=>cS(e,"name",{value:t,configurable:!0})),"__name$8");function fS(e){var n;const[r,i]=(0,t.useState)({width:null,height:null}),[o,a]=(0,t.useState)(null),s=(0,t.useRef)(null),l=null==(n=pS(e.token))?void 0:n.href;(0,t.useEffect)((()=>{if(s.current)return l?void fetch(l,{method:"HEAD"}).then((e=>{a(e.headers.get("Content-Type"))})).catch((()=>{a(null)})):(i({width:null,height:null}),void a(null))}),[l]);const u=null!==r.width&&null!==r.height?de("div",{children:[r.width,"x",r.height,null===o?null:" "+o]}):null;return de("div",{children:[ce("img",{onLoad:()=>{var e,t,n,r;i({width:null!=(t=null==(e=s.current)?void 0:e.naturalWidth)?t:null,height:null!=(r=null==(n=s.current)?void 0:n.naturalHeight)?r:null})},ref:s,src:l}),u]})}function pS(e){if("string"!==e.type)return;const t=e.string.slice(1).slice(0,-1).trim();try{const{location:e}=window;return new URL(t,e.protocol+"//"+e.host)}catch{return}}function hS(e){return/(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname)}g(fS,"ImagePreview"),dS(fS,"ImagePreview"),fS.shouldRender=dS(g((function(e){const t=pS(e);return!!t&&hS(t)}),"shouldRender"),"shouldRender"),g(pS,"tokenToURL"),dS(pS,"tokenToURL"),g(hS,"isImageURL"),dS(hS,"isImageURL");var mS=Object.defineProperty,gS=g(((e,t)=>mS(e,"name",{value:t,configurable:!0})),"__name$7");function vS(e){const t=CC(e,vS);return ce("div",{className:"graphiql-editor",ref:t})}g(vS,"QueryEditor"),gS(vS,"QueryEditor");var yS=Object.defineProperty,bS=g(((e,t)=>yS(e,"name",{value:t,configurable:!0})),"__name$6");function ES(){let{responseTooltip:e,editorTheme:r=mE,keyMap:o=gE}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;const{fetchError:s,validationErrors:l}=ME({nonNull:!0,caller:a||ES}),{initialResponse:u,responseEditor:c,setResponseEditor:d}=iS({nonNull:!0,caller:a||ES}),f=(0,t.useRef)(null),p=(0,t.useRef)(e);return(0,t.useEffect)((()=>{p.current=e}),[e]),(0,t.useEffect)((()=>{let e=!0;return bE([Promise.resolve().then(n.t.bind(n,8419,23)).then((function(e){return e.f})),Promise.resolve().then(n.t.bind(n,4468,23)).then((function(e){return e.b})),Promise.resolve().then(n.t.bind(n,8058,23)).then((function(e){return e.d})),Promise.resolve().then(n.t.bind(n,9509,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,9407,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4471,23)).then((function(e){return e.j})),Promise.resolve().then(n.t.bind(n,2568,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,1430,23)),Promise.resolve().then(n.t.bind(n,7421,23))],{useCommonAddons:!1}).then((t=>{if(!e)return;const n=document.createElement("div");t.registerHelper("info","graphql-results",((e,t,r,o)=>{const a=[],s=p.current;return s&&a.push(ce(s,{pos:o,token:e})),fS.shouldRender(e)&&a.push(ce(fS,{token:e},"image-preview")),a.length?(i.default.render(a,n),n):(i.default.unmountComponentAtNode(n),null)}));const o=f.current;if(!o)return;const a=t(o,{value:u,lineWrapping:!0,readOnly:!0,theme:r,mode:"graphql-results",foldGutter:!0,gutters:["CodeMirror-foldgutter"],info:!0,extraKeys:yE});d(a)})),()=>{e=!1}}),[r,u,d]),iC(c,"keyMap",o),(0,t.useEffect)((()=>{s&&(null==c||c.setValue(s)),l.length>0&&(null==c||c.setValue(I(l)))}),[c,s,l]),f}g(ES,"useResponseEditor"),bS(ES,"useResponseEditor");var TS=Object.defineProperty,wS=g(((e,t)=>TS(e,"name",{value:t,configurable:!0})),"__name$5");function CS(e){const t=ES(e,CS);return ce("section",{className:"result-window","aria-label":"Result Window","aria-live":"polite","aria-atomic":"true",ref:t})}g(CS,"ResponseEditor"),wS(CS,"ResponseEditor");var SS=Object.defineProperty,xS=g(((e,t)=>SS(e,"name",{value:t,configurable:!0})),"__name$4");function NS(e){var n=e,{isHidden:r}=n,i=v(n,["isHidden"]);const{variableEditor:o}=iS({nonNull:!0,caller:NS}),a=JC(i,NS);return(0,t.useEffect)((()=>{o&&!r&&o.refresh()}),[o,r]),ce("div",{className:b("graphiql-editor",r&&"hidden"),ref:a})}g(NS,"VariableEditor"),xS(NS,"VariableEditor");var kS=Object.defineProperty,_S=g(((e,t)=>kS(e,"name",{value:t,configurable:!0})),"__name$3");function OS(e){let{children:t,dangerouslyAssumeSchemaIsValid:n,defaultQuery:r,defaultHeaders:i,defaultTabs:o,externalFragments:a,fetcher:s,getDefaultFieldNames:l,headers:u,initialTabs:c,inputValueDeprecation:d,introspectionQueryName:f,maxHistoryLength:p,onEditOperationName:h,onSchemaChange:m,onTabChange:g,onTogglePluginVisibility:v,operationName:y,plugins:b,query:E,response:T,schema:w,schemaDescription:C,shouldPersistHeaders:S,storage:x,validationRules:N,variables:k,visiblePlugin:_}=e;return ce(ge,{storage:x,children:ce(Zb,{maxHistoryLength:p,children:ce(rS,{defaultQuery:r,defaultHeaders:i,defaultTabs:o,externalFragments:a,headers:u,initialTabs:c,onEditOperationName:h,onTabChange:g,query:E,response:T,shouldPersistHeaders:S,validationRules:N,variables:k,children:ce(AE,{dangerouslyAssumeSchemaIsValid:n,fetcher:s,inputValueDeprecation:d,introspectionQueryName:f,onSchemaChange:m,schema:w,schemaDescription:C,children:ce(cE,{getDefaultFieldNames:l,fetcher:s,operationName:y,children:ce(BE,{children:ce(Qw,{onTogglePluginVisibility:v,plugins:b,visiblePlugin:_,children:t})})})})})})})}g(OS,"GraphiQLProvider"),_S(OS,"GraphiQLProvider");var IS=Object.defineProperty,DS=g(((e,t)=>IS(e,"name",{value:t,configurable:!0})),"__name$2");function LS(){const e=ve(),[n,r]=(0,t.useState)((()=>{if(!e)return null;const t=e.get(AS);switch(t){case"light":return"light";case"dark":return"dark";default:return"string"==typeof t&&e.set(AS,""),null}}));(0,t.useLayoutEffect)((()=>{"undefined"!=typeof window&&(document.body.classList.remove("graphiql-light","graphiql-dark"),n&&document.body.classList.add(`graphiql-${n}`))}),[n]);const i=(0,t.useCallback)((t=>{null==e||e.set(AS,t||""),r(t)}),[e]);return(0,t.useMemo)((()=>({theme:n,setTheme:i})),[n,i])}g(LS,"useTheme"),DS(LS,"useTheme");const AS="theme";var MS=Object.defineProperty,RS=g(((e,t)=>MS(e,"name",{value:t,configurable:!0})),"__name$1");function FS(e){let{defaultSizeRelation:n=PS,direction:r,initiallyHidden:i,onHiddenElementChange:o,sizeThresholdFirst:a=100,sizeThresholdSecond:s=100,storageKey:l}=e;const u=ve(),c=(0,t.useMemo)((()=>Tw(500,(e=>{u&&l&&u.set(l,e)}))),[u,l]),[d,f]=(0,t.useState)((()=>{const e=u&&l?u.get(l):null;return e===jS||"first"===i?"first":e===VS||"second"===i?"second":null})),p=(0,t.useCallback)((e=>{e!==d&&(f(e),null==o||o(e))}),[d,o]),h=(0,t.useRef)(null),m=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(`${n}`);(0,t.useLayoutEffect)((()=>{const e=u&&l&&u.get(l)||y.current,t="horizontal"===r?"row":"column";h.current&&(h.current.style.display="flex",h.current.style.flexDirection=t,h.current.style.flex=e===jS||e===VS?y.current:e),v.current&&(v.current.style.display="flex",v.current.style.flexDirection=t,v.current.style.flex="1"),m.current&&(m.current.style.display="flex",m.current.style.flexDirection=t)}),[r,u,l]);const b=(0,t.useCallback)((e=>{const t="first"===e?h.current:v.current;if(t&&(t.style.left="-1000px",t.style.position="absolute",t.style.opacity="0",t.style.height="500px",t.style.width="500px",h.current)){const e=parseFloat(h.current.style.flex);(!Number.isFinite(e)||e<1)&&(h.current.style.flex="1")}}),[]),E=(0,t.useCallback)((e=>{const t="first"===e?h.current:v.current;if(t&&(t.style.width="",t.style.height="",t.style.opacity="",t.style.position="",t.style.left="",h.current&&u&&l)){const e=null==u?void 0:u.get(l);e!==jS&&e!==VS&&(h.current.style.flex=e||y.current)}}),[u,l]);return(0,t.useLayoutEffect)((()=>{"first"===d?b("first"):E("first"),"second"===d?b("second"):E("second")}),[d,b,E]),(0,t.useEffect)((()=>{if(!m.current||!h.current||!v.current)return;const e=m.current,t=h.current,n=t.parentElement,i="horizontal"===r?"clientX":"clientY",o="horizontal"===r?"left":"top",l="horizontal"===r?"right":"bottom",u="horizontal"===r?"clientWidth":"clientHeight";function d(r){r.preventDefault();const d=r[i]-e.getBoundingClientRect()[o];function f(r){if(0===r.buttons)return h();const f=r[i]-n.getBoundingClientRect()[o]-d,m=n.getBoundingClientRect()[l]-r[i]+d-e[u];if(f{e.removeEventListener("mousedown",d),e.removeEventListener("dblclick",f)}}),[r,p,a,s,c]),(0,t.useMemo)((()=>({dragBarRef:m,hiddenElement:d,firstRef:h,setHiddenElement:f,secondRef:v})),[d,f])}g(FS,"useDragResize"),RS(FS,"useDragResize");const PS=1,jS="hide-first",VS="hide-second",US=(0,t.forwardRef)(((e,n)=>{var r=e,{label:i}=r,o=v(r,["label"]);const[a,s]=(0,t.useState)(null);return ce(Fb,{label:i,children:ce(is,m(h({},o),{ref:n,type:"button",className:b("graphiql-toolbar-button",a&&"error",o.className),onClick:e=>{var t;try{null==(t=o.onClick)||t.call(o,e),s(null)}catch(e){s(e instanceof Error?e:new Error(`Toolbar button click failed: ${e}`))}},"aria-label":a?a.message:i,"aria-invalid":a?"true":o["aria-invalid"]}))})}));e.aR=US,US.displayName="ToolbarButton";var BS=Object.defineProperty,$S=g(((e,t)=>BS(e,"name",{value:t,configurable:!0})),"__name");function qS(){const{queryEditor:e,setOperationName:t}=iS({nonNull:!0,caller:qS}),{isFetching:n,isSubscribed:r,operationName:i,run:o,stop:a}=dE({nonNull:!0,caller:qS}),s=(null==e?void 0:e.operations)||[],l=s.length>1&&"string"!=typeof i,u=n||r,c=(u?"Stop":"Execute")+" query (Ctrl-Enter)",d={type:"button",className:"graphiql-execute-button",children:ce(u?ts:Wa,{}),"aria-label":c};return l&&!u?de(qh,{children:[ce(Fb,{label:c,children:ce(qh.Button,h({},d))}),ce(qh.List,{children:s.map(((n,r)=>{const i=n.name?n.name.value:``;return ce(qh.Item,{onSelect:()=>{var r;const i=null==(r=n.name)?void 0:r.value;e&&i&&i!==e.operationName&&t(i),o()},children:i},`${i}-${r}`)}))})]}):ce(Fb,{label:c,children:ce("button",m(h({},d),{onClick:()=>{u?a():o()}}))})}g(qS,"ExecuteButton"),$S(qS,"ExecuteButton");const HS=(0,t.forwardRef)(((e,t)=>{var n=e,{button:r,children:i,label:o}=n,a=v(n,["button","children","label"]);const s=`${o}${a.value?`: ${a.value}`:""}`;return de(Gh.Input,m(h({},a),{ref:t,className:b("graphiql-toolbar-listbox",a.className),"aria-label":s,children:[ce(Fb,{label:s,children:ce(Gh.Button,{children:r})}),ce(Gh.Popover,{children:i})]}))}));HS.displayName="ToolbarListbox";const GS=Qc(HS,{Option:Gh.Option});e.aT=GS;const zS=(0,t.forwardRef)(((e,t)=>{var n=e,{button:r,children:i,label:o}=n,a=v(n,["button","children","label"]);return de(qh,m(h({},a),{ref:t,children:[ce(Fb,{label:o,children:ce(qh.Button,{className:b("graphiql-un-styled graphiql-toolbar-menu",a.className),"aria-label":o,children:r})}),ce(qh.List,{children:i})]}))}));zS.displayName="ToolbarMenu";const WS=Qc(zS,{Item:qh.Item});e.aU=WS},void 0===(o=r.apply(t,i))||(e.exports=o)},7421:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(6856),n(9196),n(3573),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";var o=Object.defineProperty,a=(e,t)=>o(e,"name",{value:t,configurable:!0});function s(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}function l(e){const{options:t}=e.state.info;return(null==t?void 0:t.hoverTime)||500}function u(t,n){const r=t.state.info,i=n.target||n.srcElement;if(!(i instanceof HTMLElement))return;if("SPAN"!==i.nodeName||void 0!==r.hoverTimeout)return;const o=i.getBoundingClientRect(),s=a((function(){clearTimeout(r.hoverTimeout),r.hoverTimeout=setTimeout(d,f)}),"onMouseMove"),u=a((function(){e.C.off(document,"mousemove",s),e.C.off(t.getWrapperElement(),"mouseout",u),clearTimeout(r.hoverTimeout),r.hoverTimeout=void 0}),"onMouseOut"),d=a((function(){e.C.off(document,"mousemove",s),e.C.off(t.getWrapperElement(),"mouseout",u),r.hoverTimeout=void 0,c(t,o)}),"onHover"),f=l(t);r.hoverTimeout=setTimeout(d,f),e.C.on(document,"mousemove",s),e.C.on(t.getWrapperElement(),"mouseout",u)}function c(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),r=e.state.info,{options:i}=r,o=i.render||e.getHelper(n,"info");if(o){const r=e.getTokenAt(n,!0);if(r){const a=o(r,i,e,n);a&&d(e,t,a)}}}function d(t,n,r){const i=document.createElement("div");i.className="CodeMirror-info",i.appendChild(r),document.body.appendChild(i);const o=i.getBoundingClientRect(),s=window.getComputedStyle(i),l=o.right-o.left+parseFloat(s.marginLeft)+parseFloat(s.marginRight),u=o.bottom-o.top+parseFloat(s.marginTop)+parseFloat(s.marginBottom);let c=n.bottom;u>window.innerHeight-n.bottom-15&&n.top>window.innerHeight-n.bottom&&(c=n.top-u),c<0&&(c=n.bottom);let d,f=Math.max(0,window.innerWidth-l-15);f>n.left&&(f=n.left),i.style.opacity="1",i.style.top=c+"px",i.style.left=f+"px";const p=a((function(){clearTimeout(d)}),"onMouseOverPopup"),h=a((function(){clearTimeout(d),d=setTimeout(m,200)}),"onMouseOut"),m=a((function(){e.C.off(i,"mouseover",p),e.C.off(i,"mouseout",h),e.C.off(t.getWrapperElement(),"mouseout",h),i.style.opacity?(i.style.opacity="0",setTimeout((()=>{i.parentNode&&i.parentNode.removeChild(i)}),600)):i.parentNode&&i.parentNode.removeChild(i)}),"hidePopup");e.C.on(i,"mouseover",p),e.C.on(i,"mouseout",h),e.C.on(t.getWrapperElement(),"mouseout",h)}e.C.defineOption("info",!1,((t,n,r)=>{if(r&&r!==e.C.Init){const n=t.state.info.onMouseOver;e.C.off(t.getWrapperElement(),"mouseover",n),clearTimeout(t.state.info.hoverTimeout),delete t.state.info}if(n){const r=t.state.info=s(n);r.onMouseOver=u.bind(null,t),e.C.on(t.getWrapperElement(),"mouseover",r.onMouseOver)}})),a(s,"createState"),a(l,"getHoverTime"),a(u,"onMouseOver"),a(c,"onMouseHover"),a(d,"showPopup")})?r.apply(t,i):r)||(e.exports=o)},9890:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(3573),n(535),n(2645),n(7421),n(6856),n(9196),n(1850),n(2635)],r=function(e,t,n,r,i,o,a,s){"use strict";var l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0});function c(e,t,n){d(e,t,n),m(e,t,n,t.type)}function d(e,t,r){var i;b(e,(null===(i=t.fieldDef)||void 0===i?void 0:i.name)||"","field-name",r,(0,n.a)(t))}function f(e,t,r){var i;b(e,"@"+((null===(i=t.directiveDef)||void 0===i?void 0:i.name)||""),"directive-name",r,(0,n.b)(t))}function p(e,t,r){var i;b(e,(null===(i=t.argDef)||void 0===i?void 0:i.name)||"","arg-name",r,(0,n.c)(t)),m(e,t,r,t.inputType)}function h(e,t,r){var i;const o=(null===(i=t.enumValue)||void 0===i?void 0:i.name)||"";g(e,t,r,t.inputType),b(e,"."),b(e,o,"enum-value",r,(0,n.d)(t))}function m(t,r,i,o){const a=document.createElement("span");a.className="type-name-pill",o instanceof e.GraphQLNonNull?(g(a,r,i,o.ofType),b(a,"!")):o instanceof e.GraphQLList?(b(a,"["),g(a,r,i,o.ofType),b(a,"]")):b(a,(null==o?void 0:o.name)||"","type-name",i,(0,n.e)(r,o)),t.appendChild(a)}function g(t,r,i,o){o instanceof e.GraphQLNonNull?(g(t,r,i,o.ofType),b(t,"!")):o instanceof e.GraphQLList?(b(t,"["),g(t,r,i,o.ofType),b(t,"]")):b(t,(null==o?void 0:o.name)||"","type-name",i,(0,n.e)(r,o))}function v(e,t,n){const{description:r}=n;if(r){const n=document.createElement("div");n.className="info-description",t.renderDescription?n.innerHTML=t.renderDescription(r):n.appendChild(document.createTextNode(r)),e.appendChild(n)}y(e,t,n)}function y(e,t,n){const r=n.deprecationReason;if(r){const n=document.createElement("div");n.className="info-deprecation",e.appendChild(n);const i=document.createElement("span");i.className="info-deprecation-label",i.appendChild(document.createTextNode("Deprecated")),n.appendChild(i);const o=document.createElement("div");o.className="info-deprecation-reason",t.renderDescription?o.innerHTML=t.renderDescription(r):o.appendChild(document.createTextNode(r)),n.appendChild(o)}}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{onClick:null},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(n){const{onClick:o}=r;let a;o?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",(e=>{o(i,e)}))):a=document.createElement("span"),a.className=n,a.appendChild(document.createTextNode(t)),e.appendChild(a)}else e.appendChild(document.createTextNode(t))}t.C.registerHelper("info","graphql",((e,t)=>{if(!t.schema||!e.state)return;const{kind:r,step:i}=e.state,o=(0,n.g)(t.schema,e.state);if("Field"===r&&0===i&&o.fieldDef||"AliasedField"===r&&2===i&&o.fieldDef){const e=document.createElement("div");e.className="CodeMirror-info-header",c(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.fieldDef),n}if("Directive"===r&&1===i&&o.directiveDef){const e=document.createElement("div");e.className="CodeMirror-info-header",f(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.directiveDef),n}if("Argument"===r&&0===i&&o.argDef){const e=document.createElement("div");e.className="CodeMirror-info-header",p(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.argDef),n}if("EnumValue"===r&&o.enumValue&&o.enumValue.description){const e=document.createElement("div");e.className="CodeMirror-info-header",h(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.enumValue),n}if("NamedType"===r&&o.type&&o.type.description){const e=document.createElement("div");e.className="CodeMirror-info-header",g(e,o,t,o.type);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.type),n}})),u(c,"renderField"),u(d,"renderQualifiedField"),u(f,"renderDirective"),u(p,"renderArg"),u(h,"renderEnumValue"),u(m,"renderTypeAnnotation"),u(g,"renderType"),u(v,"renderDescription"),u(y,"renderDeprecation"),u(b,"text")},void 0===(o=r.apply(t,i))||(e.exports=o)},8888:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.j=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o,a={exports:{}};(o=t.a.exports).defineMode("javascript",(function(e,t){var n,i,a=e.indentUnit,s=t.statementIndent,l=t.jsonld,u=t.json||l,c=!1!==t.trackScope,d=t.typescript,f=t.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}r(e,"kw");var t=e("keyword a"),n=e("keyword b"),i=e("keyword c"),o=e("keyword d"),a=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:i,void:i,throw:i,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:i,export:e("export"),import:e("import"),extends:i,await:i}}(),h=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function v(e,t,r){return n=e,i=r,t}function y(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=b(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&e.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&e.eat(">"))return v("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return e.eat("*")?(t.tokenize=E,E(e,t)):e.eat("/")?(e.skipToEnd(),v("comment","comment")):ot(e,t,1)?(g(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(e.eat("="),v("operator","operator",e.current()));if("`"==n)return t.tokenize=T,T(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),v("meta","meta");if("#"==n&&e.eatWhile(f))return v("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),v("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?v("."):v("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return v(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function b(e){return function(t,n){var r,i=!1;if(l&&"@"==t.peek()&&t.match(m))return n.tokenize=y,v("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=y),v("string","string")}}function E(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=y;break}r="*"==n}return v("comment","comment")}function T(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=y;break}r=!r&&"\\"==n}return v("quasi","string-2",e.current())}r(g,"readRegexp"),r(v,"ret"),r(y,"tokenBase"),r(b,"tokenString"),r(E,"tokenComment"),r(T,"tokenQuasi");var w="([{}])";function C(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(d){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=w.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}r(C,"findFatArrow");var S={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function N(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function k(e,t,n,r,i){var o=e.cc;for(_.state=e,_.stream=i,_.marked=null,_.cc=o,_.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():u?z:H)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return _.marked?_.marked:"variable"==n&&N(e,r)?"variable-2":t}}r(x,"JSLexical"),r(N,"inScope"),r(k,"parseJS");var _={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)_.cc.push(arguments[e])}function I(){return O.apply(null,arguments),!0}function D(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function L(e){var n=_.state;if(_.marked="def",c){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=A(e,n.context);if(null!=r)return void(n.context=r)}else if(!D(e,n.localVars))return void(n.localVars=new F(e,n.localVars));t.globalVars&&!D(e,n.globalVars)&&(n.globalVars=new F(e,n.globalVars))}}function A(e,t){if(t){if(t.block){var n=A(e,t.prev);return n?n==t.prev?t:new R(n,t.vars,!0):null}return D(e,t.vars)?t:new R(t.prev,new F(e,t.vars),!1)}return null}function M(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function F(e,t){this.name=e,this.next=t}r(O,"pass"),r(I,"cont"),r(D,"inList"),r(L,"register"),r(A,"registerVarScoped"),r(M,"isModifier"),r(R,"Context"),r(F,"Var");var P=new F("this",new F("arguments",null));function j(){_.state.context=new R(_.state.context,_.state.localVars,!1),_.state.localVars=P}function V(){_.state.context=new R(_.state.context,_.state.localVars,!0),_.state.localVars=null}function U(){_.state.localVars=_.state.context.vars,_.state.context=_.state.context.prev}function B(e,t){var n=r((function(){var n=_.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new x(r,_.stream.column(),e,null,n.lexical,t)}),"result");return n.lex=!0,n}function $(){var e=_.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function q(e){function t(n){return n==e?I():";"==e||"}"==n||")"==n||"]"==n?O():I(t)}return r(t,"exp"),t}function H(e,t){return"var"==e?I(B("vardef",t),Oe,q(";"),$):"keyword a"==e?I(B("form"),K,H,$):"keyword b"==e?I(B("form"),H,$):"keyword d"==e?_.stream.match(/^\s*$/,!1)?I():I(B("stat"),X,q(";"),$):"debugger"==e?I(q(";")):"{"==e?I(B("}"),V,pe,$,U):";"==e?I():"if"==e?("else"==_.state.lexical.info&&_.state.cc[_.state.cc.length-1]==$&&_.state.cc.pop()(),I(B("form"),K,H,$,Re)):"function"==e?I(Ve):"for"==e?I(B("form"),V,Fe,H,U,$):"class"==e||d&&"interface"==t?(_.marked="keyword",I(B("form","class"==e?e:t),He,$)):"variable"==e?d&&"declare"==t?(_.marked="keyword",I(H)):d&&("module"==t||"enum"==t||"type"==t)&&_.stream.match(/^\s*\w/,!1)?(_.marked="keyword","enum"==t?I(nt):"type"==t?I(Be,q("operator"),ye,q(";")):I(B("form"),Ie,q("{"),B("}"),pe,$,$)):d&&"namespace"==t?(_.marked="keyword",I(B("form"),z,H,$)):d&&"abstract"==t?(_.marked="keyword",I(H)):I(B("stat"),ae):"switch"==e?I(B("form"),K,q("{"),B("}","switch"),V,pe,$,$,U):"case"==e?I(z,q(":")):"default"==e?I(q(":")):"catch"==e?I(B("form"),j,G,H,$,U):"export"==e?I(B("stat"),Ke,$):"import"==e?I(B("stat"),Xe,$):"async"==e?I(H):"@"==t?I(z,H):O(B("stat"),z,q(";"),$)}function G(e){if("("==e)return I($e,q(")"))}function z(e,t){return Q(e,t,!1)}function W(e,t){return Q(e,t,!0)}function K(e){return"("!=e?O():I(B(")"),X,q(")"),$)}function Q(e,t,n){if(_.state.fatArrowAt==_.stream.start){var r=n?ne:te;if("("==e)return I(j,B(")"),de($e,")"),$,q("=>"),r,U);if("variable"==e)return O(j,Ie,q("=>"),r,U)}var i=n?J:Y;return S.hasOwnProperty(e)?I(i):"function"==e?I(Ve,i):"class"==e||d&&"interface"==t?(_.marked="keyword",I(B("form"),qe,$)):"keyword c"==e||"async"==e?I(n?W:z):"("==e?I(B(")"),X,q(")"),$,i):"operator"==e||"spread"==e?I(n?W:z):"["==e?I(B("]"),tt,$,i):"{"==e?fe(le,"}",null,i):"quasi"==e?O(Z,i):"new"==e?I(re(n)):I()}function X(e){return e.match(/[;\}\)\],]/)?O():O(z)}function Y(e,t){return","==e?I(X):J(e,t,!1)}function J(e,t,n){var r=0==n?Y:J,i=0==n?z:W;return"=>"==e?I(j,n?ne:te,U):"operator"==e?/\+\+|--/.test(t)||d&&"!"==t?I(r):d&&"<"==t&&_.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?I(B(">"),de(ye,">"),$,r):"?"==t?I(z,q(":"),i):I(i):"quasi"==e?O(Z,r):";"!=e?"("==e?fe(W,")","call",r):"."==e?I(se,r):"["==e?I(B("]"),X,q("]"),$,r):d&&"as"==t?(_.marked="keyword",I(ye,r)):"regexp"==e?(_.state.lastType=_.marked="operator",_.stream.backUp(_.stream.pos-_.stream.start-1),I(i)):void 0:void 0}function Z(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?I(Z):I(X,ee)}function ee(e){if("}"==e)return _.marked="string-2",_.state.tokenize=T,I(Z)}function te(e){return C(_.stream,_.state),O("{"==e?H:z)}function ne(e){return C(_.stream,_.state),O("{"==e?H:W)}function re(e){return function(t){return"."==t?I(e?oe:ie):"variable"==t&&d?I(Ne,e?J:Y):O(e?W:z)}}function ie(e,t){if("target"==t)return _.marked="keyword",I(Y)}function oe(e,t){if("target"==t)return _.marked="keyword",I(J)}function ae(e){return":"==e?I($,H):O(Y,q(";"),$)}function se(e){if("variable"==e)return _.marked="property",I()}function le(e,t){return"async"==e?(_.marked="property",I(le)):"variable"==e||"keyword"==_.style?(_.marked="property","get"==t||"set"==t?I(ue):(d&&_.state.fatArrowAt==_.stream.start&&(n=_.stream.match(/^\s*:\s*/,!1))&&(_.state.fatArrowAt=_.stream.pos+n[0].length),I(ce))):"number"==e||"string"==e?(_.marked=l?"property":_.style+" property",I(ce)):"jsonld-keyword"==e?I(ce):d&&M(t)?(_.marked="keyword",I(le)):"["==e?I(z,he,q("]"),ce):"spread"==e?I(W,ce):"*"==t?(_.marked="keyword",I(le)):":"==e?O(ce):void 0;var n}function ue(e){return"variable"!=e?O(ce):(_.marked="property",I(Ve))}function ce(e){return":"==e?I(W):"("==e?O(Ve):void 0}function de(e,t,n){function i(r,o){if(n?n.indexOf(r)>-1:","==r){var a=_.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),I((function(n,r){return n==t||r==t?O():O(e)}),i)}return r==t||o==t?I():n&&n.indexOf(";")>-1?O(e):I(q(t))}return r(i,"proceed"),function(n,r){return n==t||r==t?I():O(e,i)}}function fe(e,t,n){for(var r=3;r"),ye):"quasi"==e?O(we,xe):void 0}function be(e){if("=>"==e)return I(ye)}function Ee(e){return e.match(/[\}\)\]]/)?I():","==e||";"==e?I(Ee):O(Te,Ee)}function Te(e,t){return"variable"==e||"keyword"==_.style?(_.marked="property",I(Te)):"?"==t||"number"==e||"string"==e?I(Te):":"==e?I(ye):"["==e?I(q("variable"),me,q("]"),Te):"("==e?O(Ue,Te):e.match(/[;\}\)\],]/)?void 0:I()}function we(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?I(we):I(ye,Ce)}function Ce(e){if("}"==e)return _.marked="string-2",_.state.tokenize=T,I(we)}function Se(e,t){return"variable"==e&&_.stream.match(/^\s*[?:]/,!1)||"?"==t?I(Se):":"==e?I(ye):"spread"==e?I(Se):O(ye)}function xe(e,t){return"<"==t?I(B(">"),de(ye,">"),$,xe):"|"==t||"."==e||"&"==t?I(ye):"["==e?I(ye,q("]"),xe):"extends"==t||"implements"==t?(_.marked="keyword",I(ye)):"?"==t?I(ye,q(":"),ye):void 0}function Ne(e,t){if("<"==t)return I(B(">"),de(ye,">"),$,xe)}function ke(){return O(ye,_e)}function _e(e,t){if("="==t)return I(ye)}function Oe(e,t){return"enum"==t?(_.marked="keyword",I(nt)):O(Ie,he,Ae,Me)}function Ie(e,t){return d&&M(t)?(_.marked="keyword",I(Ie)):"variable"==e?(L(t),I()):"spread"==e?I(Ie):"["==e?fe(Le,"]"):"{"==e?fe(De,"}"):void 0}function De(e,t){return"variable"!=e||_.stream.match(/^\s*:/,!1)?("variable"==e&&(_.marked="property"),"spread"==e?I(Ie):"}"==e?O():"["==e?I(z,q("]"),q(":"),De):I(q(":"),Ie,Ae)):(L(t),I(Ae))}function Le(){return O(Ie,Ae)}function Ae(e,t){if("="==t)return I(W)}function Me(e){if(","==e)return I(Oe)}function Re(e,t){if("keyword b"==e&&"else"==t)return I(B("form","else"),H,$)}function Fe(e,t){return"await"==t?I(Fe):"("==e?I(B(")"),Pe,$):void 0}function Pe(e){return"var"==e?I(Oe,je):"variable"==e?I(je):O(je)}function je(e,t){return")"==e?I():";"==e?I(je):"in"==t||"of"==t?(_.marked="keyword",I(z,je)):O(z,je)}function Ve(e,t){return"*"==t?(_.marked="keyword",I(Ve)):"variable"==e?(L(t),I(Ve)):"("==e?I(j,B(")"),de($e,")"),$,ge,H,U):d&&"<"==t?I(B(">"),de(ke,">"),$,Ve):void 0}function Ue(e,t){return"*"==t?(_.marked="keyword",I(Ue)):"variable"==e?(L(t),I(Ue)):"("==e?I(j,B(")"),de($e,")"),$,ge,U):d&&"<"==t?I(B(">"),de(ke,">"),$,Ue):void 0}function Be(e,t){return"keyword"==e||"variable"==e?(_.marked="type",I(Be)):"<"==t?I(B(">"),de(ke,">"),$):void 0}function $e(e,t){return"@"==t&&I(z,$e),"spread"==e?I($e):d&&M(t)?(_.marked="keyword",I($e)):d&&"this"==e?I(he,Ae):O(Ie,he,Ae)}function qe(e,t){return"variable"==e?He(e,t):Ge(e,t)}function He(e,t){if("variable"==e)return L(t),I(Ge)}function Ge(e,t){return"<"==t?I(B(">"),de(ke,">"),$,Ge):"extends"==t||"implements"==t||d&&","==e?("implements"==t&&(_.marked="keyword"),I(d?ye:z,Ge)):"{"==e?I(B("}"),ze,$):void 0}function ze(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||d&&M(t))&&_.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(_.marked="keyword",I(ze)):"variable"==e||"keyword"==_.style?(_.marked="property",I(We,ze)):"number"==e||"string"==e?I(We,ze):"["==e?I(z,he,q("]"),We,ze):"*"==t?(_.marked="keyword",I(ze)):d&&"("==e?O(Ue,ze):";"==e||","==e?I(ze):"}"==e?I():"@"==t?I(z,ze):void 0}function We(e,t){if("!"==t)return I(We);if("?"==t)return I(We);if(":"==e)return I(ye,Ae);if("="==t)return I(W);var n=_.state.lexical.prev;return O(n&&"interface"==n.info?Ue:Ve)}function Ke(e,t){return"*"==t?(_.marked="keyword",I(et,q(";"))):"default"==t?(_.marked="keyword",I(z,q(";"))):"{"==e?I(de(Qe,"}"),et,q(";")):O(H)}function Qe(e,t){return"as"==t?(_.marked="keyword",I(q("variable"))):"variable"==e?O(W,Qe):void 0}function Xe(e){return"string"==e?I():"("==e?O(z):"."==e?O(Y):O(Ye,Je,et)}function Ye(e,t){return"{"==e?fe(Ye,"}"):("variable"==e&&L(t),"*"==t&&(_.marked="keyword"),I(Ze))}function Je(e){if(","==e)return I(Ye,Je)}function Ze(e,t){if("as"==t)return _.marked="keyword",I(Ye)}function et(e,t){if("from"==t)return _.marked="keyword",I(z)}function tt(e){return"]"==e?I():O(de(W,"]"))}function nt(){return O(B("form"),Ie,q("{"),B("}"),de(rt,"}"),$,$)}function rt(){return O(Ie,Ae)}function it(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,n){return t.tokenize==y&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return r(j,"pushcontext"),r(V,"pushblockcontext"),j.lex=V.lex=!0,r(U,"popcontext"),U.lex=!0,r(B,"pushlex"),r($,"poplex"),$.lex=!0,r(q,"expect"),r(H,"statement"),r(G,"maybeCatchBinding"),r(z,"expression"),r(W,"expressionNoComma"),r(K,"parenExpr"),r(Q,"expressionInner"),r(X,"maybeexpression"),r(Y,"maybeoperatorComma"),r(J,"maybeoperatorNoComma"),r(Z,"quasi"),r(ee,"continueQuasi"),r(te,"arrowBody"),r(ne,"arrowBodyNoComma"),r(re,"maybeTarget"),r(ie,"target"),r(oe,"targetNoComma"),r(ae,"maybelabel"),r(se,"property"),r(le,"objprop"),r(ue,"getterSetter"),r(ce,"afterprop"),r(de,"commasep"),r(fe,"contCommasep"),r(pe,"block"),r(he,"maybetype"),r(me,"maybetypeOrIn"),r(ge,"mayberettype"),r(ve,"isKW"),r(ye,"typeexpr"),r(be,"maybeReturnType"),r(Ee,"typeprops"),r(Te,"typeprop"),r(we,"quasiType"),r(Ce,"continueQuasiType"),r(Se,"typearg"),r(xe,"afterType"),r(Ne,"maybeTypeArgs"),r(ke,"typeparam"),r(_e,"maybeTypeDefault"),r(Oe,"vardef"),r(Ie,"pattern"),r(De,"proppattern"),r(Le,"eltpattern"),r(Ae,"maybeAssign"),r(Me,"vardefCont"),r(Re,"maybeelse"),r(Fe,"forspec"),r(Pe,"forspec1"),r(je,"forspec2"),r(Ve,"functiondef"),r(Ue,"functiondecl"),r(Be,"typename"),r($e,"funarg"),r(qe,"classExpression"),r(He,"className"),r(Ge,"classNameAfter"),r(ze,"classBody"),r(We,"classfield"),r(Ke,"afterExport"),r(Qe,"exportField"),r(Xe,"afterImport"),r(Ye,"importSpec"),r(Je,"maybeMoreImports"),r(Ze,"maybeAs"),r(et,"maybeFrom"),r(tt,"arrayLiteral"),r(nt,"enumdef"),r(rt,"enummember"),r(it,"isContinuedStatement"),r(ot,"expressionAllowed"),{startState:function(e){var n={tokenize:y,lastType:"sof",cc:[],lexical:new x((e||0)-a,0,"block",!1),localVars:t.localVars,context:t.localVars&&new R(null,null,!1),indented:e||0};return t.globalVars&&"object"==typeof t.globalVars&&(n.globalVars=t.globalVars),n},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),C(e,t)),t.tokenize!=E&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",k(t,r,n,i,e))},indent:function(e,n){if(e.tokenize==E||e.tokenize==T)return o.Pass;if(e.tokenize!=y)return 0;var r,i=n&&n.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(n))for(var u=e.cc.length-1;u>=0;--u){var c=e.cc[u];if(c==$)l=l.prev;else if(c!=Re&&c!=U)break}for(;("stat"==l.type||"form"==l.type)&&("}"==i||(r=e.cc[e.cc.length-1])&&(r==Y||r==J)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;s&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=i==d;return"vardef"==d?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==d&&"{"==i?l.indented:"form"==d?l.indented+a:"stat"==d?l.indented+(it(e,n)?s||a:0):"switch"!=l.info||f||0==t.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:a):l.indented+(/^(?:case|default)\b/.test(n)?a:2*a)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:l,jsonMode:u,expressionAllowed:ot,skipExpression:function(e){k(e,"atom","atom","true",new o.StringStream("",2,null))}}})),o.registerHelper("wordChars","javascript",/[\w$]/),o.defineMIME("text/javascript","javascript"),o.defineMIME("text/ecmascript","javascript"),o.defineMIME("application/javascript","javascript"),o.defineMIME("application/x-javascript","javascript"),o.defineMIME("application/ecmascript","javascript"),o.defineMIME("application/json",{name:"javascript",json:!0}),o.defineMIME("application/x-json",{name:"javascript",json:!0}),o.defineMIME("application/manifest+json",{name:"javascript",json:!0}),o.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),o.defineMIME("text/typescript",{name:"javascript",typescript:!0}),o.defineMIME("application/typescript",{name:"javascript",typescript:!0});var s=i({__proto__:null,default:a.exports},[a.exports]);e.j=s},void 0===(o=r.apply(t,i))||(e.exports=o)},4471:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(8058)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.j=void 0;var r=Object.defineProperty,i=(e,t)=>r(e,"name",{value:t,configurable:!0});function o(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}i(o,"_mergeNamespaces");var a={exports:{}};!function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase("Jump to line:")+' '+e.phrase("(Use line:column or scroll% syntax)")+""}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.defineOption("search",{bottom:!1}),i(t,"dialog"),i(n,"getJumpDialog"),i(r,"interpretLine"),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var n;if(t)if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(t.a.exports,n.a.exports);var s=o({__proto__:null,default:a.exports},[a.exports]);e.j=s})?r.apply(t,i):r)||(e.exports=o)},5980:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(2645),n(6856),n(9196),n(3573),n(1850),n(2635)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a){"use strict";var s=Object.defineProperty,l=(e,t)=>s(e,"name",{value:t,configurable:!0});function u(e,t){const n=t.target||t.srcElement;if(!(n instanceof HTMLElement))return;if("SPAN"!==(null==n?void 0:n.nodeName))return;const r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&h(e)}function c(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&m(e):e.state.jump.cursor=null}function d(t,n){if(t.state.jump.isHoldingModifier||!p(n.key))return;t.state.jump.isHoldingModifier=!0,t.state.jump.cursor&&h(t);const r=l((a=>{a.code===n.code&&(t.state.jump.isHoldingModifier=!1,t.state.jump.marker&&m(t),e.C.off(document,"keyup",r),e.C.off(document,"click",i),t.off("mousedown",o))}),"onKeyUp"),i=l((e=>{const{destination:n,options:r}=t.state.jump;n&&r.onClick(n,e)}),"onClick"),o=l(((e,n)=>{t.state.jump.destination&&(n.codemirrorIgnore=!0)}),"onMouseDown");e.C.on(document,"keyup",r),e.C.on(document,"click",i),t.on("mousedown",o)}e.C.defineOption("jump",!1,((t,n,r)=>{if(r&&r!==e.C.Init){const n=t.state.jump.onMouseOver;e.C.off(t.getWrapperElement(),"mouseover",n);const r=t.state.jump.onMouseOut;e.C.off(t.getWrapperElement(),"mouseout",r),e.C.off(document,"keydown",t.state.jump.onKeyDown),delete t.state.jump}if(n){const r=t.state.jump={options:n,onMouseOver:u.bind(null,t),onMouseOut:c.bind(null,t),onKeyDown:d.bind(null,t)};e.C.on(t.getWrapperElement(),"mouseover",r.onMouseOver),e.C.on(t.getWrapperElement(),"mouseout",r.onMouseOut),e.C.on(document,"keydown",r.onKeyDown)}})),l(u,"onMouseOver"),l(c,"onMouseOut"),l(d,"onKeyDown");const f="undefined"!=typeof navigator&&navigator&&navigator.appVersion.includes("Mac");function p(e){return e===(f?"Meta":"Control")}function h(e){if(e.state.jump.marker)return;const{cursor:t,options:n}=e.state.jump,r=e.coordsChar(t),i=e.getTokenAt(r,!0),o=n.getDestination||e.getHelper(r,"jump");if(o){const t=o(i,n,e);if(t){const n=e.markText({line:r.line,ch:i.start},{line:r.line,ch:i.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=n,e.state.jump.destination=t}}}function m(e){const{marker:t}=e.state.jump;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}l(p,"isJumpModifier"),l(h,"enableJumpMode"),l(m,"disableJumpMode"),e.C.registerHelper("jump","graphql",((e,n)=>{if(!n.schema||!n.onClick||!e.state)return;const{state:r}=e,{kind:i,step:o}=r,a=(0,t.g)(n.schema,r);return"Field"===i&&0===o&&a.fieldDef||"AliasedField"===i&&2===o&&a.fieldDef?(0,t.a)(a):"Directive"===i&&1===o&&a.directiveDef?(0,t.b)(a):"Argument"===i&&0===o&&a.argDef?(0,t.c)(a):"EnumValue"===i&&a.enumValue?(0,t.d)(a):"NamedType"===i&&a.type?(0,t.e)(a):void 0}))})?r.apply(t,i):r)||(e.exports=o)},9444:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(5609),n(9196),n(1850)],r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty,s=(e,t)=>a(e,"name",{value:t,configurable:!0});const l=[t.LoneSchemaDefinitionRule,t.UniqueOperationTypesRule,t.UniqueTypeNamesRule,t.UniqueEnumValueNamesRule,t.UniqueFieldDefinitionNamesRule,t.UniqueDirectiveNamesRule,t.KnownTypeNamesRule,t.KnownDirectivesRule,t.UniqueDirectivesPerLocationRule,t.PossibleTypeExtensionsRule,t.UniqueArgumentNamesRule,t.UniqueInputFieldNamesRule];function u(e,n,r,i,o){const a=t.specifiedRules.filter((e=>e!==t.NoUnusedFragmentsRule&&e!==t.ExecutableDefinitionsRule&&(!i||e!==t.KnownFragmentNamesRule)));return r&&Array.prototype.push.apply(a,r),o&&Array.prototype.push.apply(a,l),(0,t.validate)(e,n,a).filter((e=>{if(e.message.includes("Unknown directive")&&e.nodes){const n=e.nodes[0];if(n&&n.kind===t.Kind.DIRECTIVE){const e=n.name.value;if("arguments"===e||"argumentDefinitions"===e)return!1}}return!0}))}s(u,"validateWithCustomRules");const c={["Error"]:1,["Warning"]:2,["Information"]:3,["Hint"]:4},d=s(((e,t)=>{if(!e)throw new Error(t)}),"invariant");function f(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;var a,s;let l=null,u="";o&&(u="string"==typeof o?o:o.reduce(((e,n)=>e+(0,t.print)(n)+"\n\n"),""));const d=u?`${e}\n\n${u}`:e;try{l=(0,t.parse)(d)}catch(e){if(e instanceof t.GraphQLError){const t=m(null!==(s=null===(a=e.locations)||void 0===a?void 0:a[0])&&void 0!==s?s:{line:0,column:0},d);return[{severity:c.Error,message:e.message,source:"GraphQL: Syntax",range:t}]}throw e}return p(l,n,r,i)}function p(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!n)return[];const r=u(n,e,arguments.length>2?arguments[2]:void 0,arguments.length>3?arguments[3]:void 0).flatMap((e=>h(e,c.Error,"Validation"))),i=(0,t.validate)(n,e,[t.NoDeprecatedCustomRule]).flatMap((e=>h(e,c.Warning,"Deprecation")));return r.concat(i)}function h(e,t,n){if(!e.nodes)return[];const i=[];return e.nodes.forEach(((o,a)=>{const s="Variable"!==o.kind&&"name"in o&&void 0!==o.name?o.name:"variable"in o&&void 0!==o.variable?o.variable:o;if(s){d(e.locations,"GraphQL validation error requires locations.");const o=e.locations[a],l=g(s),u=o.column+(l.end-l.start);i.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new r.R(new r.P(o.line-1,o.column-1),new r.P(o.line-1,u))})}})),i}function m(e,t){const i=(0,n.o)(),o=i.startState(),a=t.split("\n");d(a.length>=e.line,"Query text must have more lines than where the error happened");let s=null;for(let t=0;t{const{schema:r,validationRules:i,externalFragments:o}=n;return f(t,r,i,void 0,o).map((t=>({message:t.message,severity:t.severity?v[t.severity-1]:v[0],type:t.source?y[t.source]:void 0,from:e.C.Pos(t.range.start.line,t.range.start.character),to:e.C.Pos(t.range.end.line,t.range.end.character)})))}))},void 0===(o=r.apply(t,i))||(e.exports=o)},8535:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";var o=Object.defineProperty,a=(e,t)=>o(e,"name",{value:t,configurable:!0});function s(e){l=e,u=e.length,c=d=f=-1,S(),x();const t=m();return E("EOF"),t}let l,u,c,d,f,p,h;function m(){const e=c,t=[];if(E("{"),!C("}")){do{t.push(g())}while(C(","));E("}")}return{kind:"Object",start:e,end:f,members:t}}function g(){const e=c,t="String"===h?b():null;E("String"),E(":");const n=y();return{kind:"Member",start:e,end:f,key:t,value:n}}function v(){const e=c,t=[];if(E("["),!C("]")){do{t.push(y())}while(C(","));E("]")}return{kind:"Array",start:e,end:f,values:t}}function y(){switch(h){case"[":return v();case"{":return m();case"String":case"Number":case"Boolean":case"Null":const e=b();return x(),e}E("Value")}function b(){return{kind:h,start:c,end:d,value:JSON.parse(l.slice(c,d))}}function E(e){if(h===e)return void x();let t;if("EOF"===h)t="[end of file]";else if(d-c>1)t="`"+l.slice(c,d)+"`";else{const e=l.slice(c).match(/^.+?\b/);t="`"+(e?e[0]:l[c])+"`"}throw w(`Expected ${e} but found ${t}.`)}a(s,"jsonParse"),a(m,"parseObj"),a(g,"parseMember"),a(v,"parseArr"),a(y,"parseVal"),a(b,"curToken"),a(E,"expect");class T extends Error{constructor(e,t){super(e),this.position=t}}function w(e){return new T(e,{start:c,end:d})}function C(e){if(h===e)return x(),!0}function S(){return d31;)if(92===p)switch(p=S(),p){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:S();break;case 117:S(),k(),k(),k(),k();break;default:throw w("Bad character escape sequence.")}else{if(d===u)throw w("Unterminated string.");S()}if(34!==p)throw w("Unterminated string.");S()}function k(){if(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)return S();throw w("Expected hexadecimal digit.")}function _(){45===p&&S(),48===p?S():O(),46===p&&(S(),O()),69!==p&&101!==p||(p=S(),43!==p&&45!==p||S(),O())}function O(){if(p<48||p>57)throw w("Expected decimal digit.");do{S()}while(p>=48&&p<=57)}function I(e,t,n){const r=[];return n.members.forEach((n=>{var i;if(n){const o=null===(i=n.key)||void 0===i?void 0:i.value,a=t[o];a?D(a,n.value).forEach((t=>{let[n,i]=t;r.push(L(e,n,i))})):r.push(L(e,n.key,`Variable "$${o}" does not appear in any GraphQL query.`))}})),r}function D(e,n){if(!e||!n)return[];if(e instanceof t.GraphQLNonNull)return"Null"===n.kind?[[n,`Type "${e}" is non-nullable and cannot be null.`]]:D(e.ofType,n);if("Null"===n.kind)return[];if(e instanceof t.GraphQLList){const t=e.ofType;return"Array"===n.kind?M(n.values||[],(e=>D(t,e))):D(t,n)}if(e instanceof t.GraphQLInputObjectType){if("Object"!==n.kind)return[[n,`Type "${e}" must be an Object.`]];const r=Object.create(null),i=M(n.members,(t=>{var n;const i=null===(n=null==t?void 0:t.key)||void 0===n?void 0:n.value;r[i]=!0;const o=e.getFields()[i];return o?D(o?o.type:void 0,t.value):[[t.key,`Type "${e}" does not have a field "${i}".`]]}));return Object.keys(e.getFields()).forEach((o=>{const a=e.getFields()[o];!r[o]&&a.type instanceof t.GraphQLNonNull&&!a.defaultValue&&i.push([n,`Object of type "${e}" is missing required field "${o}".`])})),i}return"Boolean"===e.name&&"Boolean"!==n.kind||"String"===e.name&&"String"!==n.kind||"ID"===e.name&&"Number"!==n.kind&&"String"!==n.kind||"Float"===e.name&&"Number"!==n.kind||"Int"===e.name&&("Number"!==n.kind||(0|n.value)!==n.value)||(e instanceof t.GraphQLEnumType||e instanceof t.GraphQLScalarType)&&("String"!==n.kind&&"Number"!==n.kind&&"Boolean"!==n.kind&&"Null"!==n.kind||A(e.parseValue(n.value)))?[[n,`Expected value of type "${e}".`]]:[]}function L(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function A(e){return null==e||e!=e}function M(e,t){return Array.prototype.concat.apply([],e.map(t))}a(T,"JSONSyntaxError"),a(w,"syntaxError"),a(C,"skip"),a(S,"ch"),a(x,"lex"),a(N,"readString"),a(k,"readHex"),a(_,"readNumber"),a(O,"readDigits"),e.C.registerHelper("lint","graphql-variables",((e,t,n)=>{if(!e)return[];let r;try{r=s(e)}catch(e){if(e instanceof T)return[L(n,e.position,e.message)];throw e}const{variableToType:i}=t;return i?I(n,i,r):[]})),a(I,"validateVariables"),a(D,"validateValue"),a(L,"lintError"),a(A,"isNullish"),a(M,"mapCat")})?r.apply(t,i):r)||(e.exports=o)},4054:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.l=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t="CodeMirror-lint-markers",n="CodeMirror-lint-line-";function i(t,n,i){var o=document.createElement("div");function a(t){if(!o.parentNode)return e.off(document,"mousemove",a);o.style.top=Math.max(0,t.clientY-o.offsetHeight-5)+"px",o.style.left=t.clientX+5+"px"}return o.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,o.appendChild(i.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(o):document.body.appendChild(o),r(a,"position"),e.on(document,"mousemove",a),a(n),null!=o.style.opacity&&(o.style.opacity=1),o}function o(e){e.parentNode&&e.parentNode.removeChild(e)}function a(e){e.parentNode&&(null==e.style.opacity&&o(e),e.style.opacity=0,setTimeout((function(){o(e)}),600))}function s(t,n,o,s){var l=i(t,n,o);function u(){e.off(s,"mouseout",u),l&&(a(l),l=null)}r(u,"hide");var c=setInterval((function(){if(l)for(var e=s;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){u();break}}if(!l)return clearInterval(c)}),400);e.on(s,"mouseout",u)}function l(e,t,n){for(var r in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},u)this.options[r]=u[r];for(var r in t)u.hasOwnProperty(r)?null!=t[r]&&(this.options[r]=t[r]):t.options||(this.linterOptions[r]=t[r]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){T(e,t)},this.waitingFor=0}r(i,"showTooltip"),r(o,"rm"),r(a,"hideTooltip"),r(s,"showTooltipFor"),r(l,"LintState");var u={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function c(e){var n=e.state.lint;n.hasGutter&&e.clearGutter(t),n.options.highlightLines&&d(e);for(var r=0;r-1)&&u.push(e.message)}));for(var d=null,g=i.hasGutter&&document.createDocumentFragment(),v=0;v1,o.tooltips)),o.highlightLines&&e.addLineClass(s,"wrap",n+d)}}o.onUpdateLinting&&o.onUpdateLinting(r,a,e)}}function b(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){v(e)}),t.options.delay))}function E(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;on(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,r){var a=e.getLineHandle(t.line),l=t.ch-1,u=r&&r.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=o(r),d=!u&&l>=0&&c.test(a.text.charAt(l))&&i[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&i[a.text.charAt(++l)];if(!d)return null;var f=">"==d.charAt(1)?1:-1;if(r&&r.strict&&f>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=s(e,n(t.line,l+(f>0?1:0)),f,p,r);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==d.charAt(0),forward:f>0}}function s(e,t,r,a,s){for(var l=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,c=[],d=o(s),f=r>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),p=t.line;p!=f;p+=r){var h=e.getLine(p);if(h){var m=r>0?0:h.length-1,g=r>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(r<0?1:0));m!=g;m+=r){var v=h.charAt(m);if(d.test(v)&&(void 0===a||(e.getTokenTypeAt(n(p,m+1))||"")==(a||""))){var y=i[v];if(y&&">"==y.charAt(1)==r>0)c.push(v);else{if(!c.length)return{pos:n(p,m),ch:v};c.pop()}}}}}return p-r!=(r>0?e.lastLine():e.firstLine())&&null}function l(e,i,o){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,l=o&&o.highlightNonMatching,u=[],c=e.listSelections(),d=0;da((e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatWhile(n.i),lexRules:n.L,parseRules:n.P,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}),"name",{value:"graphqlModeFactory",configurable:!0}))();e.C.defineMode("graphql",s)})?r.apply(t,i):r)||(e.exports=o)},1430:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(6592),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";e.C.defineMode("graphql-results",(e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatSpace(),lexRules:a,parseRules:s,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const a={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},s={Document:[(0,n.p)("{"),(0,n.l)("Entry",(0,n.p)(",")),(0,n.p)("}")],Entry:[(0,n.t)("String","def"),(0,n.p)(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,n.t)("Number","number")],StringValue:[(0,n.t)("String","string")],BooleanValue:[(0,n.t)("Keyword","builtin")],NullValue:[(0,n.t)("Keyword","keyword")],ListValue:[(0,n.p)("["),(0,n.l)("Value",(0,n.p)(",")),(0,n.p)("]")],ObjectValue:[(0,n.p)("{"),(0,n.l)("ObjectField",(0,n.p)(",")),(0,n.p)("}")],ObjectField:[(0,n.t)("String","property"),(0,n.p)(":"),"Value"]}})?r.apply(t,i):r)||(e.exports=o)},3340:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(6592),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty;e.C.defineMode("graphql-variables",(e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatSpace(),lexRules:s,parseRules:l,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},l={Document:[(0,n.p)("{"),(0,n.l)("Variable",(0,n.b)((0,n.p)(","))),(0,n.p)("}")],Variable:[u("variable"),(0,n.p)(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,n.t)("Number","number")],StringValue:[(0,n.t)("String","string")],BooleanValue:[(0,n.t)("Keyword","builtin")],NullValue:[(0,n.t)("Keyword","keyword")],ListValue:[(0,n.p)("["),(0,n.l)("Value",(0,n.b)((0,n.p)(","))),(0,n.p)("]")],ObjectValue:[(0,n.p)("{"),(0,n.l)("ObjectField",(0,n.b)((0,n.p)(","))),(0,n.p)("}")],ObjectField:[u("attribute"),(0,n.p)(":"),"Value"]};function u(e){return{style:e,match:e=>"String"===e.kind,update(e,t){e.name=t.value.slice(1,-1)}}}a(u,"name",{value:"namedKey",configurable:!0})})?r.apply(t,i):r)||(e.exports=o)},9509:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(9407),n(8058)],r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function a(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}o(a,"_mergeNamespaces");var s={exports:{}};!function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function a(e,t,n){return e.getSearchCursor(t,n,{caseFold:i(t),multiline:!0})}function s(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){m(e)},onKeyDown:i,bottom:e.options.search.bottom})}function l(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function u(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function c(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function d(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,n,r){n.queryText=r,n.query=d(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function p(t,n,i,a){var u=r(t);if(u.query)return h(t,n);var c=t.getSelection()||u.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),i&&t.openDialog){var d=null,p=o((function(n,r){e.e_stop(r),n&&(n!=u.queryText&&(f(t,u,n),u.posFrom=u.posTo=t.getCursor()),d&&(d.style.opacity=1),h(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((d=r).style.opacity=.4)})))}),"searchNext");s(t,v(t),c,p,(function(n,i){var o=e.keyName(n),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(n),f(t,r(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(n),p(i,n))})),a&&c&&(f(t,u,c),h(t,n))}else l(t,v(t),"Search for:",c,(function(e){e&&!u.query&&t.operation((function(){f(t,u,e),u.posFrom=u.posTo=t.getCursor(),h(t,n)}))}))}function h(t,n,i){t.operation((function(){var o=r(t),s=a(t,o.query,n?o.posFrom:o.posTo);(s.find(n)||(s=a(t,o.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),o.posFrom=s.from(),o.posTo=s.to(),i&&i(s.from(),s.to()))}))}function m(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function g(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;in(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){var t,n,i=e.Pos;function o(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function a(e,t){for(var n=o(e),r=n,i=0;ic);d++){var f=e.getLine(u++);r=null==r?f:r+"\n"+f}o*=2,t.lastIndex=n.ch;var p=t.exec(r);if(p){var h=r.slice(0,p.index).split("\n"),m=p[0].split("\n"),g=n.line+h.length-1,v=h[h.length-1].length;return{from:i(g,v),to:i(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:p}}}}function c(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function d(e,t,n){t=a(t,"g");for(var r=n.line,o=n.ch,s=e.firstLine();r>=s;r--,o=-1){var l=e.getLine(r),u=c(l,t,o<0?0:l.length-o);if(u)return{from:i(r,u.index),to:i(r,u.index+u[0].length),match:u}}}function f(e,t,n){if(!s(t))return d(e,t,n);t=a(t,"gm");for(var r,o=1,l=e.getLine(n.line).length-n.ch,u=n.line,f=e.firstLine();u>=f;){for(var p=0;p=f;p++){var h=e.getLine(u--);r=null==r?h:h+"\n"+r}o*=2;var m=c(r,t,l);if(m){var g=r.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=u+g.length,b=g[g.length-1].length;return{from:i(y,b),to:i(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function p(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function h(e,r,o,a){if(!r.length)return null;var s=a?t:n,l=s(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var f=e.getLine(u).slice(c),h=s(f);if(1==l.length){var m=h.indexOf(l[0]);if(-1==m)continue e;return o=p(f,h,m,s)+c,{from:i(u,p(f,h,m,s)+c),to:i(u,p(f,h,m+l[0].length,s)+c)}}var g=h.length-l[0].length;if(h.slice(g)==l[0]){for(var v=1;v=d;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var h=s(f);if(1==l.length){var m=h.lastIndexOf(l[0]);if(-1==m)continue e;return{from:i(u,p(f,h,m,s)),to:i(u,p(f,h,m+l[0].length,s))}}var g=l[l.length-1];if(h.slice(0,g.length)==g){var v=1;for(o=u-l.length+1;v(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var r=this.matches(t,n);if(this.afterEmptyMatch=r&&0==e.cmpPos(r.from,r.to),r)return this.pos=r,this.atOccurrence=!0,this.pos.match||!0;var o=i(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new g(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new g(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.s=a})?r.apply(t,i):r)||(e.exports=o)},6980:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t="CodeMirror-hint",n="CodeMirror-hint-active";function i(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=s(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var r=0;rf.clientHeight+1;if(setTimeout((function(){D=a.getScrollInfo()})),L.bottom-I>0){var M=L.bottom-L.top;if(E.top-(E.bottom-L.top)-M>0)f.style.top=(w=E.top-M-x)+"px",C=!1;else if(M>I){f.style.height=I-5+"px",f.style.top=(w=E.bottom-L.top-x)+"px";var R=a.getCursor();i.from.ch!=R.ch&&(E=a.cursorCoords(R),f.style.left=(T=E.left-S)+"px",L=f.getBoundingClientRect())}}var F,P=L.right-O;if(A&&(P+=a.display.nativeBarWidth),P>0&&(L.right-L.left>O&&(f.style.width=O-5+"px",P-=L.right-L.left-O),f.style.left=(T=E.left-P-S)+"px"),A)for(var j=f.firstChild;j;j=j.nextSibling)j.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=u(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){F=setTimeout((function(){r.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(F)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();D||(D=a.getScrollInfo());var n=w+D.top-e.top,i=n-(d.pageYOffset||(s.documentElement||s.body).scrollTop);if(C||(i+=f.offsetHeight),i<=t.top||i>=t.bottom)return r.close();f.style.top=n+"px",f.style.left=T+D.left-e.left+"px"}),e.on(f,"dblclick",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(f,"click",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())})),e.on(f,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var V=this.getSelectedHintRange();return 0===V.from&&0===V.to||this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],f.childNodes[this.selectedHint]),!0}function f(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):a(r+1)}))}r(a,"run"),a(0)}),"resolved");return a.async=!0,a.supportsSelection=!0,a}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],i=this;this.cm.operation((function(){r.hint?r.hint(i.cm,t,r):i.cm.replaceRange(l(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(a(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},r(f,"applicableHelpers"),r(p,"fetchHints"),r(h,"resolveAutoHints"),e.registerHelper("hint","auto",{resolve:h}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.s=a})?r.apply(t,i):r)||(e.exports=o)},2568:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(9407),n(9171)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function a(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}o(a,"_mergeNamespaces");var s={exports:{}};!function(e){var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,u=l,c=i<0?0:o.length,d=0;u!=c;u+=i,d++){var f=o.charAt(i<0?u-1:u),p="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==p&&f.toUpperCase()==f&&(p="W"),"start"==s)"o"!=p?(s="in",a=p):l=u+i;else if("in"==s&&a!=p){if("w"==a&&"W"==p&&i<0&&u--,"W"==a&&"w"==p&&i>0){if(u==l+1){a="w";continue}u--}break}}return n(r.line,u)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function a(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;a--){var u=r[i[a]];if(!(l&&e.cmpPos(u.head,l)>0)){var c=s(t,u.head);l=c.from,t.replaceRange(n(c.word),c.from,c.to)}}}))}function m(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=s(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function g(e,t){var r=m(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}o(d,"selectBetweenBrackets"),t.selectScope=function(e){d(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!d(t))return e.Pass},o(f,"puncType"),t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,f(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,f(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(u,c):i.length&&(i[i.length-1]=c),o=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,u=s.from().line;0!=s.to().ch||s.empty()||l--,l=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),u=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var c=new n(a.line,e.findColumn(s,l-i,i));c.ch!=a.ch&&(u=c)}t.replaceRange("",u,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){h(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){h(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},o(m,"getTarget"),o(g,"findAndGoTo"),t.findUnder=function(e){g(e,!0)},t.findUnderPrevious=function(e){g(e,!1)},t.findAllUnder=function(e){var t=m(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var v=e.keyMap;v.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(v.macSublime),v.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(v.pcSublime);var y=v.default==v.macDefault;v.sublime=y?v.macSublime:v.pcSublime}(t.a.exports,n.a.exports,r.a.exports);var l=a({__proto__:null,default:s.exports},[s.exports]);e.s=l})?r.apply(t,i):r)||(e.exports=o)},3691:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e&&"subscribe"in e&&"function"==typeof e.subscribe}function n(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}Object.defineProperty(e,"__esModule",{value:!0}),e.fetcherReturnToPromise=function(e){return Promise.resolve(e).then((e=>{return n(e)?(i=e,new Promise(((e,t)=>{var n;const r=null===(n=("return"in i?i:i[Symbol.asyncIterator]()).return)||void 0===n?void 0:n.bind(i);("next"in i?i:i[Symbol.asyncIterator]()).next.bind(i)().then((t=>{e(t.value),null==r||r()})).catch((e=>{t(e)}))}))):t(e)?(r=e,new Promise(((e,t)=>{const n=r.subscribe({next:t=>{e(t),n.unsubscribe()},error:t,complete:()=>{t(new Error("no value resolved"))}})}))):e;var r,i}))},e.isAsyncIterable=n,e.isObservable=t,e.isPromise=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.then}})?n.apply(t,[t]):n)||(e.exports=r)},5454:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(2501)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createGraphiQLFetcher=function(e){let n;if("undefined"!=typeof window&&window.fetch&&(n=window.fetch),null!==(null==e?void 0:e.enableIncrementalDelivery)&&!1===e.enableIncrementalDelivery||(e.enableIncrementalDelivery=!0),e.fetch&&(n=e.fetch),!n)throw new Error("No valid fetcher implementation available");const r=(0,t.createSimpleFetcher)(e,n),i=e.enableIncrementalDelivery?(0,t.createMultipartFetcher)(e,n):r;return(n,o)=>{if("IntrospectionQuery"===n.operationName)return(e.schemaFetcher||r)(n,o);if((null==o?void 0:o.documentAST)&&(0,t.isSubscriptionWithName)(o.documentAST,n.operationName||void 0)){const r=(0,t.getWsFetcher)(e,o);if(!r)throw new Error("Your GraphiQL createFetcher is not properly configured for websocket subscriptions yet. "+(e.subscriptionUrl?`Provided URL ${e.subscriptionUrl} failed`:"Please provide subscriptionUrl, wsClient or legacyClient option first."));return r(n)}return i(n,o)}}})?r.apply(t,i):r)||(e.exports=o)},1799:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3080),n(5454)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={createGraphiQLFetcher:!0};Object.defineProperty(e,"createGraphiQLFetcher",{enumerable:!0,get:function(){return n.createGraphiQLFetcher}}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(Object.prototype.hasOwnProperty.call(r,n)||n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))}))})?r.apply(t,i):r)||(e.exports=o)},2501:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573),n(8488),n(8042)],r=function(e,t,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSubscriptionWithName=e.getWsFetcher=e.createWebsocketsFetcherFromUrl=e.createWebsocketsFetcherFromClient=e.createSimpleFetcher=e.createMultipartFetcher=e.createLegacyWebsocketsFetcher=void 0;var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=function(e){return this instanceof a?(this.v=e,this):new a(e)},s=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}},l=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=i[e](t)).value instanceof a?Promise.resolve(n.value.v).then(u,c):d(o[0][2],n)}catch(e){d(o[0][3],e)}var n}function u(e){l("next",e)}function c(e){l("throw",e)}function d(e,t){e(t),o.shift(),o.length&&l(o[0][0],o[0][1])}};e.isSubscriptionWithName=(e,n)=>{let r=!1;return(0,t.visit)(e,{OperationDefinition(e){var t;n===(null===(t=e.name)||void 0===t?void 0:t.value)&&"subscription"===e.operation&&(r=!0)}}),r};e.createSimpleFetcher=(e,t)=>(n,r)=>o(void 0,void 0,void 0,(function*(){return(yield t(e.url,{method:"POST",body:JSON.stringify(n),headers:Object.assign(Object.assign({"content-type":"application/json"},e.headers),null==r?void 0:r.headers)})).json()}));const u=(e,t)=>{let r;try{const{createClient:i}=n(7674);return r=i({url:e,connectionParams:t}),c(r)}catch(t){if((e=>"object"==typeof e&&null!==e&&"code"in e)(t)&&"MODULE_NOT_FOUND"===t.code)throw new Error("You need to install the 'graphql-ws' package to use websockets when passing a 'subscriptionUrl'");console.error(`Error creating websocket client for ${e}`,t)}};e.createWebsocketsFetcherFromUrl=u;const c=e=>t=>(0,i.makeAsyncIterableIteratorFromSink)((n=>e.subscribe(t,Object.assign(Object.assign({},n),{error:e=>{e instanceof CloseEvent?n.error(new Error(`Socket closed with event ${e.code} ${e.reason||""}`.trim())):n.error(e)}}))));e.createWebsocketsFetcherFromClient=c;const d=e=>t=>{const n=e.request(t);return(0,i.makeAsyncIterableIteratorFromSink)((e=>n.subscribe(e).unsubscribe))};e.createLegacyWebsocketsFetcher=d;e.createMultipartFetcher=(e,t)=>function(n,o){return l(this,arguments,(function*(){var l,u;const c=yield a(t(e.url,{method:"POST",body:JSON.stringify(n),headers:Object.assign(Object.assign({"content-type":"application/json",accept:"application/json, multipart/mixed"},e.headers),null==o?void 0:o.headers)}).then((e=>(0,r.meros)(e,{multiple:!0}))));if(!(0,i.isAsyncIterable)(c))return yield a(yield yield a(c.json()));try{for(var d,f=s(c);!(d=yield a(f.next())).done;){const e=d.value;if(e.some((e=>!e.json))){const t=e.map((e=>`Headers::\n${e.headers}\n\nBody::\n${e.body}`));throw new Error(`Expected multipart chunks to be of json type. got:\n${t}`)}yield yield a(e.map((e=>e.body)))}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=f.return)&&(yield a(u.call(f)))}finally{if(l)throw l.error}}}))};e.getWsFetcher=(e,t)=>{if(e.wsClient)return c(e.wsClient);if(e.subscriptionUrl)return u(e.subscriptionUrl,Object.assign(Object.assign({},e.wsConnectionParams),null==t?void 0:t.headers));const n=e.legacyClient||e.legacyWsClient;return n?d(n):void 0}},void 0===(o=r.apply(t,i))||(e.exports=o)},3080:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})})?n.apply(t,[t]):n)||(e.exports=r)},4574:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";function t(e){return JSON.stringify(e,null,2)}function n(e){return e instanceof Error?function(e){return Object.assign(Object.assign({},e),{message:e.message,stack:e.stack})}(e):e}Object.defineProperty(e,"__esModule",{value:!0}),e.formatError=function(e){return Array.isArray(e)?t({errors:e.map((e=>n(e)))}):t({errors:[n(e)]})},e.formatResult=function(e){return t(e)}})?n.apply(t,[t]):n)||(e.exports=r)},3738:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573)],void 0===(o="function"==typeof(r=function(e,t){"use strict";function n(e){if(!("getFields"in e))return[];const n=e.getFields();if(n.id)return["id"];if(n.edges)return["edges"];if(n.node)return["node"];const r=[];return Object.keys(n).forEach((e=>{(0,t.isLeafType)(n[e].type)&&r.push(e)})),r}function r(e,n){const i=(0,t.getNamedType)(e);if(!e||(0,t.isLeafType)(e))return;const o=n(i);return Array.isArray(o)&&0!==o.length&&"getFields"in i?{kind:t.Kind.SELECTION_SET,selections:o.map((e=>{const o=i.getFields()[e],a=o?o.type:null;return{kind:t.Kind.FIELD,name:{kind:t.Kind.NAME,value:e},selectionSet:r(a,n)}}))}:void 0}function i(e,t){if(0===t.length)return e;let n="",r=0;return t.forEach((t=>{let{index:i,string:o}=t;n+=e.slice(r,i)+o,r=i})),n+=e.slice(r),n}Object.defineProperty(e,"__esModule",{value:!0}),e.fillLeafs=function(e,o,a){const s=[];if(!e||!o)return{insertions:s,result:o};let l;try{l=(0,t.parse)(o)}catch(e){return{insertions:s,result:o}}const u=a||n,c=new t.TypeInfo(e);return(0,t.visit)(l,{leave(e){c.leave(e)},enter(e){if(c.enter(e),"Field"===e.kind&&!e.selectionSet){const n=r(function(e){if(e)return e}(c.getType()),u);if(n&&e.loc){const r=function(e,t){let n=t,r=t;for(;n;){const t=e.charCodeAt(n-1);if(10===t||13===t||8232===t||8233===t)break;n--,9!==t&&11!==t&&12!==t&&32!==t&&160!==t&&(r=n)}return e.slice(n,r)}(o,e.loc.start);s.push({index:e.loc.end,string:" "+(0,t.print)(n).replaceAll("\n","\n"+r)})}}}}),{insertions:s,result:i(o,s)}}})?r.apply(t,i):r)||(e.exports=o)},7293:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3738),n(5682),n(1312)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))})),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}))})?r.apply(t,i):r)||(e.exports=o)},5682:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573)],void 0===(o="function"==typeof(r=function(e,t){"use strict";function n(e,r,i){var o;const a=i?(0,t.getNamedType)(i).name:null,s=[],l=[];for(let u of r){if("FragmentSpread"===u.kind){const n=u.name.value;if(!u.directives||0===u.directives.length){if(l.includes(n))continue;l.push(n)}const r=e[u.name.value];if(r){const{typeCondition:e,directives:n,selectionSet:i}=r;u={kind:t.Kind.INLINE_FRAGMENT,typeCondition:e,directives:n,selectionSet:i}}}if(u.kind===t.Kind.INLINE_FRAGMENT&&(!u.directives||0===(null===(o=u.directives)||void 0===o?void 0:o.length))){const t=u.typeCondition?u.typeCondition.name.value:null;if(!t||t===a){s.push(...n(e,u.selectionSet.selections,i));continue}}s.push(u)}return s}Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAst=function(e,r){const i=r?new t.TypeInfo(r):null,o=Object.create(null);for(const n of e.definitions)n.kind===t.Kind.FRAGMENT_DEFINITION&&(o[n.name.value]=n);const a={SelectionSet(e){const t=i?i.getParentType():null;let{selections:r}=e;return r=n(o,r,t),r=function(e,t){var n;const r=new Map,i=[];for(const o of e)if("Field"===o.kind){const e=t(o),a=r.get(e);if(null===(n=o.directives)||void 0===n?void 0:n.length){const e=Object.assign({},o);i.push(e)}else if((null==a?void 0:a.selectionSet)&&o.selectionSet)a.selectionSet.selections=[...a.selectionSet.selections,...o.selectionSet.selections];else if(!a){const t=Object.assign({},o);r.set(e,t),i.push(t)}}else i.push(o);return i}(r,(e=>e.alias?e.alias.value:e.name.value)),Object.assign(Object.assign({},e),{selections:r})},FragmentDefinition(){return null}};return(0,t.visit)(e,i?(0,t.visitWithTypeInfo)(i,a):a)}})?r.apply(t,i):r)||(e.exports=o)},1312:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSelectedOperationName=function(e,t,n){if(!n||n.length<1)return;const r=n.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value}));if(t&&r.includes(t))return t;if(t&&e){const n=e.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value})).indexOf(t);if(-1!==n&&n{for(const e in window.localStorage)0===e.indexOf(`${t}:`)&&window.localStorage.removeItem(e)}}}get(e){if(!this.storage)return null;const n=`${t}:${e}`,r=this.storage.getItem(n);return"null"===r||"undefined"===r?(this.storage.removeItem(n),null):r||null}set(e,n){let r=!1,i=null;if(this.storage){const o=`${t}:${e}`;if(n)try{this.storage.setItem(o,n)}catch(e){i=e instanceof Error?e:new Error(`${e}`),r=function(e,t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==e.length}(this.storage,e)}else this.storage.removeItem(o)}return{isQuotaError:r,error:i}}clear(){this.storage&&this.storage.clear()}};const t="graphiql"})?n.apply(t,[t]):n)||(e.exports=r)},1925:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573),n(6837)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryStore=void 0;e.HistoryStore=class{constructor(e,t){this.storage=e,this.maxHistoryLength=t,this.updateHistory=(e,t,n,r)=>{if(this.shouldSaveQuery(e,t,n,this.history.fetchRecent())){this.history.push({query:e,variables:t,headers:n,operationName:r});const i=this.history.items,o=this.favorite.items;this.queries=i.concat(o)}},this.history=new n.QueryStore("queries",this.storage,this.maxHistoryLength),this.favorite=new n.QueryStore("favorites",this.storage,null),this.queries=[...this.history.fetchAll(),...this.favorite.fetchAll()]}shouldSaveQuery(e,n,r,i){if(!e)return!1;try{(0,t.parse)(e)}catch(e){return!1}if(e.length>1e5)return!1;if(!i)return!0;if(JSON.stringify(e)===JSON.stringify(i.query)){if(JSON.stringify(n)===JSON.stringify(i.variables)){if(JSON.stringify(r)===JSON.stringify(i.headers))return!1;if(r&&!i.headers)return!1}if(n&&!i.variables)return!1}return!0}toggleFavorite(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};this.favorite.contains(a)?o&&(a.favorite=!1,this.favorite.delete(a)):(a.favorite=!0,this.favorite.push(a)),this.queries=[...this.history.items,...this.favorite.items]}editLabel(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};o?this.favorite.edit(Object.assign(Object.assign({},a),{favorite:o})):this.history.edit(a),this.queries=[...this.history.items,...this.favorite.items]}}})?r.apply(t,i):r)||(e.exports=o)},920:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(1180),n(1925),n(6837)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))})),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}))})?r.apply(t,i):r)||(e.exports=o)},6837:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryStore=void 0;e.QueryStore=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}get length(){return this.items.length}contains(e){return this.items.some((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName))}edit(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1,e),this.save())}delete(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1),this.save())}fetchRecent(){return this.items.at(-1)}fetchAll(){const e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]}push(e){const t=[...this.items,e];this.maxSize&&t.length>this.maxSize&&t.shift();for(let e=0;e<5;e++){const e=this.storage.set(this.key,JSON.stringify({[this.key]:t}));if(null==e?void 0:e.error){if(!e.isQuotaError||!this.maxSize)return;t.shift()}else this.items=t}}save(){this.storage.set(this.key,JSON.stringify({[this.key]:this.items}))}}},void 0===(r=n.apply(t,[t]))||(e.exports=r)},6676:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(7139),n(7644),n(3573),n(8506),n(5251),n(2162),n(5605),n(6785)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a,s,l){"use strict";function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,t=c(t),r=c(r),i.GraphiQL.createFetcher=n.createGraphiQLFetcher,i.GraphiQL.GraphQL=r,i.GraphiQL.React=t;var d=i.GraphiQL;e.default=d})?r.apply(t,i):r)||(e.exports=o)},8506:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(9196),n(7139)],r=function(e,t,n){"use strict";function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"first"===e&&(null==p||p.setVisiblePlugin(null))},sizeThresholdSecond:200,storageKey:"docExplorerFlex"}),T=(0,n.useDragResize)({direction:"horizontal",storageKey:"editorFlex"}),w=(0,n.useDragResize)({defaultSizeRelation:3,direction:"vertical",initiallyHidden:(()=>{if("variables"!==e.defaultEditorToolsVisibility&&"headers"!==e.defaultEditorToolsVisibility)return"boolean"==typeof e.defaultEditorToolsVisibility?e.defaultEditorToolsVisibility?void 0:"second":l.initialVariables||l.initialHeaders?void 0:"second"})(),sizeThresholdSecond:60,storageKey:"secondaryEditorFlex"}),[C,S]=(0,t.useState)((()=>"variables"===e.defaultEditorToolsVisibility||"headers"===e.defaultEditorToolsVisibility?e.defaultEditorToolsVisibility:!l.initialVariables&&l.initialHeaders&&s?"headers":"variables")),[x,N]=(0,t.useState)(null),[k,_]=(0,t.useState)(null),O=t.default.Children.toArray(e.children),I=O.find((e=>c(e,o.Logo)))||t.default.createElement(o.Logo,null),D=O.find((e=>c(e,o.Toolbar)))||t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ToolbarButton,{onClick:()=>g(),label:"Prettify query (Shift-Ctrl-P)"},t.default.createElement(n.PrettifyIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),t.default.createElement(n.ToolbarButton,{onClick:()=>m(),label:"Merge fragments into query (Shift-Ctrl-M)"},t.default.createElement(n.MergeIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),t.default.createElement(n.ToolbarButton,{onClick:()=>h(),label:"Copy query (Shift-Ctrl-C)"},t.default.createElement(n.CopyIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),(null===(a=e.toolbar)||void 0===a?void 0:a.additionalContent)||null),L=O.find((e=>c(e,o.Footer))),A=()=>{"first"===E.hiddenElement&&E.setHiddenElement(null)},M=0===window.navigator.platform.toLowerCase().indexOf("mac")?t.default.createElement("code",{className:"graphiql-key"},"Cmd"):t.default.createElement("code",{className:"graphiql-key"},"Ctrl");return t.default.createElement("div",{"data-testid":"graphiql-container",className:"graphiql-container"},t.default.createElement("div",{className:"graphiql-sidebar"},t.default.createElement("div",{className:"graphiql-sidebar-section"},null==p?void 0:p.plugins.map((e=>{const r=e===p.visiblePlugin,i=`${r?"Hide":"Show"} ${e.title}`,o=e.icon;return t.default.createElement(n.Tooltip,{key:e.title,label:i},t.default.createElement(n.UnStyledButton,{type:"button",className:r?"active":"",onClick:()=>{r?(p.setVisiblePlugin(null),E.setHiddenElement("first")):(p.setVisiblePlugin(e),E.setHiddenElement(null))},"aria-label":i},t.default.createElement(o,{"aria-hidden":"true"})))}))),t.default.createElement("div",{className:"graphiql-sidebar-section"},t.default.createElement(n.Tooltip,{label:"Re-fetch GraphQL schema"},t.default.createElement(n.UnStyledButton,{type:"button",disabled:d.isFetching,onClick:()=>d.introspect(),"aria-label":"Re-fetch GraphQL schema"},t.default.createElement(n.ReloadIcon,{className:d.isFetching?"graphiql-spin":"","aria-hidden":"true"}))),t.default.createElement(n.Tooltip,{label:"Open short keys dialog"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>N("short-keys"),"aria-label":"Open short keys dialog"},t.default.createElement(n.KeyboardShortcutIcon,{"aria-hidden":"true"}))),t.default.createElement(n.Tooltip,{label:"Open settings dialog"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>N("settings"),"aria-label":"Open settings dialog"},t.default.createElement(n.SettingsIcon,{"aria-hidden":"true"}))))),t.default.createElement("div",{className:"graphiql-main"},t.default.createElement("div",{ref:E.firstRef,style:{minWidth:"200px"}},t.default.createElement("div",{className:"graphiql-plugin"},b?t.default.createElement(b,null):null)),t.default.createElement("div",{ref:E.dragBarRef},null!=p&&p.visiblePlugin?t.default.createElement("div",{className:"graphiql-horizontal-drag-bar"}):null),t.default.createElement("div",{ref:E.secondRef,style:{minWidth:0}},t.default.createElement("div",{className:"graphiql-sessions"},t.default.createElement("div",{className:"graphiql-session-header"},t.default.createElement(n.Tabs,{"aria-label":"Select active operation"},l.tabs.length>1?t.default.createElement(t.default.Fragment,null,l.tabs.map(((e,r)=>t.default.createElement(n.Tab,{key:e.id,isActive:r===l.activeTabIndex},t.default.createElement(n.Tab.Button,{"aria-controls":"graphiql-session",id:`graphiql-session-tab-${r}`,onClick:()=>{u.stop(),l.changeTab(r)}},e.title),t.default.createElement(n.Tab.Close,{onClick:()=>{l.activeTabIndex===r&&u.stop(),l.closeTab(r)}})))),t.default.createElement("div",null,t.default.createElement(n.Tooltip,{label:"Add tab"},t.default.createElement(n.UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:()=>l.addTab(),"aria-label":"Add tab"},t.default.createElement(n.PlusIcon,{"aria-hidden":"true"}))))):null),t.default.createElement("div",{className:"graphiql-session-header-right"},1===l.tabs.length?t.default.createElement("div",{className:"graphiql-add-tab-wrapper"},t.default.createElement(n.Tooltip,{label:"Add tab"},t.default.createElement(n.UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:()=>l.addTab(),"aria-label":"Add tab"},t.default.createElement(n.PlusIcon,{"aria-hidden":"true"})))):null,I)),t.default.createElement("div",{role:"tabpanel",id:"graphiql-session",className:"graphiql-session","aria-labelledby":`graphiql-session-tab-${l.activeTabIndex}`},t.default.createElement("div",{ref:T.firstRef},t.default.createElement("div",{className:"graphiql-editors"+(1===l.tabs.length?" full-height":"")},t.default.createElement("div",{ref:w.firstRef},t.default.createElement("section",{className:"graphiql-query-editor","aria-label":"Query Editor"},t.default.createElement("div",{className:"graphiql-query-editor-wrapper"},t.default.createElement(n.QueryEditor,{editorTheme:e.editorTheme,keyMap:e.keyMap,onClickReference:A,onCopyQuery:e.onCopyQuery,onEdit:e.onEditQuery,readOnly:e.readOnly})),t.default.createElement("div",{className:"graphiql-toolbar",role:"toolbar","aria-label":"Editor Commands"},t.default.createElement(n.ExecuteButton,null),D))),t.default.createElement("div",{ref:w.dragBarRef},t.default.createElement("div",{className:"graphiql-editor-tools"},t.default.createElement("div",{className:"graphiql-editor-tools-tabs"},t.default.createElement(n.UnStyledButton,{type:"button",className:"variables"===C&&"second"!==w.hiddenElement?"active":"",onClick:()=>{"second"===w.hiddenElement&&w.setHiddenElement(null),S("variables")}},"Variables"),s?t.default.createElement(n.UnStyledButton,{type:"button",className:"headers"===C&&"second"!==w.hiddenElement?"active":"",onClick:()=>{"second"===w.hiddenElement&&w.setHiddenElement(null),S("headers")}},"Headers"):null),t.default.createElement(n.Tooltip,{label:"second"===w.hiddenElement?"Show editor tools":"Hide editor tools"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>{w.setHiddenElement("second"===w.hiddenElement?null:"second")},"aria-label":"second"===w.hiddenElement?"Show editor tools":"Hide editor tools"},"second"===w.hiddenElement?t.default.createElement(n.ChevronUpIcon,{className:"graphiql-chevron-icon","aria-hidden":"true"}):t.default.createElement(n.ChevronDownIcon,{className:"graphiql-chevron-icon","aria-hidden":"true"}))))),t.default.createElement("div",{ref:w.secondRef},t.default.createElement("section",{className:"graphiql-editor-tool","aria-label":"variables"===C?"Variables":"Headers"},t.default.createElement(n.VariableEditor,{editorTheme:e.editorTheme,isHidden:"variables"!==C,keyMap:e.keyMap,onEdit:e.onEditVariables,onClickReference:A,readOnly:e.readOnly}),s&&t.default.createElement(n.HeaderEditor,{editorTheme:e.editorTheme,isHidden:"headers"!==C,keyMap:e.keyMap,onEdit:e.onEditHeaders,readOnly:e.readOnly}))))),t.default.createElement("div",{ref:T.dragBarRef},t.default.createElement("div",{className:"graphiql-horizontal-drag-bar"})),t.default.createElement("div",{ref:T.secondRef},t.default.createElement("div",{className:"graphiql-response"},u.isFetching?t.default.createElement(n.Spinner,null):null,t.default.createElement(n.ResponseEditor,{editorTheme:e.editorTheme,responseTooltip:e.responseTooltip,keyMap:e.keyMap}),L)))))),t.default.createElement(n.Dialog,{isOpen:"short-keys"===x,onDismiss:()=>N(null)},t.default.createElement("div",{className:"graphiql-dialog-header"},t.default.createElement("div",{className:"graphiql-dialog-title"},"Short Keys"),t.default.createElement(n.Dialog.Close,{onClick:()=>N(null)})),t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("table",{className:"graphiql-table"},t.default.createElement("thead",null,t.default.createElement("tr",null,t.default.createElement("th",null,"Short key"),t.default.createElement("th",null,"Function"))),t.default.createElement("tbody",null,t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"F")),t.default.createElement("td",null,"Search in editor")),t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"K")),t.default.createElement("td",null,"Search in documentation")),t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"Enter")),t.default.createElement("td",null,"Execute query")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"P")),t.default.createElement("td",null,"Prettify editors")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"M")),t.default.createElement("td",null,"Merge fragments definitions into operation definition")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"C")),t.default.createElement("td",null,"Copy query")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"R")),t.default.createElement("td",null,"Re-fetch schema using introspection")))),t.default.createElement("p",null,"The editors use"," ",t.default.createElement("a",{href:"https://codemirror.net/5/doc/manual.html#keymaps",target:"_blank",rel:"noopener noreferrer"},"CodeMirror Key Maps")," ","that add more short keys. This instance of Graph",t.default.createElement("em",null,"i"),"QL uses"," ",t.default.createElement("code",null,e.keyMap||"sublime"),".")))),t.default.createElement(n.Dialog,{isOpen:"settings"===x,onDismiss:()=>{N(null),_(null)}},t.default.createElement("div",{className:"graphiql-dialog-header"},t.default.createElement("div",{className:"graphiql-dialog-title"},"Settings"),t.default.createElement(n.Dialog.Close,{onClick:()=>{N(null),_(null)}})),e.showPersistHeadersSettings?t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Persist headers"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Save headers upon reloading."," ",t.default.createElement("span",{className:"graphiql-warning-text"},"Only enable if you trust this device."))),t.default.createElement(n.ButtonGroup,null,t.default.createElement(n.Button,{type:"button",id:"enable-persist-headers",className:l.shouldPersistHeaders?"active":void 0,onClick:()=>{l.setShouldPersistHeaders(!0)}},"On"),t.default.createElement(n.Button,{type:"button",id:"disable-persist-headers",className:l.shouldPersistHeaders?void 0:"active",onClick:()=>{l.setShouldPersistHeaders(!1)}},"Off"))):null,t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Theme"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Adjust how the interface looks like.")),t.default.createElement("div",null,t.default.createElement(n.ButtonGroup,null,t.default.createElement(n.Button,{type:"button",className:null===v?"active":"",onClick:()=>y(null)},"System"),t.default.createElement(n.Button,{type:"button",className:"light"===v?"active":"",onClick:()=>y("light")},"Light"),t.default.createElement(n.Button,{type:"button",className:"dark"===v?"active":"",onClick:()=>y("dark")},"Dark")))),f?t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Clear storage"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Remove all locally stored data and start fresh.")),t.default.createElement("div",null,t.default.createElement(n.Button,{type:"button",state:k||void 0,disabled:"success"===k,onClick:()=>{try{null==f||f.clear(),_("success")}catch{_("error")}}},"success"===k?"Cleared data":"error"===k?"Failed":"Clear data"))):null))}function s(e){return t.default.createElement("div",{className:"graphiql-logo"},e.children||t.default.createElement("a",{className:"graphiql-logo-link",href:"https://github.com/graphql/graphiql",target:"_blank",rel:"noreferrer"},"Graph",t.default.createElement("em",null,"i"),"QL"))}function l(e){return t.default.createElement(t.default.Fragment,null,e.children)}function u(e){return t.default.createElement("div",{className:"graphiql-footer"},e.children)}function c(e,t){var n;return!(null==e||null===(n=e.type)||void 0===n||!n.displayName||e.type.displayName!==t.displayName)||e.type===t}o.Logo=s,o.Toolbar=l,o.Footer=u,s.displayName="GraphiQLLogo",l.displayName="GraphiQLToolbar",u.displayName="GraphiQLFooter"},void 0===(o=r.apply(t,i))||(e.exports=o)},5313:function(e,t,n){"use strict";n.r(t),n.d(t,{CloseCode:function(){return r.CloseCode},GRAPHQL_TRANSPORT_WS_PROTOCOL:function(){return r.GRAPHQL_TRANSPORT_WS_PROTOCOL},MessageType:function(){return r.MessageType},createClient:function(){return o},isMessage:function(){return r.isMessage},parseMessage:function(){return r.parseMessage},stringifyMessage:function(){return r.stringifyMessage}});var r=n(863),i=n(6764);function o(e){const{url:t,connectionParams:o,lazy:s=!0,onNonLazyError:l=console.error,lazyCloseTimeout:u=0,keepAlive:c=0,disablePong:d,connectionAckWaitTimeout:f=0,retryAttempts:p=5,retryWait:h=async function(e){let t=1e3;for(let n=0;nsetTimeout(e,t+Math.floor(2700*Math.random()+300))))},isFatalConnectionProblem:m=(e=>!a(e)),on:g,webSocketImpl:v,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},jsonMessageReplacer:b,jsonMessageReviver:E}=e;let T;if(v){if(!("function"==typeof(w=v)&&"constructor"in w&&"CLOSED"in w&&"CLOSING"in w&&"CONNECTING"in w&&"OPEN"in w))throw new Error("Invalid WebSocket implementation provided");T=v}else"undefined"!=typeof WebSocket?T=WebSocket:void 0!==n.g?T=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window&&(T=window.WebSocket||window.MozWebSocket);var w;if(!T)throw new Error("WebSocket implementation missing");const C=T,S=(()=>{const e=(()=>{const e={};return{on(t,n){return e[t]=n,()=>{delete e[t]}},emit(t){var n;"id"in t&&(null===(n=e[t.id])||void 0===n||n.call(e,t))}}})(),t={connecting:(null==g?void 0:g.connecting)?[g.connecting]:[],opened:(null==g?void 0:g.opened)?[g.opened]:[],connected:(null==g?void 0:g.connected)?[g.connected]:[],ping:(null==g?void 0:g.ping)?[g.ping]:[],pong:(null==g?void 0:g.pong)?[g.pong]:[],message:(null==g?void 0:g.message)?[e.emit,g.message]:[e.emit],closed:(null==g?void 0:g.closed)?[g.closed]:[],error:(null==g?void 0:g.error)?[g.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function x(e){const t=[S.on("error",(n=>{t.forEach((e=>e())),e(n)})),S.on("closed",(n=>{t.forEach((e=>e())),e(n)}))]}let N,k=0,_=!1,O=0,I=!1;async function D(){const[e,n]=await(null!=N?N:N=new Promise(((e,n)=>(async()=>{if(_){if(await h(O),!k)return N=void 0,n({code:1e3,reason:"All Subscriptions Gone"});O++}S.emit("connecting");const a=new C("function"==typeof t?await t():t,r.GRAPHQL_TRANSPORT_WS_PROTOCOL);let s,l;function u(){isFinite(c)&&c>0&&(clearTimeout(l),l=setTimeout((()=>{a.readyState===C.OPEN&&(a.send((0,r.stringifyMessage)({type:r.MessageType.Ping})),S.emit("ping",!1,void 0))}),c))}x((e=>{N=void 0,clearTimeout(s),clearTimeout(l),n(e)})),a.onerror=e=>S.emit("error",e),a.onclose=e=>S.emit("closed",e),a.onopen=async()=>{try{S.emit("opened",a);const e="function"==typeof o?await o():o;a.send((0,r.stringifyMessage)(e?{type:r.MessageType.ConnectionInit,payload:e}:{type:r.MessageType.ConnectionInit},b)),isFinite(f)&&f>0&&(s=setTimeout((()=>{a.close(r.CloseCode.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")}),f)),u()}catch(e){S.emit("error",e),a.close(r.CloseCode.InternalClientError,(0,i.qj)(e instanceof Error?e.message:new Error(e).message,"Internal client error"))}};let p=!1;a.onmessage=({data:t})=>{try{const n=(0,r.parseMessage)(t,E);if(S.emit("message",n),"ping"===n.type||"pong"===n.type)return S.emit(n.type,!0,n.payload),void("pong"===n.type?u():d||(a.send((0,r.stringifyMessage)(n.payload?{type:r.MessageType.Pong,payload:n.payload}:{type:r.MessageType.Pong})),S.emit("pong",!1,n.payload)));if(p)return;if(n.type!==r.MessageType.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(s),p=!0,S.emit("connected",a,n.payload),_=!1,O=0,e([a,new Promise(((e,t)=>x(t)))])}catch(e){a.onmessage=null,S.emit("error",e),a.close(r.CloseCode.BadResponse,(0,i.qj)(e instanceof Error?e.message:new Error(e).message,"Bad response"))}}})())));e.readyState===C.CLOSING&&await n;let a=()=>{};const s=new Promise((e=>a=e));return[e,a,Promise.race([s.then((()=>{if(!k){const t=()=>e.close(1e3,"Normal Closure");isFinite(u)&&u>0?setTimeout((()=>{k||e.readyState!==C.OPEN||t()}),u):t()}})),n])]}function L(e){if(a(e)&&(t=e.code,![1e3,1001,1006,1005,1012,1013,1013].includes(t)&&t>=1e3&&t<=1999||[r.CloseCode.InternalServerError,r.CloseCode.InternalClientError,r.CloseCode.BadRequest,r.CloseCode.BadResponse,r.CloseCode.Unauthorized,r.CloseCode.SubprotocolNotAcceptable,r.CloseCode.SubscriberAlreadyExists,r.CloseCode.TooManyInitialisationRequests].includes(e.code)))throw e;var t;if(I)return!1;if(a(e)&&1e3===e.code)return k>0;if(!p||O>=p)throw e;if(m(e))throw e;return _=!0}return s||(async()=>{for(k++;;)try{const[,,e]=await D();await e}catch(e){try{if(!L(e))return}catch(e){return null==l?void 0:l(e)}}})(),{on:S.on,subscribe(e,t){const n=y();let i=!1,o=!1,a=()=>{k--,i=!0};return(async()=>{for(k++;;)try{const[s,l,u]=await D();if(i)return l();const c=S.onMessage(n,(e=>{switch(e.type){case r.MessageType.Next:return void t.next(e.payload);case r.MessageType.Error:return o=!0,i=!0,t.error(e.payload),void a();case r.MessageType.Complete:return i=!0,void a()}}));return s.send((0,r.stringifyMessage)({id:n,type:r.MessageType.Subscribe,payload:e},b)),a=()=>{i||s.readyState!==C.OPEN||s.send((0,r.stringifyMessage)({id:n,type:r.MessageType.Complete},b)),k--,i=!0,l()},void await u.finally(c)}catch(e){if(!L(e))return}})().then((()=>{o||t.complete()})).catch((e=>{t.error(e)})),()=>{i||a()}},async dispose(){if(I=!0,N){const[e]=await N;e.close(1e3,"Normal Closure")}}}}function a(e){return(0,i.Kn)(e)&&"code"in e&&"reason"in e}},863:function(e,t,n){"use strict";n.r(t),n.d(t,{CloseCode:function(){return o},GRAPHQL_TRANSPORT_WS_PROTOCOL:function(){return i},MessageType:function(){return a},isMessage:function(){return s},parseMessage:function(){return l},stringifyMessage:function(){return u}});var r=n(6764);const i="graphql-transport-ws";var o,a;function s(e){if((0,r.Kn)(e)){if(!(0,r.ND)(e,"type"))return!1;switch(e.type){case a.ConnectionInit:case a.ConnectionAck:case a.Ping:case a.Pong:return!(0,r.nr)(e,"payload")||void 0===e.payload||(0,r.Kn)(e.payload);case a.Subscribe:return(0,r.ND)(e,"id")&&(0,r.O2)(e,"payload")&&(!(0,r.nr)(e.payload,"operationName")||void 0===e.payload.operationName||null===e.payload.operationName||"string"==typeof e.payload.operationName)&&(0,r.ND)(e.payload,"query")&&(!(0,r.nr)(e.payload,"variables")||void 0===e.payload.variables||null===e.payload.variables||(0,r.O2)(e.payload,"variables"))&&(!(0,r.nr)(e.payload,"extensions")||void 0===e.payload.extensions||null===e.payload.extensions||(0,r.O2)(e.payload,"extensions"));case a.Next:return(0,r.ND)(e,"id")&&(0,r.O2)(e,"payload");case a.Error:return(0,r.ND)(e,"id")&&(0,r.Ox)(e.payload);case a.Complete:return(0,r.ND)(e,"id");default:return!1}}return!1}function l(e,t){if(s(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const n=JSON.parse(e,t);if(!s(n))throw new Error("Invalid message");return n}function u(e,t){if(!s(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,t)}!function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"}(o||(o={})),function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"}(a||(a={}))},6718:function(e,t,n){"use strict";n.r(t),n.d(t,{makeServer:function(){return f}});var r=n(953),i=n(2780),o=n(9458),a=n(4117),s=n(2941),l=n(7180),u=n(863),c=n(6764),d=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}};function f(e){const{schema:t,context:n,roots:f,validate:p,execute:h,subscribe:m,connectionInitWaitTimeout:g=3e3,onConnect:v,onDisconnect:y,onClose:b,onSubscribe:E,onOperation:T,onNext:w,onError:C,onComplete:S,jsonMessageReviver:x,jsonMessageReplacer:N}=e;return{opened(e,k){const _={connectionInitReceived:!1,acknowledged:!1,subscriptions:{},extra:k};if(e.protocol!==u.GRAPHQL_TRANSPORT_WS_PROTOCOL)return e.close(u.CloseCode.SubprotocolNotAcceptable,"Subprotocol not acceptable"),async(e,t)=>{await(null==b?void 0:b(_,e,t))};const O=g>0&&isFinite(g)?setTimeout((()=>{_.connectionInitReceived||e.close(u.CloseCode.ConnectionInitialisationTimeout,"Connection initialisation timeout")}),g):null;return e.onMessage((async function(g){var y,b,k;let O;try{O=(0,u.parseMessage)(g,x)}catch(t){return e.close(u.CloseCode.BadRequest,"Invalid message received")}switch(O.type){case u.MessageType.ConnectionInit:{if(_.connectionInitReceived)return e.close(u.CloseCode.TooManyInitialisationRequests,"Too many initialisation requests");_.connectionInitReceived=!0,(0,c.Kn)(O.payload)&&(_.connectionParams=O.payload);const t=await(null==v?void 0:v(_));return!1===t?e.close(u.CloseCode.Forbidden,"Forbidden"):(await e.send((0,u.stringifyMessage)((0,c.Kn)(t)?{type:u.MessageType.ConnectionAck,payload:t}:{type:u.MessageType.ConnectionAck},N)),void(_.acknowledged=!0))}case u.MessageType.Ping:return e.onPing?await e.onPing(O.payload):void await e.send((0,u.stringifyMessage)(O.payload?{type:u.MessageType.Pong,payload:O.payload}:{type:u.MessageType.Pong}));case u.MessageType.Pong:return await(null===(k=e.onPong)||void 0===k?void 0:k.call(e,O.payload));case u.MessageType.Subscribe:{if(!_.acknowledged)return e.close(u.CloseCode.Unauthorized,"Unauthorized");const{id:g,payload:v}=O;if(g in _.subscriptions)return e.close(u.CloseCode.SubscriberAlreadyExists,`Subscriber for ${g} already exists`);_.subscriptions[g]=null;const x={next:async(t,n)=>{let r={id:g,type:u.MessageType.Next,payload:t};const i=await(null==w?void 0:w(_,r,n,t));i&&(r=Object.assign(Object.assign({},r),{payload:i})),await e.send((0,u.stringifyMessage)(r,N))},error:async t=>{let n={id:g,type:u.MessageType.Error,payload:t};const r=await(null==C?void 0:C(_,n,t));r&&(n=Object.assign(Object.assign({},n),{payload:r})),await e.send((0,u.stringifyMessage)(n,N))},complete:async t=>{const n={id:g,type:u.MessageType.Complete};await(null==S?void 0:S(_,n)),t&&await e.send((0,u.stringifyMessage)(n,N))}};let k;const L=await(null==E?void 0:E(_,O));if(L){if((0,c.Ox)(L))return await x.error(L);if(Array.isArray(L))throw new Error("Invalid return value from onSubscribe hook, expected an array of GraphQLError objects");k=L}else{if(!t)throw new Error("The GraphQL schema is not provided");const e={operationName:v.operationName,document:(0,r.Qc)(v.query),variableValues:v.variables};k=Object.assign(Object.assign({},e),{schema:"function"==typeof t?await t(_,O,e):t});const n=(null!=p?p:i.Gu)(k.schema,k.document);if(n.length>0)return await x.error(n)}const A=(0,o.S)(k.document,k.operationName);if(!A)return await x.error([new a.__("Unable to identify operation")]);let M;"rootValue"in k||(k.rootValue=null==f?void 0:f[A.operation]),"contextValue"in k||(k.contextValue="function"==typeof n?await n(_,O,k):n),M="subscription"===A.operation?await(null!=m?m:s.L)(k):await(null!=h?h:l.ht)(k);const R=await(null==T?void 0:T(_,O,k,M));if(R&&(M=R),(0,c.D0)(M))if(g in _.subscriptions){_.subscriptions[g]=M;try{for(var I,D=d(M);!(I=await D.next()).done;){const e=I.value;await x.next(e,k)}}catch(e){y={error:e}}finally{try{I&&!I.done&&(b=D.return)&&await b.call(D)}finally{if(y)throw y.error}}}else(0,c.Jy)(M)&&M.return(void 0);else g in _.subscriptions&&await x.next(M,k);return await x.complete(g in _.subscriptions),void delete _.subscriptions[g]}case u.MessageType.Complete:{const e=_.subscriptions[O.id];return(0,c.Jy)(e)&&await e.return(void 0),void delete _.subscriptions[O.id]}default:throw new Error(`Unexpected message of type ${O.type} received`)}})),async(e,t)=>{O&&clearTimeout(O);for(const e of Object.values(_.subscriptions))(0,c.Jy)(e)&&await e.return(void 0);_.acknowledged&&await(null==y?void 0:y(_,e,t)),await(null==b?void 0:b(_,e,t))}}}}},6764:function(e,t,n){"use strict";n.d(t,{D0:function(){return o},Jy:function(){return a},Kn:function(){return i},ND:function(){return c},O2:function(){return u},Ox:function(){return s},nr:function(){return l},qj:function(){return d}});const r=Object.prototype.hasOwnProperty;function i(e){return"object"==typeof e&&null!==e}function o(e){return"function"==typeof Object(e)[Symbol.asyncIterator]}function a(e){return i(e)&&"function"==typeof Object(e)[Symbol.asyncIterator]&&"function"==typeof e.return}function s(e){return Array.isArray(e)&&e.length>0&&e.every((e=>"message"in e))}function l(e,t){return r.call(e,t)}function u(e,t){return r.call(e,t)&&i(e[t])}function c(e,t){return r.call(e,t)&&"string"==typeof e[t]}function d(e,t){return e.length<124?e:t}},4117:function(e,t,n){"use strict";n.d(t,{OS:function(){return l},Z:function(){return u},__:function(){return a}});var r=n(1315),i=n(3302),o=n(7026);class a extends Error{constructor(e,...t){var n,o,l;const{nodes:u,source:c,positions:d,path:f,originalError:p,extensions:h}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=p?p:void 0,this.nodes=s(Array.isArray(u)?u:u?[u]:void 0);const m=s(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=c?c:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=d?d:null==m?void 0:m.map((e=>e.start)),this.locations=d&&c?d.map((e=>(0,i.k)(c,e))):null==m?void 0:m.map((e=>(0,i.k)(e.source,e.start)));const g=(0,r.y)(null==p?void 0:p.extensions)?null==p?void 0:p.extensions:void 0;this.extensions=null!==(l=null!=h?h:g)&&void 0!==l?l:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=p&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,o.Q)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,o.z)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}function l(e){return e.toString()}function u(e){return e.toJSON()}},4647:function(e,t,n){"use strict";n.d(t,{y:function(){return a}});var r=n(5648);class i extends Error{constructor(e){super("Unexpected error value: "+(0,r.X)(e)),this.name="NonErrorThrown",this.thrownValue=e}}var o=n(4117);function a(e,t,n){var r;const a=(s=e)instanceof Error?s:new i(s);var s,l;return l=a,Array.isArray(l.path)?a:new o.__(a.message,{nodes:null!==(r=a.nodes)&&void 0!==r?r:t,source:a.source,positions:a.positions,path:n,originalError:a})}},2024:function(e,t,n){"use strict";n.d(t,{h:function(){return i}});var r=n(4117);function i(e,t,n){return new r.__(`Syntax Error: ${n}`,{source:e,positions:[t]})}},5267:function(e,t,n){"use strict";n.d(t,{g:function(){return l},w:function(){return u}});var r=n(3830),i=n(755),o=n(5946),a=n(5998),s=n(2806);function l(e,t,n,r,i){const o=new Map;return c(e,t,n,r,i,o,new Set),o}function u(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&c(e,t,n,r,s.selectionSet,o,a);return o}function c(e,t,n,i,o,a,s){for(const u of o.selections)switch(u.kind){case r.h.FIELD:{if(!d(n,u))continue;const e=(l=u).alias?l.alias.value:l.name.value,t=a.get(e);void 0!==t?t.push(u):a.set(e,[u]);break}case r.h.INLINE_FRAGMENT:if(!d(n,u)||!f(e,u,i))continue;c(e,t,n,i,u.selectionSet,a,s);break;case r.h.FRAGMENT_SPREAD:{const r=u.name.value;if(s.has(r)||!d(n,u))continue;s.add(r);const o=t[r];if(!o||!f(e,o,i))continue;c(e,t,n,i,o.selectionSet,a,s);break}}var l}function d(e,t){const n=(0,s.zu)(o.QE,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=(0,s.zu)(o.Yf,t,e);return!1!==(null==r?void 0:r.if)}function f(e,t,n){const r=t.typeCondition;if(!r)return!0;const o=(0,a._)(e,r);return o===n||!!(0,i.m0)(o)&&e.isSubType(o,n)}},7180:function(e,t,n){"use strict";n.d(t,{td:function(){return C},VZ:function(){return S},p$:function(){return k},El:function(){return M},mn:function(){return A},ht:function(){return E},p0:function(){return T},Vm:function(){return R}});var r=n(1172),i=n(5648),o=n(5052),a=n(2910),s=n(1315),l=n(1864),u=n(9878),c=n(4117),d=n(4647),f=n(3526),p=n(3830),h=n(755),m=n(8078),g=n(8555),v=n(5267),y=n(2806);const b=function(e){let t;return function(e,n,r){void 0===t&&(t=new WeakMap);let i=t.get(e);void 0===i&&(i=new WeakMap,t.set(e,i));let o=i.get(n);void 0===o&&(o=new WeakMap,i.set(n,o));let a=o.get(r);return void 0===a&&(s=e,l=n,u=r,a=(0,v.w)(s.schema,s.fragments,s.variableValues,l,u),o.set(r,a)),a;var s,l,u}}();function E(e){arguments.length<2||(0,r.a)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:i,rootValue:o}=e;C(t,n,i);const a=S(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,t=function(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new c.__(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=(0,v.g)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case f.ku.QUERY:return x(e,r,n,o,i);case f.ku.MUTATION:return function(e,t,n,r,i){return function(e,t,n){let r=Object.create(null);for(const n of e)r=(0,l.t)(r)?r.then((e=>t(e,n))):t(r,n);return r}(i.entries(),((r,[i,o])=>{const a=(0,u.Q)(undefined,i,t.name),s=N(e,t,n,o,a);return void 0===s?r:(0,l.t)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}))}(e,r,n,0,i);case f.ku.SUBSCRIPTION:return x(e,r,n,o,i)}}(a,e,o);return(0,l.t)(t)?t.then((e=>w(e,a.errors)),(e=>(a.errors.push(e),w(null,a.errors)))):w(t,a.errors)}catch(e){return a.errors.push(e),w(null,a.errors)}}function T(e){const t=E(e);if((0,l.t)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function w(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function C(e,t,n){t||(0,r.a)(!1,"Must provide document."),(0,g.J)(e),null==n||(0,s.y)(n)||(0,r.a)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function S(e){var t,n;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:l,fieldResolver:u,typeResolver:d,subscribeFieldResolver:f}=e;let h;const m=Object.create(null);for(const e of i.definitions)switch(e.kind){case p.h.OPERATION_DEFINITION:if(null==l){if(void 0!==h)return[new c.__("Must provide operation name if query contains multiple operations.")];h=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===l&&(h=e);break;case p.h.FRAGMENT_DEFINITION:m[e.name.value]=e}if(!h)return null!=l?[new c.__(`Unknown operation named "${l}".`)]:[new c.__("Must provide an operation.")];const g=null!==(n=h.variableDefinitions)&&void 0!==n?n:[],v=(0,y.QF)(r,g,null!=s?s:{},{maxErrors:50});return v.errors?v.errors:{schema:r,fragments:m,rootValue:o,contextValue:a,operation:h,variableValues:v.coerced,fieldResolver:null!=u?u:M,typeResolver:null!=d?d:A,subscribeFieldResolver:null!=f?f:M,errors:[]}}function x(e,t,n,r,i){const o=Object.create(null);let a=!1;for(const[s,c]of i.entries()){const i=N(e,t,n,c,(0,u.Q)(r,s,t.name));void 0!==i&&(o[s]=i,(0,l.t)(i)&&(a=!0))}return a?(s=o,Promise.all(Object.values(s)).then((e=>{const t=Object.create(null);for(const[n,r]of Object.keys(s).entries())t[r]=e[n];return t}))):o;var s}function N(e,t,n,r,i){var o;const a=R(e.schema,t,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,f=k(e,a,r,t,i);try{const t=c(n,(0,y.LX)(a,r[0],e.variableValues),e.contextValue,f);let o;return o=(0,l.t)(t)?t.then((t=>O(e,s,r,f,i,t))):O(e,s,r,f,i,t),(0,l.t)(o)?o.then(void 0,(t=>_((0,d.y)(t,r,(0,u.N)(i)),s,e))):o}catch(t){return _((0,d.y)(t,r,(0,u.N)(i)),s,e)}}function k(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function _(e,t,n){if((0,h.zM)(t))throw e;return n.errors.push(e),null}function O(e,t,n,r,s,f){if(f instanceof Error)throw f;if((0,h.zM)(t)){const i=O(e,t.ofType,n,r,s,f);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==f?null:(0,h.HG)(t)?function(e,t,n,r,i,o){if(!(0,a.i)(o))throw new c.__(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=t.ofType;let f=!1;const p=Array.from(o,((t,o)=>{const a=(0,u.Q)(i,o,void 0);try{let i;return i=(0,l.t)(t)?t.then((t=>O(e,s,n,r,a,t))):O(e,s,n,r,a,t),(0,l.t)(i)?(f=!0,i.then(void 0,(t=>_((0,d.y)(t,n,(0,u.N)(a)),s,e)))):i}catch(t){return _((0,d.y)(t,n,(0,u.N)(a)),s,e)}}));return f?Promise.all(p):p}(e,t,n,r,s,f):(0,h.UT)(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${(0,i.X)(e)}.serialize(${(0,i.X)(t)})\` to return non-nullable value, returned: ${(0,i.X)(n)}`);return n}(t,f):(0,h.m0)(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,u=e.contextValue,c=s(o,u,r,t);return(0,l.t)(c)?c.then((a=>D(e,I(a,e,t,n,r,o),n,r,i,o))):D(e,I(c,e,t,n,r,o),n,r,i,o)}(e,t,n,r,s,f):(0,h.lp)(t)?D(e,t,n,r,s,f):void(0,o.k)(!1,"Cannot complete value of unexpected output type: "+(0,i.X)(t))}function I(e,t,n,r,o,a){if(null==e)throw new c.__(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,h.lp)(e))throw new c.__("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new c.__(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.X)(a)}, received "${(0,i.X)(e)}".`);const s=t.schema.getType(e);if(null==s)throw new c.__(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,h.lp)(s))throw new c.__(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new c.__(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function D(e,t,n,r,i,o){const a=b(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if((0,l.t)(s))return s.then((r=>{if(!r)throw L(t,o,n);return x(e,t,o,i,a)}));if(!s)throw L(t,o,n)}return x(e,t,o,i,a)}function L(e,t,n){return new c.__(`Expected value of type "${e.name}" but got: ${(0,i.X)(t)}.`,{nodes:n})}const A=function(e,t,n,r){if((0,s.y)(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let t=0;t(0,c.ht)({schema:t,document:n,rootValue:e,contextValue:a,variableValues:s,operationName:l,fieldResolver:u}))):f}async function p(e,t,n,r,f,p,h){(0,c.td)(e,t,f);const m=(0,c.VZ)({schema:e,document:t,rootValue:n,contextValue:r,variableValues:f,operationName:p,subscribeFieldResolver:h});if(!("schema"in m))return{errors:m};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,f=t.getSubscriptionType();if(null==f)throw new s.__("Schema is not configured to execute subscription operation.",{nodes:r});const p=(0,u.g)(t,n,i,f,r.selectionSet),[h,m]=[...p.entries()][0],g=(0,c.Vm)(t,f,m[0]);if(!g){const e=m[0].name.value;throw new s.__(`The subscription field "${e}" is not defined.`,{nodes:m})}const v=(0,a.Q)(void 0,h,f.name),y=(0,c.p$)(e,g,m,f,v);try{var b;const t=(0,d.LX)(g,m[0],i),n=e.contextValue,r=null!==(b=g.subscribe)&&void 0!==b?b:e.subscribeFieldResolver,a=await r(o,t,n,y);if(a instanceof Error)throw a;return a}catch(e){throw(0,l.y)(e,m,(0,a.N)(v))}}(m);if(!o(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.X)(e)}.`);return e}catch(e){if(e instanceof s.__)return{errors:[e]};throw e}}},2806:function(e,t,n){"use strict";n.d(t,{LX:function(){return h},QF:function(){return p},zu:function(){return m}});var r=n(5648),i=n(9815),o=n(4987),a=n(4117),s=n(3830),l=n(5895),u=n(755),c=n(5925),d=n(5998),f=n(5284);function p(e,t,n,i){const s=[],p=null==i?void 0:i.maxErrors;try{const i=function(e,t,n,i){const s={};for(const p of t){const t=p.variable.name.value,h=(0,d._)(e,p.type);if(!(0,u.j$)(h)){const e=(0,l.S)(p.type);i(new a.__(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:p.type}));continue}if(!g(n,t)){if(p.defaultValue)s[t]=(0,f.u)(p.defaultValue,h);else if((0,u.zM)(h)){const e=(0,r.X)(h);i(new a.__(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:p}))}continue}const m=n[t];if(null===m&&(0,u.zM)(h)){const e=(0,r.X)(h);i(new a.__(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:p}))}else s[t]=(0,c.K)(m,h,((e,n,s)=>{let l=`Variable "$${t}" got invalid value `+(0,r.X)(n);e.length>0&&(l+=` at "${t}${(0,o.F)(e)}"`),i(new a.__(l+"; "+s.message,{nodes:p,originalError:s.originalError}))}))}return s}(e,t,n,(e=>{if(null!=p&&s.length>=p)throw new a.__("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}}function h(e,t,n){var o;const c={},d=null!==(o=t.arguments)&&void 0!==o?o:[],p=(0,i.P)(d,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,d=p[e];if(!d){if(void 0!==i.defaultValue)c[e]=i.defaultValue;else if((0,u.zM)(o))throw new a.__(`Argument "${e}" of required type "${(0,r.X)(o)}" was not provided.`,{nodes:t});continue}const h=d.value;let m=h.kind===s.h.NULL;if(h.kind===s.h.VARIABLE){const t=h.name.value;if(null==n||!g(n,t)){if(void 0!==i.defaultValue)c[e]=i.defaultValue;else if((0,u.zM)(o))throw new a.__(`Argument "${e}" of required type "${(0,r.X)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:h});continue}m=null==n[t]}if(m&&(0,u.zM)(o))throw new a.__(`Argument "${e}" of non-null type "${(0,r.X)(o)}" must not be null.`,{nodes:h});const v=(0,f.u)(h,o,n);if(void 0===v)throw new a.__(`Argument "${e}" has invalid value ${(0,l.S)(h)}.`,{nodes:h});c[e]=v}return c}function m(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find((t=>t.name.value===e.name));if(i)return h(e,i,n)}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},3573:function(e,t,n){"use strict";n.r(t),n.d(t,{BREAK:function(){return k.$_},BreakingChangeType:function(){return pt},DEFAULT_DEPRECATION_REASON:function(){return g.SY},DangerousChangeType:function(){return ht},DirectiveLocation:function(){return O.B},ExecutableDefinitionsRule:function(){return U.i},FieldsOnCorrectTypeRule:function(){return B.A},FragmentsOnCompositeTypesRule:function(){return $.T},GRAPHQL_MAX_INT:function(){return v.HI},GRAPHQL_MIN_INT:function(){return v.st},GraphQLBoolean:function(){return v.EZ},GraphQLDeprecatedDirective:function(){return g.fg},GraphQLDirective:function(){return g.NZ},GraphQLEnumType:function(){return h.mR},GraphQLError:function(){return R.__},GraphQLFloat:function(){return v.av},GraphQLID:function(){return v.km},GraphQLIncludeDirective:function(){return g.Yf},GraphQLInputObjectType:function(){return h.sR},GraphQLInt:function(){return v._o},GraphQLInterfaceType:function(){return h.oW},GraphQLList:function(){return h.p2},GraphQLNonNull:function(){return h.bM},GraphQLObjectType:function(){return h.h6},GraphQLScalarType:function(){return h.n2},GraphQLSchema:function(){return m.XO},GraphQLSkipDirective:function(){return g.QE},GraphQLSpecifiedByDirective:function(){return g.df},GraphQLString:function(){return v.kH},GraphQLUnionType:function(){return h.Gp},Kind:function(){return _.h},KnownArgumentNamesRule:function(){return q.e},KnownDirectivesRule:function(){return H.J},KnownFragmentNamesRule:function(){return G.a},KnownTypeNamesRule:function(){return z.I},Lexer:function(){return S.h},Location:function(){return E.Ye},LoneAnonymousOperationRule:function(){return W.F},LoneSchemaDefinitionRule:function(){return fe.t},NoDeprecatedCustomRule:function(){return F},NoFragmentCyclesRule:function(){return K.H},NoSchemaIntrospectionCustomRule:function(){return P},NoUndefinedVariablesRule:function(){return Q.$},NoUnusedFragmentsRule:function(){return X.J},NoUnusedVariablesRule:function(){return Y.p},OperationTypeNode:function(){return E.ku},OverlappingFieldsCanBeMergedRule:function(){return J.y},PossibleFragmentSpreadsRule:function(){return Z.a},PossibleTypeExtensionsRule:function(){return be.g},ProvidedRequiredArgumentsRule:function(){return ee.s},ScalarLeafsRule:function(){return te.O},SchemaMetaFieldDef:function(){return y.Az},SingleFieldSubscriptionsRule:function(){return ne.Z},Source:function(){return T.H},Token:function(){return E.WU},TokenKind:function(){return x.T},TypeInfo:function(){return Mt.a},TypeKind:function(){return y.zU},TypeMetaFieldDef:function(){return y.tF},TypeNameMetaFieldDef:function(){return y.hU},UniqueArgumentDefinitionNamesRule:function(){return ve.L},UniqueArgumentNamesRule:function(){return re.L},UniqueDirectiveNamesRule:function(){return ye.o},UniqueDirectivesPerLocationRule:function(){return ie.k},UniqueEnumValueNamesRule:function(){return me.L},UniqueFieldDefinitionNamesRule:function(){return ge.y},UniqueFragmentNamesRule:function(){return oe.N},UniqueInputFieldNamesRule:function(){return ae.P},UniqueOperationNamesRule:function(){return se.H},UniqueOperationTypesRule:function(){return pe.q},UniqueTypeNamesRule:function(){return he.P},UniqueVariableNamesRule:function(){return le.H},ValidationContext:function(){return j._t},ValuesOfCorrectTypeRule:function(){return ue.j},VariablesAreInputTypesRule:function(){return ce.I},VariablesInAllowedPositionRule:function(){return de.w},__Directive:function(){return y.l3},__DirectiveLocation:function(){return y.x2},__EnumValue:function(){return y.jT},__Field:function(){return y.e_},__InputValue:function(){return y.XQ},__Schema:function(){return y.TK},__Type:function(){return y.qz},__TypeKind:function(){return y.PX},assertAbstractType:function(){return h.fU},assertCompositeType:function(){return h.M_},assertDirective:function(){return g.CO},assertEnumType:function(){return h.Zu},assertEnumValueName:function(){return b.g},assertInputObjectType:function(){return h.U8},assertInputType:function(){return h.qT},assertInterfaceType:function(){return h.k2},assertLeafType:function(){return h.H5},assertListType:function(){return h.kS},assertName:function(){return b.i},assertNamedType:function(){return h.rM},assertNonNullType:function(){return h.E$},assertNullableType:function(){return h.i_},assertObjectType:function(){return h.Z6},assertOutputType:function(){return h.Gt},assertScalarType:function(){return h.Pt},assertSchema:function(){return m.EO},assertType:function(){return h.p_},assertUnionType:function(){return h.rc},assertValidName:function(){return ct},assertValidSchema:function(){return l.J},assertWrappingType:function(){return h.vX},astFromValue:function(){return Ge.J},buildASTSchema:function(){return Pe},buildClientSchema:function(){return Oe},buildSchema:function(){return je},coerceInputValue:function(){return Rt.K},concatAST:function(){return ot},createSourceEventStream:function(){return A.z},defaultFieldResolver:function(){return c.El},defaultTypeResolver:function(){return c.mn},doTypesOverlap:function(){return Ft.zR},execute:function(){return c.ht},executeSync:function(){return c.p0},extendSchema:function(){return Le},findBreakingChanges:function(){return mt},findDangerousChanges:function(){return gt},formatError:function(){return R.Z},getArgumentValues:function(){return L.LX},getDirectiveValues:function(){return L.zu},getEnterLeaveForKind:function(){return k.Eu},getIntrospectionQuery:function(){return we},getLocation:function(){return w.k},getNamedType:function(){return h.xC},getNullableType:function(){return h.tf},getOperationAST:function(){return Dt.S},getOperationRootType:function(){return Ce},getVariableValues:function(){return L.QF},getVisitFn:function(){return k.CK},graphql:function(){return d},graphqlSync:function(){return f},introspectionFromSchema:function(){return Se},introspectionTypes:function(){return y.nL},isAbstractType:function(){return h.m0},isCompositeType:function(){return h.Gv},isConstValueNode:function(){return I.Of},isDefinitionNode:function(){return I.Ir},isDirective:function(){return g.wX},isEnumType:function(){return h.EM},isEqualType:function(){return Ft._7},isExecutableDefinitionNode:function(){return I.Wk},isInputObjectType:function(){return h.hL},isInputType:function(){return h.j$},isInterfaceType:function(){return h.oT},isIntrospectionType:function(){return y.s9},isLeafType:function(){return h.UT},isListType:function(){return h.HG},isNamedType:function(){return h.Zs},isNonNullType:function(){return h.zM},isNullableType:function(){return h.zP},isObjectType:function(){return h.lp},isOutputType:function(){return h.SZ},isRequiredArgument:function(){return h.dK},isRequiredInputField:function(){return h.Wd},isScalarType:function(){return h.KA},isSchema:function(){return m.nN},isSelectionNode:function(){return I.pO},isSpecifiedDirective:function(){return g.xg},isSpecifiedScalarType:function(){return v.u1},isType:function(){return h.P9},isTypeDefinitionNode:function(){return I.zT},isTypeExtensionNode:function(){return I.D$},isTypeNode:function(){return I.VB},isTypeSubTypeOf:function(){return Ft.uJ},isTypeSystemDefinitionNode:function(){return I.G4},isTypeSystemExtensionNode:function(){return I.aU},isUnionType:function(){return h.EN},isValidNameError:function(){return dt},isValueNode:function(){return I.nr},isWrappingType:function(){return h.fw},lexicographicSortSchema:function(){return Ue},locatedError:function(){return Te.y},parse:function(){return s.Qc},parseConstValue:function(){return s.tl},parseType:function(){return s.gZ},parseValue:function(){return s.H2},print:function(){return N.S},printError:function(){return R.OS},printIntrospectionSchema:function(){return We},printLocation:function(){return C.Q},printSchema:function(){return ze},printSourceLocation:function(){return C.z},printType:function(){return Ye},resolveObjMapThunk:function(){return h.WB},resolveReadonlyArrayThunk:function(){return h._9},responsePathAsArray:function(){return D.N},separateOperations:function(){return at},specifiedDirectives:function(){return g.V4},specifiedRules:function(){return V.i},specifiedScalarTypes:function(){return v.HS},stripIgnoredCharacters:function(){return ut},subscribe:function(){return A.L},syntaxError:function(){return Ee.h},typeFromAST:function(){return Lt._},validate:function(){return u.Gu},validateSchema:function(){return l.F},valueFromAST:function(){return _e.u},valueFromASTUntyped:function(){return At.M},version:function(){return r},versionInfo:function(){return i},visit:function(){return k.Vn},visitInParallel:function(){return k.j1},visitWithTypeInfo:function(){return Mt.y}});const r="16.5.0",i=Object.freeze({major:16,minor:5,patch:0,preReleaseTag:null});var o=n(1172),a=n(1864),s=n(953),l=n(8555),u=n(2780),c=n(7180);function d(e){return new Promise((t=>t(p(e))))}function f(e){const t=p(e);if((0,a.t)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function p(e){arguments.length<2||(0,o.a)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:d,fieldResolver:f,typeResolver:p}=e,h=(0,l.F)(t);if(h.length>0)return{errors:h};let m;try{m=(0,s.Qc)(n)}catch(e){return{errors:[e]}}const g=(0,u.Gu)(t,m);return g.length>0?{errors:g}:(0,c.ht)({schema:t,document:m,rootValue:r,contextValue:i,variableValues:a,operationName:d,fieldResolver:f,typeResolver:p})}var h=n(755),m=n(773),g=n(5946),v=n(1774),y=n(8078),b=n(3228),E=n(3526),T=n(4680),w=n(3302),C=n(7026),S=n(9230),x=n(5685),N=n(5895),k=n(9685),_=n(3830),O=n(3140),I=n(9615),D=n(9878),L=n(2806),A=n(2941),M=n(5052),R=n(4117);function F(e){return{Field(t){const n=e.getFieldDef(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getParentType();null!=i||(0,M.k)(!1),e.reportError(new R.__(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getDirective();if(null!=i)e.reportError(new R.__(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{const i=e.getParentType(),o=e.getFieldDef();null!=i&&null!=o||(0,M.k)(!1),e.reportError(new R.__(`Field "${i.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){const n=(0,h.xC)(e.getParentInputType());if((0,h.hL)(n)){const r=n.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new R.__(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=(0,h.xC)(e.getInputType());null!=i||(0,M.k)(!1),e.reportError(new R.__(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}function P(e){return{Field(t){const n=(0,h.xC)(e.getType());n&&(0,y.s9)(n)&&e.reportError(new R.__(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var j=n(2716),V=n(9299),U=n(3857),B=n(1870),$=n(5167),q=n(4875),H=n(7513),G=n(1435),z=n(591),W=n(831),K=n(9316),Q=n(9518),X=n(3447),Y=n(7114),J=n(7163),Z=n(5961),ee=n(16),te=n(3989),ne=n(9309),re=n(9168),ie=n(5673),oe=n(614),ae=n(5707),se=n(2355),le=n(7417),ue=n(4697),ce=n(6192),de=n(377),fe=n(3402),pe=n(5427),he=n(4519),me=n(4560),ge=n(5240),ve=n(5947),ye=n(5681),be=n(3721),Ee=n(2024),Te=n(4647);function we(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"";function o(e){return t.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${t.schemaDescription?n:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${n}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${n}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${n}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${n}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${n}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n `}function Ce(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new R.__("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new R.__("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new R.__("Schema is not configured for subscriptions.",{nodes:t});return n}throw new R.__("Can only have query, mutation and subscription operations.",{nodes:t})}function Se(e,t){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},r=(0,s.Qc)(we(n)),i=(0,c.p0)({schema:e,document:r});return!i.errors&&i.data||(0,M.k)(!1),i.data}var xe=n(5648),Ne=n(1315),ke=n(8240),_e=n(5284);function Oe(e,t){(0,Ne.y)(e)&&(0,Ne.y)(e.__schema)||(0,o.a)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,xe.X)(e)}.`);const n=e.__schema,r=(0,ke.w)(n.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case y.zU.SCALAR:return r=e,new h.n2({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case y.zU.OBJECT:return n=e,new h.h6({name:n.name,description:n.description,interfaces:()=>b(n),fields:()=>E(n)});case y.zU.INTERFACE:return t=e,new h.oW({name:t.name,description:t.description,interfaces:()=>b(t),fields:()=>E(t)});case y.zU.UNION:return function(e){if(!e.possibleTypes){const t=(0,xe.X)(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new h.Gp({name:e.name,description:e.description,types:()=>e.possibleTypes.map(f)})}(e);case y.zU.ENUM:return function(e){if(!e.enumValues){const t=(0,xe.X)(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new h.mR({name:e.name,description:e.description,values:(0,ke.w)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case y.zU.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=(0,xe.X)(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new h.sR({name:e.name,description:e.description,fields:()=>w(e.inputFields)})}(e)}var t,n,r;const i=(0,xe.X)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e)));for(const e of[...v.HS,...y.nL])r[e.name]&&(r[e.name]=e);const i=n.queryType?f(n.queryType):null,a=n.mutationType?f(n.mutationType):null,l=n.subscriptionType?f(n.subscriptionType):null,u=n.directives?n.directives.map((function(e){if(!e.args){const t=(0,xe.X)(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=(0,xe.X)(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new g.NZ({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:w(e.args)})})):[];return new m.XO({description:n.description,query:i,mutation:a,subscription:l,types:Object.values(r),directives:u,assumeValid:null==t?void 0:t.assumeValid});function c(e){if(e.kind===y.zU.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new h.p2(c(t))}if(e.kind===y.zU.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=c(t);return new h.bM((0,h.i_)(n))}return d(e)}function d(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${(0,xe.X)(e)}.`);const n=r[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function f(e){return(0,h.Z6)(d(e))}function p(e){return(0,h.k2)(d(e))}function b(e){if(null===e.interfaces&&e.kind===y.zU.INTERFACE)return[];if(!e.interfaces){const t=(0,xe.X)(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(p)}function E(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,xe.X)(e)}.`);return(0,ke.w)(e.fields,(e=>e.name),T)}function T(e){const t=c(e.type);if(!(0,h.SZ)(t)){const e=(0,xe.X)(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=(0,xe.X)(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:w(e.args)}}function w(e){return(0,ke.w)(e,(e=>e.name),C)}function C(e){const t=c(e.type);if(!(0,h.j$)(t)){const e=(0,xe.X)(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?(0,_e.u)((0,s.H2)(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}var Ie=n(9815),De=n(9997);function Le(e,t,n){(0,m.EO)(e),null!=t&&t.kind===_.h.DOCUMENT||(0,o.a)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,u.ED)(t,e);const r=e.toConfig(),i=Ae(r,t,n);return r===i?e:new m.XO(i)}function Ae(e,t,n){var r,i,o,a;const s=[],l=Object.create(null),u=[];let c;const d=[];for(const e of t.definitions)if(e.kind===_.h.SCHEMA_DEFINITION)c=e;else if(e.kind===_.h.SCHEMA_EXTENSION)d.push(e);else if((0,I.zT)(e))s.push(e);else if((0,I.D$)(e)){const t=e.name.value,n=l[t];l[t]=n?n.concat([e]):[e]}else e.kind===_.h.DIRECTIVE_DEFINITION&&u.push(e);if(0===Object.keys(l).length&&0===s.length&&0===u.length&&0===d.length&&null==c)return e;const f=Object.create(null);for(const t of e.types)f[t.name]=(p=t,(0,y.s9)(p)||(0,v.u1)(p)?p:(0,h.KA)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=Fe(e))&&void 0!==o?o:i}return new h.n2({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.lp)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.h6({...n,interfaces:()=>[...e.getInterfaces().map(T),...A(r)],fields:()=>({...(0,De.j)(n.fields,w),...k(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.oT)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.oW({...n,interfaces:()=>[...e.getInterfaces().map(T),...A(r)],fields:()=>({...(0,De.j)(n.fields,w),...k(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.EN)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.Gp({...n,types:()=>[...e.getTypes().map(T),...R(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.EM)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[e.name])&&void 0!==t?t:[];return new h.mR({...n,values:{...n.values,...L(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.hL)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.sR({...n,fields:()=>({...(0,De.j)(n.fields,(e=>({...e,type:E(e.type)}))),...D(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(p)));var p;for(const e of s){var m;const t=e.name.value;f[t]=null!==(m=Me[t])&&void 0!==m?m:F(e)}const b={query:e.query&&T(e.query),mutation:e.mutation&&T(e.mutation),subscription:e.subscription&&T(e.subscription),...c&&S([c]),...S(d)};return{description:null===(r=c)||void 0===r||null===(i=r.description)||void 0===i?void 0:i.value,...b,types:Object.values(f),directives:[...e.directives.map((function(e){const t=e.toConfig();return new g.NZ({...t,args:(0,De.j)(t.args,C)})})),...u.map((function(e){var t;return new g.NZ({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:O(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(o=c)&&void 0!==o?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:null!==(a=null==n?void 0:n.assumeValid)&&void 0!==a&&a};function E(e){return(0,h.HG)(e)?new h.p2(E(e.ofType)):(0,h.zM)(e)?new h.bM(E(e.ofType)):T(e)}function T(e){return f[e.name]}function w(e){return{...e,type:E(e.type),args:e.args&&(0,De.j)(e.args,C)}}function C(e){return{...e,type:E(e.type)}}function S(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=x(n.type)}return t}function x(e){var t;const n=e.name.value,r=null!==(t=Me[n])&&void 0!==t?t:f[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function N(e){return e.kind===_.h.LIST_TYPE?new h.p2(N(e.type)):e.kind===_.h.NON_NULL_TYPE?new h.bM(N(e.type)):x(e)}function k(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:N(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:O(n.arguments),deprecationReason:Re(n),astNode:n}}}return t}function O(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=N(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,_e.u)(e.defaultValue,t),deprecationReason:Re(e),astNode:e}}return n}function D(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=N(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:(0,_e.u)(n.defaultValue,e),deprecationReason:Re(n),astNode:n}}}return t}function L(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:Re(n),astNode:n}}}return t}function A(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(x))&&void 0!==t?t:[]}))}function R(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(x))&&void 0!==t?t:[]}))}function F(e){var t;const n=e.name.value,r=null!==(t=l[n])&&void 0!==t?t:[];switch(e.kind){case _.h.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new h.h6({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>A(t),fields:()=>k(t),astNode:e,extensionASTNodes:r})}case _.h.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new h.oW({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>A(t),fields:()=>k(t),astNode:e,extensionASTNodes:r})}case _.h.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new h.mR({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:L(t),astNode:e,extensionASTNodes:r})}case _.h.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new h.Gp({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>R(t),astNode:e,extensionASTNodes:r})}case _.h.SCALAR_TYPE_DEFINITION:var u;return new h.n2({name:n,description:null===(u=e.description)||void 0===u?void 0:u.value,specifiedByURL:Fe(e),astNode:e,extensionASTNodes:r});case _.h.INPUT_OBJECT_TYPE_DEFINITION:{var c;const t=[e,...r];return new h.sR({name:n,description:null===(c=e.description)||void 0===c?void 0:c.value,fields:()=>D(t),astNode:e,extensionASTNodes:r})}}}}const Me=(0,Ie.P)([...v.HS,...y.nL],(e=>e.name));function Re(e){const t=(0,L.zu)(g.fg,e);return null==t?void 0:t.reason}function Fe(e){const t=(0,L.zu)(g.df,e);return null==t?void 0:t.url}function Pe(e,t){null!=e&&e.kind===_.h.DOCUMENT||(0,o.a)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,u.zo)(e);const n=Ae({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...g.V4.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new m.XO({...n,directives:r})}function je(e,t){return Pe((0,s.Qc)(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})}var Ve=n(6625);function Ue(e){const t=e.toConfig(),n=(0,ke.w)($e(t.types),(e=>e.name),(function(e){if((0,h.KA)(e)||(0,y.s9)(e))return e;if((0,h.lp)(e)){const t=e.toConfig();return new h.h6({...t,interfaces:()=>l(t.interfaces),fields:()=>s(t.fields)})}if((0,h.oT)(e)){const t=e.toConfig();return new h.oW({...t,interfaces:()=>l(t.interfaces),fields:()=>s(t.fields)})}if((0,h.EN)(e)){const t=e.toConfig();return new h.Gp({...t,types:()=>l(t.types)})}if((0,h.EM)(e)){const t=e.toConfig();return new h.mR({...t,values:Be(t.values,(e=>e))})}if((0,h.hL)(e)){const t=e.toConfig();return new h.sR({...t,fields:()=>Be(t.fields,(e=>({...e,type:r(e.type)})))})}(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}));return new m.XO({...t,types:Object.values(n),directives:$e(t.directives).map((function(e){const t=e.toConfig();return new g.NZ({...t,locations:qe(t.locations,(e=>e)),args:a(t.args)})})),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)});function r(e){return(0,h.HG)(e)?new h.p2(r(e.ofType)):(0,h.zM)(e)?new h.bM(r(e.ofType)):i(e)}function i(e){return n[e.name]}function o(e){return e&&i(e)}function a(e){return Be(e,(e=>({...e,type:r(e.type)})))}function s(e){return Be(e,(e=>({...e,type:r(e.type),args:e.args&&a(e.args)})))}function l(e){return $e(e).map(i)}}function Be(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(Ve.K))n[r]=t(e[r]);return n}function $e(e){return qe(e,(e=>e.name))}function qe(e,t){return e.slice().sort(((e,n)=>{const r=t(e),i=t(n);return(0,Ve.K)(r,i)}))}var He=n(6303),Ge=n(3190);function ze(e){return Qe(e,(e=>!(0,g.xg)(e)),Ke)}function We(e){return Qe(e,g.xg,y.s9)}function Ke(e){return!(0,v.u1)(e)&&!(0,y.s9)(e)}function Qe(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[Xe(e),...r.map((e=>function(e){return it(e)+"directive @"+e.name+tt(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>Ye(e)))].filter(Boolean).join("\n\n")}function Xe(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),it(e)+`schema {\n${t.join("\n")}\n}`}function Ye(e){return(0,h.KA)(e)?function(e){return it(e)+`scalar ${e.name}`+(null==(t=e).specifiedByURL?"":` @specifiedBy(url: ${(0,N.S)({kind:_.h.STRING,value:t.specifiedByURL})})`);var t}(e):(0,h.lp)(e)?function(e){return it(e)+`type ${e.name}`+Je(e)+Ze(e)}(e):(0,h.oT)(e)?function(e){return it(e)+`interface ${e.name}`+Je(e)+Ze(e)}(e):(0,h.EN)(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return it(e)+"union "+e.name+n}(e):(0,h.EM)(e)?function(e){const t=e.getValues().map(((e,t)=>it(e," ",!t)+" "+e.name+rt(e.deprecationReason)));return it(e)+`enum ${e.name}`+et(t)}(e):(0,h.hL)(e)?function(e){const t=Object.values(e.getFields()).map(((e,t)=>it(e," ",!t)+" "+nt(e)));return it(e)+`input ${e.name}`+et(t)}(e):void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}function Je(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Ze(e){return et(Object.values(e.getFields()).map(((e,t)=>it(e," ",!t)+" "+e.name+tt(e.args," ")+": "+String(e.type)+rt(e.deprecationReason))))}function et(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function tt(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(nt).join(", ")+")":"(\n"+e.map(((e,n)=>it(e," "+t,!n)+" "+t+nt(e))).join("\n")+"\n"+t+")"}function nt(e){const t=(0,Ge.J)(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,N.S)(t)}`),n+rt(e.deprecationReason)}function rt(e){return null==e?"":e!==g.SY?` @deprecated(reason: ${(0,N.S)({kind:_.h.STRING,value:e})})`:" @deprecated"}function it(e,t="",n=!0){const{description:r}=e;return null==r?"":(t&&!n?"\n"+t:t)+(0,N.S)({kind:_.h.STRING,value:r,block:(0,He.MZ)(r)}).replace(/\n/g,"\n"+t)+"\n"}function ot(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:_.h.DOCUMENT,definitions:t}}function at(e){const t=[],n=Object.create(null);for(const r of e.definitions)switch(r.kind){case _.h.OPERATION_DEFINITION:t.push(r);break;case _.h.FRAGMENT_DEFINITION:n[r.name.value]=lt(r.selectionSet)}const r=Object.create(null);for(const i of t){const t=new Set;for(const e of lt(i.selectionSet))st(t,n,e);r[i.name?i.name.value:""]={kind:_.h.DOCUMENT,definitions:e.definitions.filter((e=>e===i||e.kind===_.h.FRAGMENT_DEFINITION&&t.has(e.name.value)))}}return r}function st(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)st(e,t,n)}}function lt(e){const t=[];return(0,k.Vn)(e,{FragmentSpread(e){t.push(e.name.value)}}),t}function ut(e){const t=(0,T.T)(e)?e:new T.H(e),n=t.body,r=new S.h(t);let i="",o=!1;for(;r.advance().kind!==x.T.EOF;){const e=r.token,t=e.kind,a=!(0,S.u)(e.kind);o&&(a||e.kind===x.T.SPREAD)&&(i+=" ");const s=n.slice(e.start,e.end);t===x.T.BLOCK_STRING?i+=(0,He.LZ)(e.value,{minimize:!0}):i+=s,o=a}return i}function ct(e){const t=dt(e);if(t)throw t;return e}function dt(e){if("string"==typeof e||(0,o.a)(!1,"Expected name to be a string."),e.startsWith("__"))return new R.__(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,b.i)(e)}catch(e){return e}}var ft=n(4034);let pt,ht;function mt(e,t){return vt(e,t).filter((e=>e.type in pt))}function gt(e,t){return vt(e,t).filter((e=>e.type in ht))}function vt(e,t){return[...bt(e,t),...yt(e,t)]}function yt(e,t){const n=[],r=It(e.getDirectives(),t.getDirectives());for(const e of r.removed)n.push({type:pt.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of r.persisted){const r=It(e.args,t.args);for(const t of r.added)(0,h.dK)(t)&&n.push({type:pt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of r.removed)n.push({type:pt.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:pt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const r of e.locations)t.locations.includes(r)||n.push({type:pt.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function bt(e,t){const n=[],r=It(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of r.removed)n.push({type:pt.TYPE_REMOVED,description:(0,v.u1)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of r.persisted)(0,h.EM)(e)&&(0,h.EM)(t)?n.push(...wt(e,t)):(0,h.EN)(e)&&(0,h.EN)(t)?n.push(...Tt(e,t)):(0,h.hL)(e)&&(0,h.hL)(t)?n.push(...Et(e,t)):(0,h.lp)(e)&&(0,h.lp)(t)||(0,h.oT)(e)&&(0,h.oT)(t)?n.push(...St(e,t),...Ct(e,t)):e.constructor!==t.constructor&&n.push({type:pt.TYPE_CHANGED_KIND,description:`${e.name} changed from ${_t(e)} to ${_t(t)}.`});return n}function Et(e,t){const n=[],r=It(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.added)(0,h.Wd)(t)?n.push({type:pt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:ht.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of r.removed)n.push({type:pt.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted)kt(t.type,i.type)||n.push({type:pt.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function Tt(e,t){const n=[],r=It(e.getTypes(),t.getTypes());for(const t of r.added)n.push({type:ht.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of r.removed)n.push({type:pt.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function wt(e,t){const n=[],r=It(e.getValues(),t.getValues());for(const t of r.added)n.push({type:ht.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of r.removed)n.push({type:pt.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function Ct(e,t){const n=[],r=It(e.getInterfaces(),t.getInterfaces());for(const t of r.added)n.push({type:ht.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of r.removed)n.push({type:pt.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function St(e,t){const n=[],r=It(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.removed)n.push({type:pt.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted)n.push(...xt(e,t,i)),Nt(t.type,i.type)||n.push({type:pt.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function xt(e,t,n){const r=[],i=It(t.args,n.args);for(const n of i.removed)r.push({type:pt.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,o]of i.persisted)if(kt(n.type,o.type)){if(void 0!==n.defaultValue)if(void 0===o.defaultValue)r.push({type:ht.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const i=Ot(n.defaultValue,n.type),a=Ot(o.defaultValue,o.type);i!==a&&r.push({type:ht.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${a}.`})}}else r.push({type:pt.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(o.type)}.`});for(const n of i.added)(0,h.dK)(n)?r.push({type:pt.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:ht.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function Nt(e,t){return(0,h.HG)(e)?(0,h.HG)(t)&&Nt(e.ofType,t.ofType)||(0,h.zM)(t)&&Nt(e,t.ofType):(0,h.zM)(e)?(0,h.zM)(t)&&Nt(e.ofType,t.ofType):(0,h.Zs)(t)&&e.name===t.name||(0,h.zM)(t)&&Nt(e,t.ofType)}function kt(e,t){return(0,h.HG)(e)?(0,h.HG)(t)&&kt(e.ofType,t.ofType):(0,h.zM)(e)?(0,h.zM)(t)&&kt(e.ofType,t.ofType)||!(0,h.zM)(t)&&kt(e.ofType,t):(0,h.Zs)(t)&&e.name===t.name}function _t(e){return(0,h.KA)(e)?"a Scalar type":(0,h.lp)(e)?"an Object type":(0,h.oT)(e)?"an Interface type":(0,h.EN)(e)?"a Union type":(0,h.EM)(e)?"an Enum type":(0,h.hL)(e)?"an Input type":void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}function Ot(e,t){const n=(0,Ge.J)(e,t);return null!=n||(0,M.k)(!1),(0,N.S)((0,ft.n)(n))}function It(e,t){const n=[],r=[],i=[],o=(0,Ie.P)(e,(({name:e})=>e)),a=(0,Ie.P)(t,(({name:e})=>e));for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);return{added:n,persisted:i,removed:r}}!function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(pt||(pt={})),function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(ht||(ht={}));var Dt=n(9458),Lt=n(5998),At=n(9426),Mt=n(1409),Rt=n(5925),Ft=n(2984)},9878:function(e,t,n){"use strict";function r(e,t,n){return{prev:e,key:t,typename:n}}function i(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}n.d(t,{N:function(){return i},Q:function(){return r}})},1172:function(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw new Error(t)}n.d(t,{a:function(){return r}})},8063:function(e,t,n){"use strict";n.d(t,{l:function(){return i}});const r=5;function i(e,t){const[n,i]=t?[e,t]:[void 0,e];let o=" Did you mean ";n&&(o+=n+" ");const a=i.map((e=>`"${e}"`));switch(a.length){case 0:return"";case 1:return o+a[0]+"?";case 2:return o+a[0]+" or "+a[1]+"?"}const s=a.slice(0,r),l=s.pop();return o+s.join(", ")+", or "+l+"?"}},5839:function(e,t,n){"use strict";function r(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}n.d(t,{v:function(){return r}})},5648:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});const r=10,i=2;function o(e){return a(e,[])}function a(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:a(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>i)return"[Array]";const n=Math.min(r,e.length),o=e.length-n,s=[];for(let r=0;r1&&s.push(`... ${o} more items`),"["+s.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>i)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+a(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},1513:function(e,t,n){"use strict";n.d(t,{n:function(){return r}});const r=function(e,t){return e instanceof t}},5052:function(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{k:function(){return r}})},2910:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}n.d(t,{i:function(){return r}})},1315:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!==e}n.d(t,{y:function(){return r}})},1864:function(e,t,n){"use strict";function r(e){return"function"==typeof(null==e?void 0:e.then)}n.d(t,{t:function(){return r}})},9815:function(e,t,n){"use strict";function r(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}n.d(t,{P:function(){return r}})},8240:function(e,t,n){"use strict";function r(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}n.d(t,{w:function(){return r}})},9997:function(e,t,n){"use strict";function r(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}n.d(t,{j:function(){return r}})},6625:function(e,t,n){"use strict";function r(e,t){let n=0,r=0;for(;n0);let u=0;do{++r,u=10*u+s-i,s=t.charCodeAt(r)}while(a(s)&&u>0);if(lu)return 1}else{if(os)return 1;++n,++r}}return e.length-t.length}n.d(t,{K:function(){return r}});const i=48,o=57;function a(e){return!isNaN(e)&&i<=e&&e<=o}},4987:function(e,t,n){"use strict";function r(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}n.d(t,{F:function(){return r}})},3492:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(6625);function i(e,t){const n=Object.create(null),i=new o(e),a=Math.floor(.4*e.length)+1;for(const e of t){const t=i.measure(e,a);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const i=n[e]-n[t];return 0!==i?i:(0,r.K)(e,t)}))}class o{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=a(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=a(n),i=this._inputArray;if(r.lengtht)return;const l=this._rows;for(let e=0;e<=s;e++)l[0][e]=e;for(let e=1;e<=o;e++){const n=l[(e-1)%3],o=l[e%3];let a=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=l[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const u=l[o%3][s];return u<=t?u:void 0}}function a(e){const t=e.length,n=new Array(t);for(let r=0;r0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function o(e){let t=0;for(;t1&&i.slice(1).every((e=>0===e.length||(0,r.FD)(e.charCodeAt(0)))),s=n.endsWith('\\"""'),l=e.endsWith('"')&&!s,u=e.endsWith("\\"),c=l||u,d=!(null!=t&&t.minimize)&&(!o||e.length>70||c||a||s);let f="";const p=o&&(0,r.FD)(e.charCodeAt(0));return(d&&!p||a)&&(f+="\n"),f+=n,(d||c)&&(f+="\n"),'"""'+f+'"""'}},1117:function(e,t,n){"use strict";function r(e){return 9===e||32===e}function i(e){return e>=48&&e<=57}function o(e){return e>=97&&e<=122||e>=65&&e<=90}function a(e){return o(e)||95===e}function s(e){return o(e)||i(e)||95===e}n.d(t,{FD:function(){return r},HQ:function(){return s},LQ:function(){return a},X1:function(){return i}})},3140:function(e,t,n){"use strict";let r;n.d(t,{B:function(){return r}}),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(r||(r={}))},3830:function(e,t,n){"use strict";let r;n.d(t,{h:function(){return r}}),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(r||(r={}))},9230:function(e,t,n){"use strict";n.d(t,{h:function(){return l},u:function(){return u}});var r=n(2024),i=n(3526),o=n(6303),a=n(1117),s=n(5685);class l{constructor(e){const t=new i.WU(s.T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.T.EOF)do{if(e.next)e=e.next;else{const t=g(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===s.T.COMMENT);return e}}function u(e){return e===s.T.BANG||e===s.T.DOLLAR||e===s.T.AMP||e===s.T.PAREN_L||e===s.T.PAREN_R||e===s.T.SPREAD||e===s.T.COLON||e===s.T.EQUALS||e===s.T.AT||e===s.T.BRACKET_L||e===s.T.BRACKET_R||e===s.T.BRACE_L||e===s.T.PIPE||e===s.T.BRACE_R}function c(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function d(e,t){return f(e.charCodeAt(t))&&p(e.charCodeAt(t+1))}function f(e){return e>=55296&&e<=56319}function p(e){return e>=56320&&e<=57343}function h(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return s.T.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function m(e,t,n,r,o){const a=e.line,s=1+n-e.lineStart;return new i.WU(t,n,r,a,s,o)}function g(e,t){const n=e.source.body,i=n.length;let o=t;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function x(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.h)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function N(e,t){const n=e.source.body,i=n.length;let a=e.lineStart,l=t+3,u=l,f="";const p=[];for(;l=t)break;n=a.index+a[0].length,o+=1}return{line:o,column:t+1-n}}},953:function(e,t,n){"use strict";n.d(t,{H2:function(){return d},Qc:function(){return c},gZ:function(){return p},tl:function(){return f}});var r=n(2024),i=n(3526),o=n(3140),a=n(3830),s=n(9230),l=n(4680),u=n(5685);function c(e,t){return new h(e,t).parseDocument()}function d(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(u.T.EOF),r}function f(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseConstValueLiteral();return n.expectToken(u.T.EOF),r}function p(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseTypeReference();return n.expectToken(u.T.EOF),r}class h{constructor(e,t){const n=(0,l.T)(e)?e:new l.H(e);this._lexer=new s.h(n),this._options=t}parseName(){const e=this.expectToken(u.T.NAME);return this.node(e,{kind:a.h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.h.DOCUMENT,definitions:this.many(u.T.SOF,this.parseDefinition,u.T.EOF)})}parseDefinition(){if(this.peek(u.T.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===u.T.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.h)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(u.T.BRACE_L))return this.node(e,{kind:a.h.OPERATION_DEFINITION,operation:i.ku.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(u.T.NAME)&&(n=this.parseName()),this.node(e,{kind:a.h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(u.T.NAME);switch(e.value){case"query":return i.ku.QUERY;case"mutation":return i.ku.MUTATION;case"subscription":return i.ku.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(u.T.PAREN_L,this.parseVariableDefinition,u.T.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.T.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(u.T.DOLLAR),this.node(e,{kind:a.h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.h.SELECTION_SET,selections:this.many(u.T.BRACE_L,this.parseSelection,u.T.BRACE_R)})}parseSelection(){return this.peek(u.T.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(u.T.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:a.h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.T.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.T.PAREN_L,t,u.T.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.T.COLON),this.node(t,{kind:a.h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(u.T.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(u.T.NAME)?this.node(e,{kind:a.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e;const t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacyFragmentVariables)?this.node(t,{kind:a.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:a.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case u.T.BRACKET_L:return this.parseList(e);case u.T.BRACE_L:return this.parseObject(e);case u.T.INT:return this._lexer.advance(),this.node(t,{kind:a.h.INT,value:t.value});case u.T.FLOAT:return this._lexer.advance(),this.node(t,{kind:a.h.FLOAT,value:t.value});case u.T.STRING:case u.T.BLOCK_STRING:return this.parseStringLiteral();case u.T.NAME:switch(this._lexer.advance(),t.value){case"true":return this.node(t,{kind:a.h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:a.h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:a.h.NULL});default:return this.node(t,{kind:a.h.ENUM,value:t.value})}case u.T.DOLLAR:if(e){if(this.expectToken(u.T.DOLLAR),this._lexer.token.kind===u.T.NAME){const e=this._lexer.token.value;throw(0,r.h)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this._lexer.advance(),this.node(e,{kind:a.h.STRING,value:e.value,block:e.kind===u.T.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.h.LIST,values:this.any(u.T.BRACKET_L,(()=>this.parseValueLiteral(e)),u.T.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.h.OBJECT,fields:this.any(u.T.BRACE_L,(()=>this.parseObjectField(e)),u.T.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.T.COLON),this.node(t,{kind:a.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(u.T.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(u.T.AT),this.node(t,{kind:a.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(u.T.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(u.T.BRACKET_R),t=this.node(e,{kind:a.h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(u.T.BANG)?this.node(e,{kind:a.h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:a.h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.T.STRING)||this.peek(u.T.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(u.T.BRACE_L,this.parseOperationTypeDefinition,u.T.BRACE_R);return this.node(e,{kind:a.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(u.T.COLON);const n=this.parseNamedType();return this.node(e,{kind:a.h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.T.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseFieldDefinition,u.T.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.T.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(u.T.PAREN_L,this.parseInputValueDef,u.T.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(u.T.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(u.T.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(u.T.EQUALS)?this.delimitedMany(u.T.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseEnumValueDefinition,u.T.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.h)(this._lexer.source,this._lexer.token.start,`${m(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseInputValueDef,u.T.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===u.T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(u.T.BRACE_L,this.parseOperationTypeDefinition,u.T.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:a.h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:a.h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.T.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(u.T.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(o.B,t.value))return t;throw this.unexpected(e)}node(e,t){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(t.loc=new i.Ye(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,r.h)(this._lexer.source,t.start,`Expected ${g(e)}, found ${m(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this._lexer.advance(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==u.T.NAME||t.value!==e)throw(0,r.h)(this._lexer.source,t.start,`Expected "${e}", found ${m(t)}.`);this._lexer.advance()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===u.T.NAME&&t.value===e&&(this._lexer.advance(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,r.h)(this._lexer.source,t.start,`Unexpected ${m(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}}function m(e){const t=e.value;return g(e.kind)+(null!=t?` "${t}"`:"")}function g(e){return(0,s.u)(e)?`"${e}"`:e}},9615:function(e,t,n){"use strict";n.d(t,{D$:function(){return p},G4:function(){return c},Ir:function(){return i},Of:function(){return l},VB:function(){return u},Wk:function(){return o},aU:function(){return f},nr:function(){return s},pO:function(){return a},zT:function(){return d}});var r=n(3830);function i(e){return o(e)||c(e)||f(e)}function o(e){return e.kind===r.h.OPERATION_DEFINITION||e.kind===r.h.FRAGMENT_DEFINITION}function a(e){return e.kind===r.h.FIELD||e.kind===r.h.FRAGMENT_SPREAD||e.kind===r.h.INLINE_FRAGMENT}function s(e){return e.kind===r.h.VARIABLE||e.kind===r.h.INT||e.kind===r.h.FLOAT||e.kind===r.h.STRING||e.kind===r.h.BOOLEAN||e.kind===r.h.NULL||e.kind===r.h.ENUM||e.kind===r.h.LIST||e.kind===r.h.OBJECT}function l(e){return s(e)&&(e.kind===r.h.LIST?e.values.some(l):e.kind===r.h.OBJECT?e.fields.some((e=>l(e.value))):e.kind!==r.h.VARIABLE)}function u(e){return e.kind===r.h.NAMED_TYPE||e.kind===r.h.LIST_TYPE||e.kind===r.h.NON_NULL_TYPE}function c(e){return e.kind===r.h.SCHEMA_DEFINITION||d(e)||e.kind===r.h.DIRECTIVE_DEFINITION}function d(e){return e.kind===r.h.SCALAR_TYPE_DEFINITION||e.kind===r.h.OBJECT_TYPE_DEFINITION||e.kind===r.h.INTERFACE_TYPE_DEFINITION||e.kind===r.h.UNION_TYPE_DEFINITION||e.kind===r.h.ENUM_TYPE_DEFINITION||e.kind===r.h.INPUT_OBJECT_TYPE_DEFINITION}function f(e){return e.kind===r.h.SCHEMA_EXTENSION||p(e)}function p(e){return e.kind===r.h.SCALAR_TYPE_EXTENSION||e.kind===r.h.OBJECT_TYPE_EXTENSION||e.kind===r.h.INTERFACE_TYPE_EXTENSION||e.kind===r.h.UNION_TYPE_EXTENSION||e.kind===r.h.ENUM_TYPE_EXTENSION||e.kind===r.h.INPUT_OBJECT_TYPE_EXTENSION}},7026:function(e,t,n){"use strict";n.d(t,{Q:function(){return i},z:function(){return o}});var r=n(3302);function i(e){return o(e.source,(0,r.k)(e.source,e.start))}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,l=1===t.line?n:0,u=t.column+l,c=`${e.name}:${s}:${u}\n`,d=r.split(/\r\n|[\n\r]/g),f=d[i];if(f.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return c+a([[s-1+" |",d[i-1]],[`${s} |`,f],["|","^".padStart(u)],[`${s+1} |`,d[i+1]]])}function a(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}},5895:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n(6303);const i=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function o(e){return a[e.charCodeAt(0)]}const a=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var s=n(9685);function l(e){return(0,s.Vn)(e,u)}const u={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>c(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=f("(",c(e.variableDefinitions,", "),")"),n=c([e.operation,c([e.name,t]),c(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+f(" = ",n)+f(" ",c(r," "))},SelectionSet:{leave:({selections:e})=>d(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=f("",e,": ")+t;let a=o+f("(",c(n,", "),")");return a.length>80&&(a=o+f("(\n",p(c(n,"\n")),"\n)")),c([a,c(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+f(" ",c(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>c(["...",f("on ",e),c(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${f("(",c(n,", "),")")} on ${t} ${f("",c(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,r.LZ)(e):`"${e.replace(i,o)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+c(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+c(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+f("(",c(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>f("",e,"\n")+c(["schema",c(t," "),d(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>f("",e,"\n")+c(["scalar",t,c(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>f("",e,"\n")+c(["type",t,f("implements ",c(n," & ")),c(r," "),d(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>f("",e,"\n")+t+(h(n)?f("(\n",p(c(n,"\n")),"\n)"):f("(",c(n,", "),")"))+": "+r+f(" ",c(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>f("",e,"\n")+c([t+": "+n,f("= ",r),c(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>f("",e,"\n")+c(["interface",t,f("implements ",c(n," & ")),c(r," "),d(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>f("",e,"\n")+c(["union",t,c(n," "),f("= ",c(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>f("",e,"\n")+c(["enum",t,c(n," "),d(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>f("",e,"\n")+c([t,c(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>f("",e,"\n")+c(["input",t,c(n," "),d(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>f("",e,"\n")+"directive @"+t+(h(n)?f("(\n",p(c(n,"\n")),"\n)"):f("(",c(n,", "),")"))+(r?" repeatable":"")+" on "+c(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>c(["extend schema",c(e," "),d(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>c(["extend scalar",e,c(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>c(["extend type",e,f("implements ",c(t," & ")),c(n," "),d(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>c(["extend interface",e,f("implements ",c(t," & ")),c(n," "),d(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>c(["extend union",e,c(t," "),f("= ",c(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>c(["extend enum",e,c(t," "),d(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>c(["extend input",e,c(t," "),d(n)]," ")}};function c(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function d(e){return f("{\n",p(c(e,"\n")),"\n}")}function f(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function p(e){return f(" ",e.replace(/\n/g,"\n "))}function h(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},4680:function(e,t,n){"use strict";n.d(t,{H:function(){return a},T:function(){return s}});var r=n(1172),i=n(5648),o=n(1513);class a{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,r.a)(!1,`Body must be a string. Received: ${(0,i.X)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,r.a)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.a)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function s(e){return(0,o.n)(e,a)}},5685:function(e,t,n){"use strict";let r;n.d(t,{T:function(){return r}}),function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(r||(r={}))},9685:function(e,t,n){"use strict";n.d(t,{$_:function(){return s},CK:function(){return d},Eu:function(){return c},Vn:function(){return l},j1:function(){return u}});var r=n(1172),i=n(5648),o=n(3526),a=n(3830);const s=Object.freeze({});function l(e,t,n=o.h8){const l=new Map;for(const e of Object.values(a.h))l.set(e,c(t,e));let u,d,f,p=Array.isArray(e),h=[e],m=-1,g=[],v=e;const y=[],b=[];do{m++;const e=m===h.length,a=e&&0!==g.length;if(e){if(d=0===b.length?void 0:y[y.length-1],v=f,f=b.pop(),a)if(p){v=v.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(v.splice(r,1),e++):v[r]=n}}else{v=Object.defineProperties({},Object.getOwnPropertyDescriptors(v));for(const[e,t]of g)v[e]=t}m=u.index,h=u.keys,g=u.edits,p=u.inArray,u=u.prev}else if(f){if(d=p?m:h[m],v=f[d],null==v)continue;y.push(d)}let c;if(!Array.isArray(v)){var E,T;(0,o.UG)(v)||(0,r.a)(!1,`Invalid AST Node: ${(0,i.X)(v)}.`);const n=e?null===(E=l.get(v.kind))||void 0===E?void 0:E.leave:null===(T=l.get(v.kind))||void 0===T?void 0:T.enter;if(c=null==n?void 0:n.call(t,v,d,f,y,b),c===s)break;if(!1===c){if(!e){y.pop();continue}}else if(void 0!==c&&(g.push([d,c]),!e)){if(!(0,o.UG)(c)){y.pop();continue}v=c}}var w;void 0===c&&a&&g.push([d,v]),e?y.pop():(u={inArray:p,index:m,keys:h,edits:g,prev:u},p=Array.isArray(v),h=p?v:null!==(w=n[v.kind])&&void 0!==w?w:[],m=-1,g=[],f&&b.push(f),f=v)}while(void 0!==u);return 0!==g.length?g[g.length-1][1]:e}function u(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(a.h)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;tl((0,v.M)(e,t)),this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.a)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.X)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.a)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.a)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ae{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>le(e),this._interfaces=()=>se(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.a)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.X)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:de(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function se(e){var t;const n=re(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||(0,r.a)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function le(e){const t=ie(e.fields);return ce(t)||(0,r.a)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.j)(t,((t,n)=>{var i;ce(t)||(0,r.a)(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,r.a)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,a.X)(t.resolve)}.`);const o=null!==(i=t.args)&&void 0!==i?i:{};return ce(o)||(0,r.a)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,y.i)(n),description:t.description,type:t.type,args:ue(o),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode}}))}function ue(e){return Object.entries(e).map((([e,t])=>({name:(0,y.i)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))}function ce(e){return(0,l.y)(e)&&!Array.isArray(e)}function de(e){return(0,d.j)(e,(e=>({description:e.description,type:e.type,args:fe(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function fe(e){return(0,c.w)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function pe(e){return R(e.type)&&void 0===e.defaultValue}class he{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=le.bind(void 0,e),this._interfaces=se.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.a)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.X)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:de(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class me{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=ge.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.a)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.X)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ge(e){const t=re(e.types);return Array.isArray(t)||(0,r.a)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class ve{constructor(e){var t,n,i;this.name=(0,y.i)(e.name),this.description=e.description,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=(n=this.name,ce(i=e.values)||(0,r.a)(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map((([e,t])=>(ce(t)||(0,r.a)(!1,`${n}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.X)(t)}.`),{name:(0,y.g)(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,u.P)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new h.__(`Enum "${this.name}" cannot represent value: ${(0,a.X)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=(0,a.X)(e);throw new h.__(`Enum "${this.name}" cannot represent non-string value: ${t}.`+ye(this,t))}const t=this.getValue(e);if(null==t)throw new h.__(`Value "${e}" does not exist in "${this.name}" enum.`+ye(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.h.ENUM){const t=(0,g.S)(e);throw new h.__(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+ye(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=(0,g.S)(e);throw new h.__(`Value "${t}" does not exist in "${this.name}" enum.`+ye(this,t),{nodes:e})}return n.value}toConfig(){const e=(0,c.w)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ye(e,t){const n=e.getValues().map((e=>e.name)),r=(0,f.D)(t,n);return(0,i.l)("the enum value",r)}class be{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=Ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,d.j)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ee(e){const t=ie(e.fields);return ce(t)||(0,r.a)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.j)(t,((t,n)=>(!("resolve"in t)||(0,r.a)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,y.i)(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))}function Te(e){return R(e.type)&&void 0===e.defaultValue}},5946:function(e,t,n){"use strict";n.d(t,{CO:function(){return p},NZ:function(){return h},QE:function(){return g},SY:function(){return v},V4:function(){return E},Yf:function(){return m},df:function(){return b},fg:function(){return y},wX:function(){return f},xg:function(){return T}});var r=n(1172),i=n(5648),o=n(1513),a=n(1315),s=n(1140),l=n(3140),u=n(3228),c=n(755),d=n(1774);function f(e){return(0,o.n)(e,h)}function p(e){if(!f(e))throw new Error(`Expected ${(0,i.X)(e)} to be a GraphQL directive.`);return e}class h{constructor(e){var t,n;this.name=(0,u.i)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=(0,s.u)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.a)(!1,`@${e.name} locations must be an Array.`);const i=null!==(n=e.args)&&void 0!==n?n:{};(0,a.y)(i)&&!Array.isArray(i)||(0,r.a)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,c.WO)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,c.DM)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const m=new h({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[l.B.FIELD,l.B.FRAGMENT_SPREAD,l.B.INLINE_FRAGMENT],args:{if:{type:new c.bM(d.EZ),description:"Included when true."}}}),g=new h({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[l.B.FIELD,l.B.FRAGMENT_SPREAD,l.B.INLINE_FRAGMENT],args:{if:{type:new c.bM(d.EZ),description:"Skipped when true."}}}),v="No longer supported",y=new h({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[l.B.FIELD_DEFINITION,l.B.ARGUMENT_DEFINITION,l.B.INPUT_FIELD_DEFINITION,l.B.ENUM_VALUE],args:{reason:{type:d.kH,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:v}}}),b=new h({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[l.B.SCALAR],args:{url:{type:new c.bM(d.kH),description:"The URL that specifies the behavior of this scalar."}}}),E=Object.freeze([m,g,y,b]);function T(e){return E.some((({name:t})=>t===e.name))}},8078:function(e,t,n){"use strict";n.d(t,{Az:function(){return b},PX:function(){return y},TK:function(){return c},XQ:function(){return m},e_:function(){return h},hU:function(){return T},jT:function(){return g},l3:function(){return d},nL:function(){return w},qz:function(){return p},s9:function(){return C},tF:function(){return E},x2:function(){return f},zU:function(){return v}});var r=n(5648),i=n(5052),o=n(3140),a=n(5895),s=n(3190),l=n(755),u=n(1774);const c=new l.h6({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:u.kH,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new l.bM(new l.p2(new l.bM(p))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new l.bM(p),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:p,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:p,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new l.bM(new l.p2(new l.bM(d))),resolve:e=>e.getDirectives()}})}),d=new l.h6({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},isRepeatable:{type:new l.bM(u.EZ),resolve:e=>e.isRepeatable},locations:{type:new l.bM(new l.p2(new l.bM(f))),resolve:e=>e.locations},args:{type:new l.bM(new l.p2(new l.bM(m))),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter((e=>null==e.deprecationReason))}}})}),f=new l.mR({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.B.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.B.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.B.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.B.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.B.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.B.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.B.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.B.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.B.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.B.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.B.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.B.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.B.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.B.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.B.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.B.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.B.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.B.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.B.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),p=new l.h6({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new l.bM(y),resolve(e){return(0,l.KA)(e)?v.SCALAR:(0,l.lp)(e)?v.OBJECT:(0,l.oT)(e)?v.INTERFACE:(0,l.EN)(e)?v.UNION:(0,l.EM)(e)?v.ENUM:(0,l.hL)(e)?v.INPUT_OBJECT:(0,l.HG)(e)?v.LIST:(0,l.zM)(e)?v.NON_NULL:void(0,i.k)(!1,`Unexpected type: "${(0,r.X)(e)}".`)}},name:{type:u.kH,resolve:e=>"name"in e?e.name:void 0},description:{type:u.kH,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:u.kH,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new l.p2(new l.bM(h)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.lp)(e)||(0,l.oT)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new l.p2(new l.bM(p)),resolve(e){if((0,l.lp)(e)||(0,l.oT)(e))return e.getInterfaces()}},possibleTypes:{type:new l.p2(new l.bM(p)),resolve(e,t,n,{schema:r}){if((0,l.m0)(e))return r.getPossibleTypes(e)}},enumValues:{type:new l.p2(new l.bM(g)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.EM)(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new l.p2(new l.bM(m)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.hL)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:p,resolve:e=>"ofType"in e?e.ofType:void 0}})}),h=new l.h6({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},args:{type:new l.bM(new l.p2(new l.bM(m))),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter((e=>null==e.deprecationReason))}},type:{type:new l.bM(p),resolve:e=>e.type},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})}),m=new l.h6({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},type:{type:new l.bM(p),resolve:e=>e.type},defaultValue:{type:u.kH,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=(0,s.J)(n,t);return r?(0,a.S)(r):null}},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})}),g=new l.h6({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})});let v;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(v||(v={}));const y=new l.mR({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:v.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:v.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:v.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:v.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:v.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:v.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:v.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:v.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),b={name:"__schema",type:new l.bM(c),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},E={name:"__type",type:p,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new l.bM(u.kH),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},T={name:"__typename",type:new l.bM(u.kH),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},w=Object.freeze([c,d,f,p,h,m,g,y]);function C(e){return w.some((({name:t})=>e.name===t))}},1774:function(e,t,n){"use strict";n.d(t,{EZ:function(){return h},HI:function(){return u},HS:function(){return g},_o:function(){return d},av:function(){return f},kH:function(){return p},km:function(){return m},st:function(){return c},u1:function(){return v}});var r=n(5648),i=n(1315),o=n(4117),a=n(3830),s=n(5895),l=n(755);const u=2147483647,c=-2147483648,d=new l.n2({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=y(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new o.__(`Int cannot represent non-integer value: ${(0,r.X)(t)}`);if(n>u||nu||eu||te.name===t))}function y(e){if((0,i.y)(e)){if("function"==typeof e.valueOf){const t=e.valueOf();if(!(0,i.y)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}},773:function(e,t,n){"use strict";n.d(t,{EO:function(){return p},XO:function(){return h},nN:function(){return f}});var r=n(1172),i=n(5648),o=n(1513),a=n(1315),s=n(1140),l=n(3526),u=n(755),c=n(5946),d=n(8078);function f(e){return(0,o.n)(e,h)}function p(e){if(!f(e))throw new Error(`Expected ${(0,i.X)(e)} to be a GraphQL schema.`);return e}class h{constructor(e){var t,n;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,a.y)(e)||(0,r.a)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,r.a)(!1,`"types" must be Array if provided but got: ${(0,i.X)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,r.a)(!1,`"directives" must be Array if provided but got: ${(0,i.X)(e.directives)}.`),this.description=e.description,this.extensions=(0,s.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!==(n=e.directives)&&void 0!==n?n:c.V4;const o=new Set(e.types);if(null!=e.types)for(const t of e.types)o.delete(t),m(t,o);null!=this._queryType&&m(this._queryType,o),null!=this._mutationType&&m(this._mutationType,o),null!=this._subscriptionType&&m(this._subscriptionType,o);for(const e of this._directives)if((0,c.wX)(e))for(const t of e.args)m(t.type,o);m(d.TK,o),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const e of o){if(null==e)continue;const t=e.name;if(t||(0,r.a)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,(0,u.oT)(e)){for(const t of e.getInterfaces())if((0,u.oT)(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if((0,u.lp)(e))for(const t of e.getInterfaces())if((0,u.oT)(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case l.ku.QUERY:return this.getQueryType();case l.ku.MUTATION:return this.getMutationType();case l.ku.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return(0,u.EN)(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),(0,u.EN)(e))for(const t of e.getTypes())n[t.name]=!0;else{const t=this.getImplementations(e);for(const e of t.objects)n[e.name]=!0;for(const e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return void 0!==n[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function m(e,t){const n=(0,u.xC)(e);if(!t.has(n))if(t.add(n),(0,u.EN)(n))for(const e of n.getTypes())m(e,t);else if((0,u.lp)(n)||(0,u.oT)(n)){for(const e of n.getInterfaces())m(e,t);for(const e of Object.values(n.getFields())){m(e.type,t);for(const n of e.args)m(n.type,t)}}else if((0,u.hL)(n))for(const e of Object.values(n.getFields()))m(e.type,t);return t}},8555:function(e,t,n){"use strict";n.d(t,{F:function(){return d},J:function(){return f}});var r=n(5648),i=n(4117),o=n(3526),a=n(2984),s=n(755),l=n(5946),u=n(8078),c=n(773);function d(e){if((0,c.EO)(e),e.__validationErrors)return e.__validationErrors;const t=new p(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!(0,s.lp)(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.X)(n)}.`,null!==(i=h(t,o.ku.QUERY))&&void 0!==i?i:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const a=t.getMutationType();var l;a&&!(0,s.lp)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.X)(a)}.`,null!==(l=h(t,o.ku.MUTATION))&&void 0!==l?l:a.astNode);const u=t.getSubscriptionType();var c;u&&!(0,s.lp)(u)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.X)(u)}.`,null!==(c=h(t,o.ku.SUBSCRIPTION))&&void 0!==c?c:u.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if((0,l.wX)(n)){m(e,n);for(const i of n.args){var t;m(e,i),(0,s.j$)(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${(0,r.X)(i.type)}.`,i.astNode),(0,s.dK)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[x(i.astNode),null===(t=i.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${(0,r.X)(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if((0,s.zM)(t.type)&&(0,s.hL)(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const i of Object.values(n))(0,s.Zs)(i)?((0,u.s9)(i)||m(e,i),(0,s.lp)(i)||(0,s.oT)(i)?(g(e,i),v(e,i)):(0,s.EN)(i)?E(e,i):(0,s.EM)(i)?T(e,i):(0,s.hL)(i)&&(w(e,i),t(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.X)(i)}.`,i.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}function f(e){const t=d(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}class p{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new i.__(e,{nodes:n}))}getErrors(){return this._errors}}function h(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]})).find((e=>e.operation===t)))||void 0===n?void 0:n.type}function m(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function g(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const l of n){var i;m(e,l),(0,s.SZ)(l.type)||e.reportError(`The type of ${t.name}.${l.name} must be Output Type but got: ${(0,r.X)(l.type)}.`,null===(i=l.astNode)||void 0===i?void 0:i.type);for(const n of l.args){const i=n.name;var o,a;m(e,n),(0,s.j$)(n.type)||e.reportError(`The type of ${t.name}.${l.name}(${i}:) must be Input Type but got: ${(0,r.X)(n.type)}.`,null===(o=n.astNode)||void 0===o?void 0:o.type),(0,s.dK)(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${l.name}(${i}:) cannot be deprecated.`,[x(n.astNode),null===(a=n.astNode)||void 0===a?void 0:a.type])}}}function v(e,t){const n=Object.create(null);for(const i of t.getInterfaces())(0,s.oT)(i)?t!==i?n[i.name]?e.reportError(`Type ${t.name} can only implement ${i.name} once.`,C(t,i)):(n[i.name]=!0,b(e,t,i),y(e,t,i)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,C(t,i)):e.reportError(`Type ${(0,r.X)(t)} must only implement Interface types, it cannot implement ${(0,r.X)(i)}.`,C(t,i))}function y(e,t,n){const i=t.getFields();for(const d of Object.values(n.getFields())){const f=d.name,p=i[f];if(p){var o,l;(0,a.uJ)(e.schema,p.type,d.type)||e.reportError(`Interface field ${n.name}.${f} expects type ${(0,r.X)(d.type)} but ${t.name}.${f} is type ${(0,r.X)(p.type)}.`,[null===(o=d.astNode)||void 0===o?void 0:o.type,null===(l=p.astNode)||void 0===l?void 0:l.type]);for(const i of d.args){const o=i.name,s=p.args.find((e=>e.name===o));var u,c;s?(0,a._7)(i.type,s.type)||e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expects type ${(0,r.X)(i.type)} but ${t.name}.${f}(${o}:) is type ${(0,r.X)(s.type)}.`,[null===(u=i.astNode)||void 0===u?void 0:u.type,null===(c=s.astNode)||void 0===c?void 0:c.type]):e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expected but ${t.name}.${f} does not provide it.`,[i.astNode,p.astNode])}for(const r of p.args){const i=r.name;!d.args.find((e=>e.name===i))&&(0,s.dK)(r)&&e.reportError(`Object field ${t.name}.${f} includes required argument ${i} that is missing from the Interface field ${n.name}.${f}.`,[r.astNode,d.astNode])}}else e.reportError(`Interface field ${n.name}.${f} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes])}}function b(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...C(n,i),...C(t,n)])}function E(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const o of n)i[o.name]?e.reportError(`Union type ${t.name} can only include type ${o.name} once.`,S(t,o.name)):(i[o.name]=!0,(0,s.lp)(o)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,r.X)(o)}.`,S(t,String(o))))}function T(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)m(e,t)}function w(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var i,o;m(e,a),(0,s.j$)(a.type)||e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,r.X)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.Wd)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[x(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function C(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]})).filter((e=>e.name.value===t.name))}function S(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]})).filter((e=>e.name.value===t))}function x(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find((e=>e.name.value===l.fg.name))}},1409:function(e,t,n){"use strict";n.d(t,{a:function(){return u},y:function(){return d}});var r=n(3526),i=n(3830),o=n(9685),a=n(755),s=n(8078),l=n(5998);class u{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:c,t&&((0,a.j$)(t)&&this._inputTypeStack.push(t),(0,a.Gv)(t)&&this._parentTypeStack.push(t),(0,a.SZ)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case i.h.SELECTION_SET:{const e=(0,a.xC)(this.getType());this._parentTypeStack.push((0,a.Gv)(e)?e:void 0);break}case i.h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.SZ)(i)?i:void 0);break}case i.h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case i.h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push((0,a.lp)(n)?n:void 0);break}case i.h.INLINE_FRAGMENT:case i.h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?(0,l._)(t,n):(0,a.xC)(this.getType());this._typeStack.push((0,a.SZ)(r)?r:void 0);break}case i.h.VARIABLE_DEFINITION:{const n=(0,l._)(t,e.type);this._inputTypeStack.push((0,a.j$)(n)?n:void 0);break}case i.h.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find((t=>t.name===e.name.value)),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,a.j$)(r)?r:void 0);break}case i.h.LIST:{const e=(0,a.tf)(this.getInputType()),t=(0,a.HG)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.j$)(t)?t:void 0);break}case i.h.OBJECT_FIELD:{const t=(0,a.xC)(this.getInputType());let n,r;(0,a.hL)(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.j$)(n)?n:void 0);break}case i.h.ENUM:{const t=(0,a.xC)(this.getInputType());let n;(0,a.EM)(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case i.h.SELECTION_SET:this._parentTypeStack.pop();break;case i.h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.h.DIRECTIVE:this._directive=null;break;case i.h.OPERATION_DEFINITION:case i.h.INLINE_FRAGMENT:case i.h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.h.LIST:case i.h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.h.ENUM:this._enumValue=null}}}function c(e,t,n){const r=n.name.value;return r===s.Az.name&&e.getQueryType()===t?s.Az:r===s.tF.name&&e.getQueryType()===t?s.tF:r===s.hU.name&&(0,a.Gv)(t)?s.hU:(0,a.lp)(t)||(0,a.oT)(t)?t.getFields()[r]:void 0}function d(e,t){return{enter(...n){const i=n[0];e.enter(i);const a=(0,o.Eu)(t,i.kind).enter;if(a){const o=a.apply(t,n);return void 0!==o&&(e.leave(i),(0,r.UG)(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=(0,o.Eu)(t,r.kind).leave;let a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}},3190:function(e,t,n){"use strict";n.d(t,{J:function(){return c}});var r=n(5648),i=n(5052),o=n(2910),a=n(1315),s=n(3830),l=n(755),u=n(1774);function c(e,t){if((0,l.zM)(t)){const n=c(e,t.ofType);return(null==n?void 0:n.kind)===s.h.NULL?null:n}if(null===e)return{kind:s.h.NULL};if(void 0===e)return null;if((0,l.HG)(t)){const n=t.ofType;if((0,o.i)(e)){const t=[];for(const r of e){const e=c(r,n);null!=e&&t.push(e)}return{kind:s.h.LIST,values:t}}return c(e,n)}if((0,l.hL)(t)){if(!(0,a.y)(e))return null;const n=[];for(const r of Object.values(t.getFields())){const t=c(e[r.name],r.type);t&&n.push({kind:s.h.OBJECT_FIELD,name:{kind:s.h.NAME,value:r.name},value:t})}return{kind:s.h.OBJECT,fields:n}}if((0,l.UT)(t)){const n=t.serialize(e);if(null==n)return null;if("boolean"==typeof n)return{kind:s.h.BOOLEAN,value:n};if("number"==typeof n&&Number.isFinite(n)){const e=String(n);return d.test(e)?{kind:s.h.INT,value:e}:{kind:s.h.FLOAT,value:e}}if("string"==typeof n)return(0,l.EM)(t)?{kind:s.h.ENUM,value:n}:t===u.km&&d.test(n)?{kind:s.h.INT,value:n}:{kind:s.h.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,r.X)(n)}.`)}(0,i.k)(!1,"Unexpected input type: "+(0,r.X)(t))}const d=/^-?(?:0|[1-9][0-9]*)$/},5925:function(e,t,n){"use strict";n.d(t,{K:function(){return p}});var r=n(8063),i=n(5648),o=n(5052),a=n(2910),s=n(1315),l=n(9878),u=n(4987),c=n(3492),d=n(4117),f=n(755);function p(e,t,n=h){return m(e,t,n,void 0)}function h(e,t,n){let r="Invalid value "+(0,i.X)(t);throw e.length>0&&(r+=` at "value${(0,u.F)(e)}"`),n.message=r+": "+n.message,n}function m(e,t,n,u){if((0,f.zM)(t))return null!=e?m(e,t.ofType,n,u):void n((0,l.N)(u),e,new d.__(`Expected non-nullable type "${(0,i.X)(t)}" not to be null.`));if(null==e)return null;if((0,f.HG)(t)){const r=t.ofType;return(0,a.i)(e)?Array.from(e,((e,t)=>{const i=(0,l.Q)(u,t,void 0);return m(e,r,n,i)})):[m(e,r,n,u)]}if((0,f.hL)(t)){if(!(0,s.y)(e))return void n((0,l.N)(u),e,new d.__(`Expected type "${t.name}" to be an object.`));const o={},a=t.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=m(a,r.type,n,(0,l.Q)(u,r.name,t.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,f.zM)(r.type)){const t=(0,i.X)(r.type);n((0,l.N)(u),e,new d.__(`Field "${r.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,c.D)(i,Object.keys(t.getFields()));n((0,l.N)(u),e,new d.__(`Field "${i}" is not defined by type "${t.name}".`+(0,r.l)(o)))}return o}if((0,f.UT)(t)){let r;try{r=t.parseValue(e)}catch(r){return void(r instanceof d.__?n((0,l.N)(u),e,r):n((0,l.N)(u),e,new d.__(`Expected type "${t.name}". `+r.message,{originalError:r})))}return void 0===r&&n((0,l.N)(u),e,new d.__(`Expected type "${t.name}".`)),r}(0,o.k)(!1,"Unexpected input type: "+(0,i.X)(t))}},9458:function(e,t,n){"use strict";n.d(t,{S:function(){return i}});var r=n(3830);function i(e,t){let n=null;for(const o of e.definitions){var i;if(o.kind===r.h.OPERATION_DEFINITION)if(null==t){if(n)return null;n=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===t)return o}return n}},4034:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(6625),i=n(3830);function o(e){switch(e.kind){case i.h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:o(e.value)}))).sort(((e,t)=>(0,r.K)(e.name.value,t.name.value))))};case i.h.LIST:return{...e,values:e.values.map(o)};case i.h.INT:case i.h.FLOAT:case i.h.STRING:case i.h.BOOLEAN:case i.h.NULL:case i.h.ENUM:case i.h.VARIABLE:return e}var t}},2984:function(e,t,n){"use strict";n.d(t,{_7:function(){return i},uJ:function(){return o},zR:function(){return a}});var r=n(755);function i(e,t){return e===t||((0,r.zM)(e)&&(0,r.zM)(t)||!(!(0,r.HG)(e)||!(0,r.HG)(t)))&&i(e.ofType,t.ofType)}function o(e,t,n){return t===n||((0,r.zM)(n)?!!(0,r.zM)(t)&&o(e,t.ofType,n.ofType):(0,r.zM)(t)?o(e,t.ofType,n):(0,r.HG)(n)?!!(0,r.HG)(t)&&o(e,t.ofType,n.ofType):!(0,r.HG)(t)&&(0,r.m0)(n)&&((0,r.oT)(t)||(0,r.lp)(t))&&e.isSubType(n,t))}function a(e,t,n){return t===n||((0,r.m0)(t)?(0,r.m0)(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!(0,r.m0)(n)&&e.isSubType(n,t))}},5998:function(e,t,n){"use strict";n.d(t,{_:function(){return o}});var r=n(3830),i=n(755);function o(e,t){switch(t.kind){case r.h.LIST_TYPE:{const n=o(e,t.type);return n&&new i.p2(n)}case r.h.NON_NULL_TYPE:{const n=o(e,t.type);return n&&new i.bM(n)}case r.h.NAMED_TYPE:return e.getType(t.name.value)}}},5284:function(e,t,n){"use strict";n.d(t,{u:function(){return l}});var r=n(5648),i=n(5052),o=n(9815),a=n(3830),s=n(755);function l(e,t,n){if(e){if(e.kind===a.h.VARIABLE){const r=e.name.value;if(null==n||void 0===n[r])return;const i=n[r];if(null===i&&(0,s.zM)(t))return;return i}if((0,s.zM)(t)){if(e.kind===a.h.NULL)return;return l(e,t.ofType,n)}if(e.kind===a.h.NULL)return null;if((0,s.HG)(t)){const r=t.ofType;if(e.kind===a.h.LIST){const t=[];for(const i of e.values)if(u(i,n)){if((0,s.zM)(r))return;t.push(null)}else{const e=l(i,r,n);if(void 0===e)return;t.push(e)}return t}const i=l(e,r,n);if(void 0===i)return;return[i]}if((0,s.hL)(t)){if(e.kind!==a.h.OBJECT)return;const r=Object.create(null),i=(0,o.P)(e.fields,(e=>e.name.value));for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||u(t.value,n)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if((0,s.zM)(e.type))return;continue}const o=l(t.value,e.type,n);if(void 0===o)return;r[e.name]=o}return r}if((0,s.UT)(t)){let r;try{r=t.parseLiteral(e,n)}catch(e){return}if(void 0===r)return;return r}(0,i.k)(!1,"Unexpected input type: "+(0,r.X)(t))}}function u(e,t){return e.kind===a.h.VARIABLE&&(null==t||void 0===t[e.name.value])}},9426:function(e,t,n){"use strict";n.d(t,{M:function(){return o}});var r=n(8240),i=n(3830);function o(e,t){switch(e.kind){case i.h.NULL:return null;case i.h.INT:return parseInt(e.value,10);case i.h.FLOAT:return parseFloat(e.value);case i.h.STRING:case i.h.ENUM:case i.h.BOOLEAN:return e.value;case i.h.LIST:return e.values.map((e=>o(e,t)));case i.h.OBJECT:return(0,r.w)(e.fields,(e=>e.name.value),(e=>o(e.value,t)));case i.h.VARIABLE:return null==t?void 0:t[e.name.value]}}},2716:function(e,t,n){"use strict";n.d(t,{_t:function(){return l},yv:function(){return s}});var r=n(3830),i=n(9685),o=n(1409);class a{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let i;for(;i=n.pop();)for(const e of i.selections)e.kind===r.h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class s extends a{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class l extends a{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new o.a(this._schema);(0,i.Vn)(e,(0,o.y)(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}},3857:function(e,t,n){"use strict";n.d(t,{i:function(){return a}});var r=n(4117),i=n(3830),o=n(9615);function a(e){return{Document(t){for(const n of t.definitions)if(!(0,o.Wk)(n)){const t=n.kind===i.h.SCHEMA_DEFINITION||n.kind===i.h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new r.__(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}},1870:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(8063),i=n(6625),o=n(3492),a=n(4117),s=n(755);function l(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const l=e.getSchema(),u=t.name.value;let c=(0,r.l)("to use an inline fragment on",function(e,t,n){if(!(0,s.m0)(t))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(t))if(i.getFields()[n]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[n]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((t,n)=>{const r=o[n.name]-o[t.name];return 0!==r?r:(0,s.oT)(t)&&e.isSubType(t,n)?-1:(0,s.oT)(n)&&e.isSubType(n,t)?1:(0,i.K)(t.name,n.name)})).map((e=>e.name))}(l,n,u));""===c&&(c=(0,r.l)(function(e,t){if((0,s.lp)(e)||(0,s.oT)(e)){const n=Object.keys(e.getFields());return(0,o.D)(t,n)}return[]}(n,u))),e.reportError(new a.__(`Cannot query field "${u}" on type "${n.name}".`+c,{nodes:t}))}}}}},5167:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(4117),i=n(5895),o=n(755),a=n(5998);function s(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=(0,a._)(e.getSchema(),n);if(t&&!(0,o.Gv)(t)){const t=(0,i.S)(n);e.reportError(new r.__(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=(0,a._)(e.getSchema(),t.typeCondition);if(n&&!(0,o.Gv)(n)){const n=(0,i.S)(t.typeCondition);e.reportError(new r.__(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}},4875:function(e,t,n){"use strict";n.d(t,{e:function(){return l},o:function(){return u}});var r=n(8063),i=n(3492),o=n(4117),a=n(3830),s=n(5946);function l(e){return{...u(e),Argument(t){const n=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!n&&a&&s){const n=t.name.value,l=a.args.map((e=>e.name)),u=(0,i.D)(n,l);e.reportError(new o.__(`Unknown argument "${n}" on field "${s.name}.${a.name}".`+(0,r.l)(u),{nodes:t}))}}}}function u(e){const t=Object.create(null),n=e.getSchema(),l=n?n.getDirectives():s.V4;for(const e of l)t[e.name]=e.args.map((e=>e.name));const u=e.getDocument().definitions;for(const e of u)if(e.kind===a.h.DIRECTIVE_DEFINITION){var c;const n=null!==(c=e.arguments)&&void 0!==c?c:[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const a=n.name.value,s=t[a];if(n.arguments&&s)for(const t of n.arguments){const n=t.name.value;if(!s.includes(n)){const l=(0,i.D)(n,s);e.reportError(new o.__(`Unknown argument "${n}" on directive "@${a}".`+(0,r.l)(l),{nodes:t}))}}return!1}}}},7513:function(e,t,n){"use strict";n.d(t,{J:function(){return c}});var r=n(5648),i=n(5052),o=n(4117),a=n(3526),s=n(3140),l=n(3830),u=n(5946);function c(e){const t=Object.create(null),n=e.getSchema(),c=n?n.getDirectives():u.V4;for(const e of c)t[e.name]=e.locations;const d=e.getDocument().definitions;for(const e of d)e.kind===l.h.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(n,u,c,d,f){const p=n.name.value,h=t[p];if(!h)return void e.reportError(new o.__(`Unknown directive "@${p}".`,{nodes:n}));const m=function(e){const t=e[e.length-1];switch("kind"in t||(0,i.k)(!1),t.kind){case l.h.OPERATION_DEFINITION:return function(e){switch(e){case a.ku.QUERY:return s.B.QUERY;case a.ku.MUTATION:return s.B.MUTATION;case a.ku.SUBSCRIPTION:return s.B.SUBSCRIPTION}}(t.operation);case l.h.FIELD:return s.B.FIELD;case l.h.FRAGMENT_SPREAD:return s.B.FRAGMENT_SPREAD;case l.h.INLINE_FRAGMENT:return s.B.INLINE_FRAGMENT;case l.h.FRAGMENT_DEFINITION:return s.B.FRAGMENT_DEFINITION;case l.h.VARIABLE_DEFINITION:return s.B.VARIABLE_DEFINITION;case l.h.SCHEMA_DEFINITION:case l.h.SCHEMA_EXTENSION:return s.B.SCHEMA;case l.h.SCALAR_TYPE_DEFINITION:case l.h.SCALAR_TYPE_EXTENSION:return s.B.SCALAR;case l.h.OBJECT_TYPE_DEFINITION:case l.h.OBJECT_TYPE_EXTENSION:return s.B.OBJECT;case l.h.FIELD_DEFINITION:return s.B.FIELD_DEFINITION;case l.h.INTERFACE_TYPE_DEFINITION:case l.h.INTERFACE_TYPE_EXTENSION:return s.B.INTERFACE;case l.h.UNION_TYPE_DEFINITION:case l.h.UNION_TYPE_EXTENSION:return s.B.UNION;case l.h.ENUM_TYPE_DEFINITION:case l.h.ENUM_TYPE_EXTENSION:return s.B.ENUM;case l.h.ENUM_VALUE_DEFINITION:return s.B.ENUM_VALUE;case l.h.INPUT_OBJECT_TYPE_DEFINITION:case l.h.INPUT_OBJECT_TYPE_EXTENSION:return s.B.INPUT_OBJECT;case l.h.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||(0,i.k)(!1),t.kind===l.h.INPUT_OBJECT_TYPE_DEFINITION?s.B.INPUT_FIELD_DEFINITION:s.B.ARGUMENT_DEFINITION}default:(0,i.k)(!1,"Unexpected kind: "+(0,r.X)(t.kind))}}(f);m&&!h.includes(m)&&e.reportError(new o.__(`Directive "@${p}" may not be used on ${m}.`,{nodes:n}))}}}},1435:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});var r=n(4117);function i(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new r.__(`Unknown fragment "${n}".`,{nodes:t.name}))}}}},591:function(e,t,n){"use strict";n.d(t,{I:function(){return l}});var r=n(8063),i=n(3492),o=n(4117),a=n(9615),s=n(8078);function l(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(const t of e.getDocument().definitions)(0,a.zT)(t)&&(s[t.name.value]=!0);const l=[...Object.keys(n),...Object.keys(s)];return{NamedType(t,c,d,f,p){const h=t.name.value;if(!n[h]&&!s[h]){var m;const n=null!==(m=p[2])&&void 0!==m?m:d,s=null!=n&&"kind"in(g=n)&&((0,a.G4)(g)||(0,a.aU)(g));if(s&&u.includes(h))return;const c=(0,i.D)(h,s?u.concat(l):l);e.reportError(new o.__(`Unknown type "${h}".`+(0,r.l)(c),{nodes:t}))}var g}}}const u=[...n(1774).HS,...s.nL].map((e=>e.name))},831:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(4117),i=n(3830);function o(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===i.h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new r.__("This anonymous operation must be the only defined operation.",{nodes:n}))}}}},3402:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(4117);function i(e){var t,n,i;const o=e.getSchema(),a=null!==(t=null!==(n=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==n?n:null==o?void 0:o.getMutationType())&&void 0!==t?t:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(t){a?e.reportError(new r.__("Cannot define a new schema within a schema extension.",{nodes:t})):(s>0&&e.reportError(new r.__("Must provide only one schema definition.",{nodes:t})),++s)}}}},9316:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return o(e),!1}};function o(a){if(t[a.name.value])return;const s=a.name.value;t[s]=!0;const l=e.getFragmentSpreads(a.selectionSet);if(0!==l.length){i[s]=n.length;for(const t of l){const a=t.name.value,s=i[a];if(n.push(t),void 0===s){const t=e.getFragment(a);t&&o(t)}else{const t=n.slice(s),i=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.__(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}n.pop()}i[s]=void 0}}}},9518:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(4117);function i(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:o}of i){const i=o.name.value;!0!==t[i]&&e.reportError(new r.__(n.name?`Variable "$${i}" is not defined by operation "${n.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}},3447:function(e,t,n){"use strict";n.d(t,{J:function(){return i}});var r=n(4117);function i(e){const t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){const i=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))i[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==i[n]&&e.reportError(new r.__(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}},7114:function(e,t,n){"use strict";n.d(t,{p:function(){return i}});var r=n(4117);function i(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),o=e.getRecursiveVariableUsages(n);for(const{node:e}of o)i[e.name.value]=!0;for(const o of t){const t=o.variable.name.value;!0!==i[t]&&e.reportError(new r.__(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:o}))}}},VariableDefinition(e){t.push(e)}}}},7163:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(5648),i=n(4117),o=n(3830),a=n(5895),s=n(755),l=n(4034),u=n(5998);function c(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+c(t))).join(" and "):e}function d(e){const t=new T,n=new Map;return{SelectionSet(r){const o=function(e,t,n,r,i){const o=[],[a,s]=y(e,t,r,i);if(function(e,t,n,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,c,b)}}function g(e){var t;const n=null!==(t=e.arguments)&&void 0!==t?t:[],r={kind:o.h.OBJECT,fields:n.map((e=>({kind:o.h.OBJECT_FIELD,name:e.name,value:e.value})))};return(0,a.S)((0,l.n)(r))}function v(e,t){return(0,s.HG)(e)?!(0,s.HG)(t)||v(e.ofType,t.ofType):!!(0,s.HG)(t)||((0,s.zM)(e)?!(0,s.zM)(t)||v(e.ofType,t.ofType):!!(0,s.zM)(t)||!(!(0,s.UT)(e)&&!(0,s.UT)(t))&&e!==t)}function y(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);E(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function b(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=(0,u._)(e.getSchema(),n.typeCondition);return y(e,t,i,n.selectionSet)}function E(e,t,n,r,i){for(const a of n.selections)switch(a.kind){case o.h.FIELD:{const e=a.name.value;let n;((0,s.lp)(t)||(0,s.oT)(t))&&(n=t.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case o.h.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.h.INLINE_FRAGMENT:{const n=a.typeCondition,o=n?(0,u._)(e.getSchema(),n):t;E(e,o,a.selectionSet,r,i);break}}}class T{constructor(){this._data=new Map}has(e,t,n){var r;const[i,o]=ee.name.value)));for(const n of i.args)if(!a.has(n.name)&&(0,l.dK)(n)){const a=(0,r.X)(n.type);e.reportError(new o.__(`Field "${i.name}" argument "${n.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function d(e){var t;const n=Object.create(null),c=e.getSchema(),d=null!==(t=null==c?void 0:c.getDirectives())&&void 0!==t?t:u.V4;for(const e of d)n[e.name]=(0,i.P)(e.args.filter(l.dK),(e=>e.name));const p=e.getDocument().definitions;for(const e of p)if(e.kind===a.h.DIRECTIVE_DEFINITION){var h;const t=null!==(h=e.arguments)&&void 0!==h?h:[];n[e.name.value]=(0,i.P)(t.filter(f),(e=>e.name.value))}return{Directive:{leave(t){const i=t.name.value,a=n[i];if(a){var u;const n=null!==(u=t.arguments)&&void 0!==u?u:[],c=new Set(n.map((e=>e.name.value)));for(const[n,u]of Object.entries(a))if(!c.has(n)){const a=(0,l.P9)(u.type)?(0,r.X)(u.type):(0,s.S)(u.type);e.reportError(new o.__(`Directive "@${i}" argument "${n}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}}function f(e){return e.type.kind===a.h.NON_NULL_TYPE&&null==e.defaultValue}},3989:function(e,t,n){"use strict";n.d(t,{O:function(){return a}});var r=n(5648),i=n(4117),o=n(755);function a(e){return{Field(t){const n=e.getType(),a=t.selectionSet;if(n)if((0,o.UT)((0,o.xC)(n))){if(a){const o=t.name.value,s=(0,r.X)(n);e.reportError(new i.__(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=t.name.value,a=(0,r.X)(n);e.reportError(new i.__(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:t}))}}}}},9309:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(4117),i=n(3830),o=n(5267);function a(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),a=n.getSubscriptionType();if(a){const s=t.name?t.name.value:null,l=Object.create(null),u=e.getDocument(),c=Object.create(null);for(const e of u.definitions)e.kind===i.h.FRAGMENT_DEFINITION&&(c[e.name.value]=e);const d=(0,o.g)(n,c,l,a,t.selectionSet);if(d.size>1){const t=[...d.values()].slice(1).flat();e.reportError(new r.__(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new r.__(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}},5947:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const o=(0,r.v)(n,(e=>e.name.value));for(const[n,r]of o)r.length>1&&e.reportError(new i.__(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}}},9168:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{Field:t,Directive:t};function t(t){var n;const o=null!==(n=t.arguments)&&void 0!==n?n:[],a=(0,r.v)(o,(e=>e.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.__(`There can be only one argument named "${t}".`,{nodes:n.map((e=>e.name))}))}}},5681:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==n||!n.getDirective(o))return t[o]?e.reportError(new r.__(`There can be only one directive named "@${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.__(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}}},5673:function(e,t,n){"use strict";n.d(t,{k:function(){return s}});var r=n(4117),i=n(3830),o=n(9615),a=n(5946);function s(e){const t=Object.create(null),n=e.getSchema(),s=n?n.getDirectives():a.V4;for(const e of s)t[e.name]=!e.isRepeatable;const l=e.getDocument().definitions;for(const e of l)e.kind===i.h.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const u=Object.create(null),c=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let a;if(n.kind===i.h.SCHEMA_DEFINITION||n.kind===i.h.SCHEMA_EXTENSION)a=u;else if((0,o.zT)(n)||(0,o.D$)(n)){const e=n.name.value;a=c[e],void 0===a&&(c[e]=a=Object.create(null))}else a=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(a[n]?e.reportError(new r.__(`The directive "@${n}" can only be used once at this location.`,{nodes:[a[n],i]})):a[n]=i)}}}}},4560:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(4117),i=n(755);function o(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(t){var a;const s=t.name.value;o[s]||(o[s]=Object.create(null));const l=null!==(a=t.values)&&void 0!==a?a:[],u=o[s];for(const t of l){const o=t.name.value,a=n[s];(0,i.EM)(a)&&a.getValue(o)?e.reportError(new r.__(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[o]?e.reportError(new r.__(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[u[o],t.name]})):u[o]=t.name}return!1}}},5240:function(e,t,n){"use strict";n.d(t,{y:function(){return o}});var r=n(4117),i=n(755);function o(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:o,InputObjectTypeExtension:o,InterfaceTypeDefinition:o,InterfaceTypeExtension:o,ObjectTypeDefinition:o,ObjectTypeExtension:o};function o(t){var o;const s=t.name.value;i[s]||(i[s]=Object.create(null));const l=null!==(o=t.fields)&&void 0!==o?o:[],u=i[s];for(const t of l){const i=t.name.value;a(n[s],i)?e.reportError(new r.__(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[i]?e.reportError(new r.__(`Field "${s}.${i}" can only be defined once.`,{nodes:[u[i],t.name]})):u[i]=t.name}return!1}}function a(e,t){return!!((0,i.lp)(e)||(0,i.oT)(e)||(0,i.hL)(e))&&null!=e.getFields()[t]}},614:function(e,t,n){"use strict";n.d(t,{N:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new r.__(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}},5707:function(e,t,n){"use strict";n.d(t,{P:function(){return o}});var r=n(5052),i=n(4117);function o(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||(0,r.k)(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new i.__(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}},2355:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new r.__(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}},5427:function(e,t,n){"use strict";n.d(t,{q:function(){return i}});var r=n(4117);function i(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(t){var o;const a=null!==(o=t.operationTypes)&&void 0!==o?o:[];for(const t of a){const o=t.operation,a=n[o];i[o]?e.reportError(new r.__(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new r.__(`There can be only one ${o} type in schema.`,{nodes:[a,t]})):n[o]=t}return!1}}},4519:function(e,t,n){"use strict";n.d(t,{P:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==n||!n.getType(o))return t[o]?e.reportError(new r.__(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.__(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}}},7417:function(e,t,n){"use strict";n.d(t,{H:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{OperationDefinition(t){var n;const o=null!==(n=t.variableDefinitions)&&void 0!==n?n:[],a=(0,r.v)(o,(e=>e.variable.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.__(`There can be only one variable named "$${t}".`,{nodes:n.map((e=>e.variable.name))}))}}}},4697:function(e,t,n){"use strict";n.d(t,{j:function(){return c}});var r=n(8063),i=n(5648),o=n(9815),a=n(3492),s=n(4117),l=n(5895),u=n(755);function c(e){return{ListValue(t){const n=(0,u.tf)(e.getParentInputType());if(!(0,u.HG)(n))return d(e,t),!1},ObjectValue(t){const n=(0,u.xC)(e.getInputType());if(!(0,u.hL)(n))return d(e,t),!1;const r=(0,o.P)(t.fields,(e=>e.name.value));for(const o of Object.values(n.getFields()))if(!r[o.name]&&(0,u.Wd)(o)){const r=(0,i.X)(o.type);e.reportError(new s.__(`Field "${n.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:t}))}},ObjectField(t){const n=(0,u.xC)(e.getParentInputType());if(!e.getInputType()&&(0,u.hL)(n)){const i=(0,a.D)(t.name.value,Object.keys(n.getFields()));e.reportError(new s.__(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,r.l)(i),{nodes:t}))}},NullValue(t){const n=e.getInputType();(0,u.zM)(n)&&e.reportError(new s.__(`Expected value of type "${(0,i.X)(n)}", found ${(0,l.S)(t)}.`,{nodes:t}))},EnumValue:t=>d(e,t),IntValue:t=>d(e,t),FloatValue:t=>d(e,t),StringValue:t=>d(e,t),BooleanValue:t=>d(e,t)}}function d(e,t){const n=e.getInputType();if(!n)return;const r=(0,u.xC)(n);if((0,u.UT)(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=(0,i.X)(n);e.reportError(new s.__(`Expected value of type "${r}", found ${(0,l.S)(t)}.`,{nodes:t}))}}catch(r){const o=(0,i.X)(n);r instanceof s.__?e.reportError(r):e.reportError(new s.__(`Expected value of type "${o}", found ${(0,l.S)(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=(0,i.X)(n);e.reportError(new s.__(`Expected value of type "${r}", found ${(0,l.S)(t)}.`,{nodes:t}))}}},6192:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});var r=n(4117),i=n(5895),o=n(755),a=n(5998);function s(e){return{VariableDefinition(t){const n=(0,a._)(e.getSchema(),t.type);if(void 0!==n&&!(0,o.j$)(n)){const n=t.variable.name.value,o=(0,i.S)(t.type);e.reportError(new r.__(`Variable "$${n}" cannot be non-input type "${o}".`,{nodes:t.type}))}}}}},377:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r=n(5648),i=n(4117),o=n(3830),a=n(755),s=n(2984),l=n(5998);function u(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const o=e.getRecursiveVariableUsages(n);for(const{node:n,type:a,defaultValue:s}of o){const o=n.name.value,u=t[o];if(u&&a){const t=e.getSchema(),d=(0,l._)(t,u.type);if(d&&!c(t,d,u.defaultValue,a,s)){const t=(0,r.X)(d),s=(0,r.X)(a);e.reportError(new i.__(`Variable "$${o}" of type "${t}" used in position expecting type "${s}".`,{nodes:[u,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function c(e,t,n,r,i){if((0,a.zM)(r)&&!(0,a.zM)(t)){if((null==n||n.kind===o.h.NULL)&&void 0===i)return!1;const a=r.ofType;return(0,s.uJ)(e,t,a)}return(0,s.uJ)(e,t,r)}},9299:function(e,t,n){"use strict";n.d(t,{M:function(){return j},i:function(){return P}});var r=n(3857),i=n(1870),o=n(5167),a=n(4875),s=n(7513),l=n(1435),u=n(591),c=n(831),d=n(3402),f=n(9316),p=n(9518),h=n(3447),m=n(7114),g=n(7163),v=n(5961),y=n(3721),b=n(16),E=n(3989),T=n(9309),w=n(5947),C=n(9168),S=n(5681),x=n(5673),N=n(4560),k=n(5240),_=n(614),O=n(5707),I=n(2355),D=n(5427),L=n(4519),A=n(7417),M=n(4697),R=n(6192),F=n(377);const P=Object.freeze([r.i,I.H,c.F,T.Z,u.I,o.T,R.I,E.O,i.A,_.N,l.a,h.J,v.a,f.H,A.H,p.$,m.p,s.J,x.k,a.e,C.L,M.j,b.s,F.w,g.y,O.P]),j=Object.freeze([d.t,D.q,L.P,N.L,k.y,w.L,S.o,u.I,s.J,x.k,y.g,a.o,C.L,O.P,b.c])},2780:function(e,t,n){"use strict";n.d(t,{ED:function(){return p},Gu:function(){return c},zo:function(){return f}});var r=n(1172),i=n(4117),o=n(9685),a=n(8555),s=n(1409),l=n(9299),u=n(2716);function c(e,t,n=l.i,c,d=new s.a(e)){var f;const p=null!==(f=null==c?void 0:c.maxErrors)&&void 0!==f?f:100;t||(0,r.a)(!1,"Must provide document."),(0,a.J)(e);const h=Object.freeze({}),m=[],g=new u._t(e,t,d,(e=>{if(m.length>=p)throw m.push(new i.__("Too many validation errors, error limit reached. Validation aborted.")),h;m.push(e)})),v=(0,o.j1)(n.map((e=>e(g))));try{(0,o.Vn)(t,(0,s.y)(d,v))}catch(e){if(e!==h)throw e}return m}function d(e,t,n=l.M){const r=[],i=new u.yv(e,t,(e=>{r.push(e)})),a=n.map((e=>e(i)));return(0,o.Vn)(e,(0,o.j1)(a)),r}function f(e){const t=d(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}function p(e,t){const n=d(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}},8488:function(e,t,n){"use strict";n.r(t),n.d(t,{meros:function(){return o}});const r="\r\n\r\n",i=new TextDecoder;async function o(e,t){if(!e.ok||!e.body||e.bodyUsed)return e;const n=e.headers.get("content-type");if(!n||!~n.indexOf("multipart/mixed"))return e;const o=n.indexOf("boundary=");return async function*(e,t,n){const o=e.getReader(),a=!n||!n.multiple;let s="",l=!0,u=[];try{let e;e:for(;!(e=await o.read()).done;){const n=i.decode(e.value),o=n.indexOf(t);let c=s.length;for(s+=n,~o?c+=o:c=s.indexOf(t),u=[];~c;){const e=s.substring(0,c),n=s.substring(c+t.length);if(l)l=!1;else{const t={},i=e.indexOf(r),o=s.slice(0,i).toString().trim().split(/\r\n/);let l;for(;l=o.shift();)l=l.split(": "),t[l.shift().toLowerCase()]=l.join(": ");let c=e.substring(i+r.length,e.lastIndexOf("\r\n")),d=!1;if(l=t["content-type"],l&&~l.indexOf("application/json"))try{c=JSON.parse(c),d=!0}catch(e){}if(l={headers:t,body:c,json:d},a?yield l:u.push(l),"--"===n.substring(0,2))break e}s=n,c=s.indexOf(t)}u.length&&(yield u)}}finally{u.length&&(yield u),o.releaseLock()}}(e.body,`--${~o?n.substring(o+9).trim().replace(/['"]/g,""):"-"}`,t)}},6785:function(e,t,n){"use strict";n.r(t)},5605:function(e,t,n){"use strict";n.r(t)},2162:function(e,t,n){"use strict";n.r(t)},5251:function(e,t,n){"use strict";n.r(t)},9196:function(e){"use strict";e.exports=window.React},1850:function(e){"use strict";e.exports=window.ReactDOM}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e].call(o.exports,o,o.exports,i),o.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){a[e]=function(){return n[e]}}));return a.default=function(){return n},i.d(o,a),o},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var o=i(6676);window.GraphiQL=o.default}(); +//# sourceMappingURL=graphiql.min.js.map \ No newline at end of file diff --git a/app/assets/stylesheets/graphiql/rails/application.css b/app/assets/stylesheets/graphiql/rails/application.css index 5814113..a0a0796 100644 --- a/app/assets/stylesheets/graphiql/rails/application.css +++ b/app/assets/stylesheets/graphiql/rails/application.css @@ -1,5 +1,5 @@ /* - = require ./graphiql-2.4.0 + = require ./graphiql-2.4.1 */ html, body, #graphiql-container { diff --git a/app/assets/stylesheets/graphiql/rails/graphiql-2.4.0.css b/app/assets/stylesheets/graphiql/rails/graphiql-2.4.1.css similarity index 97% rename from app/assets/stylesheets/graphiql/rails/graphiql-2.4.0.css rename to app/assets/stylesheets/graphiql/rails/graphiql-2.4.1.css index 9b9b560..5214522 100644 --- a/app/assets/stylesheets/graphiql/rails/graphiql-2.4.0.css +++ b/app/assets/stylesheets/graphiql/rails/graphiql-2.4.1.css @@ -1,6 +1,3 @@ -/*!*********************************************************************************************!*\ - !*** css ../../../node_modules/css-loader/dist/cjs.js!../../graphiql-react/font/roboto.css ***! - \*********************************************************************************************/ @font-face { font-family: Roboto; font-style: italic; @@ -274,9 +271,6 @@ U+FEFF, U+FFFD; } -/*!************************************************************************************************!*\ - !*** css ../../../node_modules/css-loader/dist/cjs.js!../../graphiql-react/font/fira-code.css ***! - \************************************************************************************************/ @font-face { font-family: Fira Code; font-style: normal; @@ -336,316 +330,8 @@ U+FEFF, U+FFFD; } -/*!********************************************************************************************!*\ - !*** css ../../../node_modules/css-loader/dist/cjs.js!../../graphiql-react/dist/style.css ***! - \********************************************************************************************/ .graphiql-container *{box-sizing:border-box}.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal{--color-primary: 320, 95%, 43%;--color-secondary: 242, 51%, 61%;--color-tertiary: 188, 100%, 36%;--color-info: 208, 100%, 46%;--color-success: 158, 60%, 42%;--color-warning: 36, 100%, 41%;--color-error: 13, 93%, 58%;--color-neutral: 219, 28%, 32%;--color-base: 219, 28%, 100%;--alpha-secondary: .76;--alpha-tertiary: .5;--alpha-background-heavy: .15;--alpha-background-medium: .1;--alpha-background-light: .07;--font-family: "Roboto", sans-serif;--font-family-mono: "Fira Code", monospace;--font-size-hint:.75rem;--font-size-inline-code:.8125rem;--font-size-body:.9375rem;--font-size-h4:1.125rem;--font-size-h3:1.375rem;--font-size-h2:1.8125rem;--font-weight-regular: 400;--font-weight-medium: 500;--line-height: 1.5;--px-2: 2px;--px-4: 4px;--px-6: 6px;--px-8: 8px;--px-10: 10px;--px-12: 12px;--px-16: 16px;--px-20: 20px;--px-24: 24px;--border-radius-2: 2px;--border-radius-4: 4px;--border-radius-8: 8px;--border-radius-12: 12px;--popover-box-shadow: 0px 6px 20px rgba(59, 76, 106, .13), 0px 1.34018px 4.46726px rgba(59, 76, 106, .0774939), 0px .399006px 1.33002px rgba(59, 76, 106, .0525061);--popover-border: none;--sidebar-width: 60px;--toolbar-width: 40px;--session-header-height: 51px}@media (prefers-color-scheme: dark){body:not(.graphiql-light) .graphiql-container,body:not(.graphiql-light) .CodeMirror-info,body:not(.graphiql-light) .CodeMirror-lint-tooltip,body:not(.graphiql-light) reach-portal{--color-primary: 338, 100%, 67%;--color-secondary: 243, 100%, 77%;--color-tertiary: 188, 100%, 44%;--color-info: 208, 100%, 72%;--color-success: 158, 100%, 42%;--color-warning: 30, 100%, 80%;--color-error: 13, 100%, 58%;--color-neutral: 219, 29%, 78%;--color-base: 219, 29%, 18%;--popover-box-shadow: none;--popover-border: 1px solid hsl(var(--color-neutral))}}body.graphiql-dark .graphiql-container,body.graphiql-dark .CodeMirror-info,body.graphiql-dark .CodeMirror-lint-tooltip,body.graphiql-dark reach-portal{--color-primary: 338, 100%, 67%;--color-secondary: 243, 100%, 77%;--color-tertiary: 188, 100%, 44%;--color-info: 208, 100%, 72%;--color-success: 158, 100%, 42%;--color-warning: 30, 100%, 80%;--color-error: 13, 100%, 58%;--color-neutral: 219, 29%, 78%;--color-base: 219, 29%, 18%;--popover-box-shadow: none;--popover-border: 1px solid hsl(var(--color-neutral))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal),:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal):is(button){color:hsla(var(--color-neutral),1);font-family:var(--font-family);font-size:var(--font-size-body);font-weight:var(----font-weight-regular);line-height:var(--line-height)}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) input{color:hsla(var(--color-neutral),1);font-family:var(--font-family);font-size:var(--font-size-caption)}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) input::placeholder{color:hsla(var(--color-neutral),var(--alpha-secondary))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) a{color:hsl(var(--color-primary))}:is(.graphiql-container,.CodeMirror-info,.CodeMirror-lint-tooltip,reach-portal) a:focus{outline:hsl(var(--color-primary)) auto 1px}.graphiql-un-styled,button.graphiql-un-styled{all:unset;border-radius:var(--border-radius-4);cursor:pointer}:is(.graphiql-un-styled,button.graphiql-un-styled):hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}:is(.graphiql-un-styled,button.graphiql-un-styled):active{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}:is(.graphiql-un-styled,button.graphiql-un-styled):focus{outline:hsla(var(--color-neutral),var(--alpha-background-heavy)) auto 1px}.graphiql-button,button.graphiql-button{background-color:hsla(var(--color-neutral),var(--alpha-background-light));border:none;border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),1);cursor:pointer;font-size:var(--font-size-body);padding:var(--px-8) var(--px-12)}:is(.graphiql-button,button.graphiql-button):hover,:is(.graphiql-button,button.graphiql-button):active{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}:is(.graphiql-button,button.graphiql-button):focus{outline:hsla(var(--color-neutral),var(--alpha-background-heavy)) auto 1px}.graphiql-button-success:is(.graphiql-button,button.graphiql-button){background-color:hsla(var(--color-success),var(--alpha-background-heavy))}.graphiql-button-error:is(.graphiql-button,button.graphiql-button){background-color:hsla(var(--color-error),var(--alpha-background-heavy))}.graphiql-button-group{background-color:hsla(var(--color-neutral),var(--alpha-background-light));border-radius:calc(var(--border-radius-4) + var(--px-4));display:flex;padding:var(--px-4)}.graphiql-button-group>button.graphiql-button{background-color:transparent}.graphiql-button-group>button.graphiql-button:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}.graphiql-button-group>button.graphiql-button.active{background-color:hsl(var(--color-base));cursor:default}.graphiql-button-group>*+*{margin-left:var(--px-8)}:root{--reach-dialog: 1}[data-reach-dialog-overlay]{background:hsla(0,0%,0%,.33);position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}[data-reach-dialog-content]{width:50vw;margin:10vh auto;background:white;padding:2rem;outline:none}[data-reach-dialog-overlay]{align-items:center;background-color:hsla(var(--color-neutral),var(--alpha-background-heavy));display:flex;justify-content:center;z-index:10}[data-reach-dialog-content]{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-12);box-shadow:var(--popover-box-shadow);margin:0;max-height:80vh;max-width:80vw;overflow:auto;padding:0;width:unset}.graphiql-dialog-close>svg{color:hsla(var(--color-neutral),var(--alpha-secondary));display:block;height:var(--px-12);padding:var(--px-12);width:var(--px-12)}:root{--reach-listbox: 1}[data-reach-listbox-popover]{display:block;position:absolute;min-width:-moz-fit-content;min-width:-webkit-min-content;min-width:min-content;padding:.25rem 0;background:hsl(0,0%,100%);outline:none;border:solid 1px hsla(0,0%,0%,.25)}[data-reach-listbox-popover]:focus-within{box-shadow:0 0 4px Highlight;outline:-webkit-focus-ring-color auto 4px}[data-reach-listbox-popover][hidden]{display:none}[data-reach-listbox-list]{margin:0;padding:0;list-style:none}[data-reach-listbox-list]:focus{box-shadow:none;outline:none}[data-reach-listbox-option]{display:block;margin:0;padding:.25rem .5rem;white-space:nowrap;user-select:none}[data-reach-listbox-option][data-current-nav]{background:hsl(211,81%,46%);color:#fff}[data-reach-listbox-option][data-current-selected]{font-weight:bolder}[data-reach-listbox-option][data-current-selected][data-confirming]{animation:flash .1s;animation-iteration-count:1}[data-reach-listbox-option][aria-disabled=true]{opacity:.5}[data-reach-listbox-button]{display:inline-flex;align-items:center;justify-content:space-between;padding:1px 10px 2px;border:1px solid;border-color:rgb(216,216,216) rgb(209,209,209) rgb(186,186,186);cursor:default;user-select:none}[data-reach-listbox-button][aria-disabled=true]{opacity:.5}[data-reach-listbox-arrow]{margin-left:.5rem;display:block;font-size:.5em}[data-reach-listbox-group-label]{display:block;margin:0;padding:.25rem .5rem;white-space:nowrap;user-select:none;font-weight:bolder}@keyframes flash{0%{background:hsla(211,81%,36%,1);color:#fff;opacity:1}50%{opacity:.5;background:inherit;color:inherit}to{background:hsla(211,81%,36%,1);color:#fff;opacity:1}}:root{--reach-menu-button: 1}[data-reach-menu]{position:relative}[data-reach-menu-popover]{display:block;position:absolute}[data-reach-menu-popover][hidden]{display:none}[data-reach-menu-list],[data-reach-menu-items]{display:block;white-space:nowrap;border:solid 1px hsla(0,0%,0%,.25);background:hsla(0,100%,100%,.99);outline:none;padding:1rem 0;font-size:85%}[data-reach-menu-item]{display:block;user-select:none}[data-reach-menu-item]{cursor:pointer;display:block;color:inherit;font:inherit;text-decoration:initial;padding:5px 20px}[data-reach-menu-item][data-selected]{background:hsl(211,81%,36%);color:#fff;outline:none}[data-reach-menu-item][aria-disabled]{opacity:.5;cursor:not-allowed}[data-reach-listbox-popover],[data-reach-menu-list]{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);font-size:inherit;max-width:250px;padding:var(--px-4)}[data-reach-listbox-option],[data-reach-menu-item]{border-radius:var(--border-radius-4);font-size:inherit;margin:var(--px-4);overflow:hidden;padding:var(--px-6) var(--px-8);text-overflow:ellipsis;white-space:nowrap}[data-reach-listbox-option][data-selected],[data-reach-menu-item][data-selected],[data-reach-listbox-option][data-current-nav],[data-reach-menu-item][data-current-nav],[data-reach-listbox-option]:hover,[data-reach-menu-item]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-light));color:inherit}[data-reach-listbox-option]:not(:first-child),[data-reach-menu-item]:not(:first-child){margin-top:0}[data-reach-listbox-button]{border:none;cursor:pointer;padding:0}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) blockquote{margin-left:0;margin-right:0;padding-left:var(--px-8)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) code,:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre{border-radius:var(--border-radius-4);font-family:var(--font-family-mono);font-size:var(--font-size-inline-code)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) code{padding:var(--px-2)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre{overflow:auto;padding:var(--px-6) var(--px-8)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) pre code{background-color:initial;border-radius:0;padding:0}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ol,:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ul{padding-left:var(--px-16)}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ol{list-style-type:decimal}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) ul{list-style-type:disc}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation) img{border-radius:var(--border-radius-4);max-height:120px;max-width:100%}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation)>:first-child{margin-top:0}:is(.graphiql-markdown-description,.graphiql-markdown-deprecation,.CodeMirror-hint-information-description,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-description,.CodeMirror-info .info-deprecation)>:last-child{margin-bottom:0}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) a{color:hsl(var(--color-primary));text-decoration:none}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) a:hover{text-decoration:underline}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) blockquote{border-left:1.5px solid hsla(var(--color-neutral),var(--alpha-tertiary))}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) code,:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description) pre{background-color:hsla(var(--color-neutral),var(--alpha-background-light));color:hsla(var(--color-neutral),1)}:is(.graphiql-markdown-description,.CodeMirror-hint-information-description,.CodeMirror-info .info-description)>*{margin:var(--px-12) 0}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) a{color:hsl(var(--color-warning));text-decoration:underline}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) blockquote{border-left:1.5px solid hsl(var(--color-warning))}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) code,:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation) pre{background-color:hsla(var(--color-warning),var(--alpha-background-heavy))}:is(.graphiql-markdown-deprecation,.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation)>*{margin:var(--px-8) 0}.graphiql-markdown-preview>:not(:first-child){display:none}.CodeMirror-hint-information-deprecation,.CodeMirror-info .info-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--border-radius-4);color:hsl(var(--color-warning));margin-top:var(--px-12);padding:var(--px-6) var(--px-8)}.CodeMirror-hint-information-deprecation-label,.CodeMirror-info .info-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}.CodeMirror-hint-information-deprecation-reason,.CodeMirror-info .info-deprecation-reason{margin-top:var(--px-6)}.graphiql-spinner{height:56px;margin:auto;margin-top:var(--px-16);width:56px}.graphiql-spinner:after{animation:rotation .8s linear 0s infinite;border:4px solid transparent;border-radius:100%;border-top:4px solid hsla(var(--color-neutral),var(--alpha-tertiary));content:"";display:inline-block;height:46px;vertical-align:middle;width:46px}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:root{--reach-tooltip: 1}[data-reach-tooltip]{z-index:1;pointer-events:none;position:absolute;padding:.25em .5em;box-shadow:2px 2px 10px #0000001a;white-space:nowrap;font-size:85%;background:#f0f0f0;color:#444;border:solid 1px #ccc}[data-reach-tooltip]{background:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-4);box-shadow:var(--popover-box-shadow);color:hsl(var(--color-neutral));font-size:inherit;padding:var(--px-4) var(--px-6)}.graphiql-tabs{display:flex;overflow-x:auto;padding:var(--px-12)}.graphiql-tabs>:not(:first-child){margin-left:var(--px-12)}.graphiql-tab{align-items:stretch;border-radius:var(--border-radius-8);color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex}.graphiql-tab>button.graphiql-tab-close{visibility:hidden}.graphiql-tab.graphiql-tab-active>button.graphiql-tab-close,.graphiql-tab:hover>button.graphiql-tab-close,.graphiql-tab:focus-within>button.graphiql-tab-close{visibility:unset}.graphiql-tab.graphiql-tab-active{background-color:hsla(var(--color-neutral),var(--alpha-background-heavy));color:hsla(var(--color-neutral),1)}button.graphiql-tab-button{padding:var(--px-4) 0 var(--px-4) var(--px-8)}button.graphiql-tab-close{align-items:center;display:flex;padding:var(--px-4) var(--px-8)}button.graphiql-tab-close>svg{height:var(--px-8);width:var(--px-8)}.graphiql-history-header{font-size:var(--font-size-h2);font-weight:var(--font-weight-medium)}.graphiql-history-items{margin:var(--px-16) 0 0;list-style:none;padding:0}.graphiql-history-item{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;font-size:var(--font-size-inline-code);font-family:var(--font-family-mono);height:34px}.graphiql-history-item:hover{color:hsla(var(--color-neutral),1);background-color:hsla(var(--color-neutral),var(--alpha-background-light))}.graphiql-history-item:not(:first-child){margin-top:var(--px-4)}.graphiql-history-item.editable{background-color:hsla(var(--color-primary),var(--alpha-background-medium))}.graphiql-history-item.editable>input{background:transparent;border:none;flex:1;margin:0;outline:none;padding:0 var(--px-10);width:100%}.graphiql-history-item.editable>input::placeholder{color:hsla(var(--color-neutral),var(--alpha-secondary))}.graphiql-history-item.editable>button{color:hsl(var(--color-primary));padding:0 var(--px-10)}.graphiql-history-item.editable>button:active{background-color:hsla(var(--color-primary),var(--alpha-background-heavy))}.graphiql-history-item.editable>button:focus{outline:hsl(var(--color-primary)) auto 1px}.graphiql-history-item.editable>button>svg{display:block}button.graphiql-history-item-label{flex:1;padding:var(--px-8) var(--px-10);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button.graphiql-history-item-action{align-items:center;color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;padding:var(--px-8) var(--px-6)}button.graphiql-history-item-action:hover{color:hsla(var(--color-neutral),1)}button.graphiql-history-item-action>svg{height:14px;width:14px}.graphiql-history-item-spacer{height:var(--px-16)}.graphiql-doc-explorer-default-value{color:hsl(var(--color-success))}a.graphiql-doc-explorer-type-name{color:hsl(var(--color-warning));text-decoration:none}a.graphiql-doc-explorer-type-name:hover{text-decoration:underline}a.graphiql-doc-explorer-type-name:focus{outline:hsl(var(--color-warning)) auto 1px}.graphiql-doc-explorer-argument>*+*{margin-top:var(--px-12)}.graphiql-doc-explorer-argument-name{color:hsl(var(--color-secondary))}.graphiql-doc-explorer-argument-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--border-radius-4);color:hsl(var(--color-warning));padding:var(--px-8)}.graphiql-doc-explorer-argument-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}.graphiql-doc-explorer-deprecation{background-color:hsla(var(--color-warning),var(--alpha-background-light));border:1px solid hsl(var(--color-warning));border-radius:var(--px-4);color:hsl(var(--color-warning));padding:var(--px-8)}.graphiql-doc-explorer-deprecation-label{font-size:var(--font-size-hint);font-weight:var(--font-weight-medium)}.graphiql-doc-explorer-directive{color:hsl(var(--color-secondary))}.graphiql-doc-explorer-section-title{align-items:center;display:flex;font-size:var(--font-size-hint);font-weight:var(--font-weight-medium);line-height:1}.graphiql-doc-explorer-section-title>svg{height:var(--px-16);margin-right:var(--px-8);width:var(--px-16)}.graphiql-doc-explorer-section-content{margin-left:var(--px-8);margin-top:var(--px-16)}.graphiql-doc-explorer-section-content>*+*{margin-top:var(--px-16)}.graphiql-doc-explorer-root-type{color:hsl(var(--color-info))}:root{--reach-combobox: 1}[data-reach-combobox-popover]{border:solid 1px hsla(0,0%,0%,.25);background:hsla(0,100%,100%,.99);font-size:85%}[data-reach-combobox-list]{list-style:none;margin:0;padding:0;user-select:none}[data-reach-combobox-option]{cursor:pointer;margin:0;padding:.25rem .5rem}[data-reach-combobox-option][aria-selected=true]{background:hsl(211,10%,95%)}[data-reach-combobox-option]:hover{background:hsl(211,10%,92%)}[data-reach-combobox-option][aria-selected=true]:hover{background:hsl(211,10%,90%)}[data-suggested-value]{font-weight:700}[data-reach-combobox]{color:hsla(var(--color-neutral),var(--alpha-secondary))}[data-reach-combobox]:not([data-state="idle"]){border:var(--popover-border);border-radius:var(--border-radius-4);box-shadow:var(--popover-box-shadow);color:hsla(var(--color-neutral),1)}[data-reach-combobox]:not([data-state="idle"]) .graphiql-doc-explorer-search-input{background:hsl(var(--color-base));border-bottom-left-radius:0;border-bottom-right-radius:0}.graphiql-doc-explorer-search-input{align-items:center;background-color:hsla(var(--color-neutral),var(--alpha-background-light));border-radius:var(--border-radius-4);display:flex;padding:var(--px-8) var(--px-12)}[data-reach-combobox-input]{border:none;background-color:transparent;margin-left:var(--px-4);width:100%}[data-reach-combobox-input]:focus{outline:none}[data-reach-combobox-popover]{background-color:hsl(var(--color-base));border:none;border-bottom-left-radius:var(--border-radius-4);border-bottom-right-radius:var(--border-radius-4);border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));max-height:400px;overflow-y:auto;position:relative}[data-reach-combobox-list]{font-size:var(--font-size-body);padding:var(--px-4)}[data-reach-combobox-option]{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));overflow-x:hidden;padding:var(--px-8) var(--px-12);text-overflow:ellipsis;white-space:nowrap}[data-reach-combobox-option][data-highlighted]{background-color:hsla(var(--color-neutral),var(--alpha-background-light))}[data-reach-combobox-option]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-medium))}[data-reach-combobox-option][data-highlighted]:hover{background-color:hsla(var(--color-neutral),var(--alpha-background-heavy))}[data-reach-combobox-option]+[data-reach-combobox-option]{margin-top:var(--px-4)}.graphiql-doc-explorer-search-type{color:hsl(var(--color-info))}.graphiql-doc-explorer-search-field{color:hsl(var(--color-warning))}.graphiql-doc-explorer-search-argument{color:hsl(var(--color-secondary))}.graphiql-doc-explorer-search-divider{color:hsla(var(--color-neutral),var(--alpha-secondary));font-size:var(--font-size-hint);font-weight:var(--font-weight-medium);margin-top:var(--px-8);padding:var(--px-8) var(--px-12)}.graphiql-doc-explorer-search-empty{color:hsla(var(--color-neutral),var(--alpha-secondary));padding:var(--px-8) var(--px-12)}a.graphiql-doc-explorer-field-name{color:hsl(var(--color-info));text-decoration:none}a.graphiql-doc-explorer-field-name:hover{text-decoration:underline}a.graphiql-doc-explorer-field-name:focus{outline:hsl(var(--color-info)) auto 1px}.graphiql-doc-explorer-item>:not(:first-child){margin-top:var(--px-12)}.graphiql-doc-explorer-argument-multiple{margin-left:var(--px-8)}.graphiql-doc-explorer-enum-value{color:hsl(var(--color-info))}.graphiql-doc-explorer-header{display:flex;justify-content:space-between;position:relative}.graphiql-doc-explorer-header:focus-within .graphiql-doc-explorer-title{visibility:hidden}.graphiql-doc-explorer-header:focus-within .graphiql-doc-explorer-back:not(:focus){color:transparent}.graphiql-doc-explorer-header-content{display:flex;flex-direction:column;min-width:0}.graphiql-doc-explorer-search{height:100%;position:absolute;right:0;top:0}.graphiql-doc-explorer-search:focus-within{left:0}.graphiql-doc-explorer-search [data-reach-combobox-input]{height:24px;width:4ch}.graphiql-doc-explorer-search [data-reach-combobox-input]:focus{width:100%}a.graphiql-doc-explorer-back{align-items:center;color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;text-decoration:none}a.graphiql-doc-explorer-back:hover{text-decoration:underline}a.graphiql-doc-explorer-back:focus{outline:hsla(var(--color-neutral),var(--alpha-secondary)) auto 1px}a.graphiql-doc-explorer-back:focus+.graphiql-doc-explorer-title{visibility:unset}a.graphiql-doc-explorer-back>svg{height:var(--px-8);margin-right:var(--px-8);width:var(--px-8)}.graphiql-doc-explorer-title{font-weight:var(--font-weight-medium);font-size:var(--font-size-h2);overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.graphiql-doc-explorer-title:not(:first-child){font-size:var(--font-size-h3);margin-top:var(--px-8)}.graphiql-doc-explorer-content>*{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-20)}.graphiql-doc-explorer-error{background-color:hsla(var(--color-error),var(--alpha-background-heavy));border:1px solid hsl(var(--color-error));border-radius:var(--border-radius-8);color:hsl(var(--color-error));padding:var(--px-8) var(--px-12)}.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror{height:100%;position:absolute;width:100%}.CodeMirror{font-family:var(--font-family-mono)}.CodeMirror,.CodeMirror-gutters{background:none;background-color:var(--editor-background, hsl(var(--color-base)))}.CodeMirror-linenumber{padding:0}.CodeMirror-gutters{border:none}.cm-s-graphiql{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-keyword{color:hsl(var(--color-primary))}.cm-s-graphiql .cm-def{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-punctuation{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-variable{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-atom{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-number{color:hsl(var(--color-success))}.cm-s-graphiql .cm-string{color:hsl(var(--color-warning))}.cm-s-graphiql .cm-builtin{color:hsl(var(--color-success))}.cm-s-graphiql .cm-string-2{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-attribute,.cm-s-graphiql .cm-meta{color:hsl(var(--color-tertiary))}.cm-s-graphiql .cm-property{color:hsl(var(--color-info))}.cm-s-graphiql .cm-qualifier{color:hsl(var(--color-secondary))}.cm-s-graphiql .cm-comment{color:hsla(var(--color-neutral),var(--alpha-secondary))}.cm-s-graphiql .cm-ws{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.cm-s-graphiql .cm-invalidchar{color:hsl(var(--color-error))}.cm-s-graphiql .CodeMirror-cursor{border-left:2px solid hsla(var(--color-neutral),var(--alpha-secondary))}.cm-s-graphiql .CodeMirror-linenumber{color:hsla(var(--color-neutral),var(--alpha-tertiary))}div.CodeMirror span.CodeMirror-matchingbracket,div.CodeMirror span.CodeMirror-nonmatchingbracket{color:hsl(var(--color-warning))}.CodeMirror-selected,.CodeMirror-focused .CodeMirror-selected{background:hsla(var(--color-neutral),var(--alpha-background-heavy))}.CodeMirror-dialog{background:inherit;color:inherit;left:0;right:0;overflow:hidden;padding:var(--px-2) var(--px-6);position:absolute;z-index:6}.CodeMirror-dialog-top{border-bottom:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));padding-bottom:var(--px-12);top:0}.CodeMirror-dialog-bottom{border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));bottom:0;padding-top:var(--px-12)}.CodeMirror-search-hint{display:none}.CodeMirror-dialog input{border:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));border-radius:var(--border-radius-4);padding:var(--px-4)}.CodeMirror-dialog input:focus{outline:hsl(var(--color-primary)) solid 2px}.cm-searching{background-color:hsla(var(--color-warning),var(--alpha-background-light));padding-bottom:1.5px;padding-top:.5px}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25be"}.CodeMirror-foldgutter-folded:after{content:"\25b8"}.CodeMirror-foldgutter{width:var(--px-12)}.CodeMirror-foldmarker{background-color:hsl(var(--color-info));border-radius:var(--border-radius-4);color:hsl(var(--color-base));font-family:inherit;margin:0 var(--px-4);padding:0 var(--px-8);text-shadow:none}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:hsla(var(--color-neutral),var(--alpha-tertiary))}.CodeMirror-foldgutter-open:after,.CodeMirror-foldgutter-folded:after{margin:0 var(--px-2)}.graphiql-editor{height:100%;position:relative;width:100%}.graphiql-editor.hidden{left:-9999px;position:absolute;top:-9999px;visibility:hidden}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px;color:#000;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:#b74c5114}.CodeMirror-lint-line-warning{background-color:#ffd3001a}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-repeat:repeat-x;background-size:10px 3px;background-position:0 95%}.cm-s-graphiql .CodeMirror-lint-mark-error{color:hsl(var(--color-error))}.CodeMirror-lint-mark-error{background-image:linear-gradient(45deg,transparent 65%,hsl(var(--color-error)) 80%,transparent 90%),linear-gradient(135deg,transparent 5%,hsl(var(--color-error)) 15%,transparent 25%),linear-gradient(135deg,transparent 45%,hsl(var(--color-error)) 55%,transparent 65%),linear-gradient(45deg,transparent 25%,hsl(var(--color-error)) 35%,transparent 50%)}.cm-s-graphiql .CodeMirror-lint-mark-warning{color:hsl(var(--color-warning))}.CodeMirror-lint-mark-warning{background-image:linear-gradient(45deg,transparent 65%,hsl(var(--color-warning)) 80%,transparent 90%),linear-gradient(135deg,transparent 5%,hsl(var(--color-warning)) 15%,transparent 25%),linear-gradient(135deg,transparent 45%,hsl(var(--color-warning)) 55%,transparent 65%),linear-gradient(45deg,transparent 25%,hsl(var(--color-warning)) 35%,transparent 50%)}.CodeMirror-lint-tooltip{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);font-size:var(--font-size-body);font-family:var(--font-family);max-width:600px;overflow:hidden;padding:var(--px-12)}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{background-image:none;padding:0}.CodeMirror-lint-message-error{color:hsl(var(--color-error))}.CodeMirror-lint-message-warning{color:hsl(var(--color-warning))}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-hints{background:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);display:grid;font-family:var(--font-family);font-size:var(--font-size-body);grid-template-columns:auto fit-content(300px);max-height:264px;padding:0}.CodeMirror-hint{border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));grid-column:1 / 2;margin:var(--px-4);padding:var(--px-6) var(--px-8)!important}.CodeMirror-hint:not(:first-child){margin-top:0}li.CodeMirror-hint-active{background:hsla(var(--color-primary),var(--alpha-background-medium));color:hsl(var(--color-primary))}.CodeMirror-hint-information{border-left:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));grid-column:2 / 3;grid-row:1 / 99999;max-height:264px;overflow:auto;padding:var(--px-12)}.CodeMirror-hint-information-header{display:flex;align-items:baseline}.CodeMirror-hint-information-field-name{font-size:var(--font-size-h4);font-weight:var(--font-weight-medium)}.CodeMirror-hint-information-type-name-pill{border:1px solid hsla(var(--color-neutral),var(--alpha-tertiary));border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));margin-left:var(--px-6);padding:var(--px-4)}.CodeMirror-hint-information-type-name{color:inherit;text-decoration:none}.CodeMirror-hint-information-type-name:hover{text-decoration:underline dotted}.CodeMirror-hint-information-description{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-12)}.CodeMirror-info{background-color:hsl(var(--color-base));border:var(--popover-border);border-radius:var(--border-radius-8);box-shadow:var(--popover-box-shadow);color:hsla(var(--color-neutral),1);max-height:300px;max-width:400px;opacity:0;overflow:auto;padding:var(--px-12);position:fixed;transition:opacity .15s;z-index:10}.CodeMirror-info a{color:inherit;text-decoration:none}.CodeMirror-info a:hover{text-decoration:underline dotted}.CodeMirror-info .CodeMirror-info-header{display:flex;align-items:baseline}.CodeMirror-info .CodeMirror-info-header>.type-name,.CodeMirror-info .CodeMirror-info-header>.field-name,.CodeMirror-info .CodeMirror-info-header>.arg-name,.CodeMirror-info .CodeMirror-info-header>.directive-name,.CodeMirror-info .CodeMirror-info-header>.enum-value{font-size:var(--font-size-h4);font-weight:var(--font-weight-medium)}.CodeMirror-info .type-name-pill{border:1px solid hsla(var(--color-neutral),var(--alpha-tertiary));border-radius:var(--border-radius-4);color:hsla(var(--color-neutral),var(--alpha-secondary));margin-left:var(--px-6);padding:var(--px-4)}.CodeMirror-info .info-description{color:hsla(var(--color-neutral),var(--alpha-secondary));margin-top:var(--px-12);overflow:hidden}.CodeMirror-jump-token{text-decoration:underline dotted;cursor:pointer}.auto-inserted-leaf.cm-property{animation-duration:6s;animation-name:insertionFade;border-radius:var(--border-radius-4);padding:var(--px-2)}@keyframes insertionFade{0%,to{background-color:none}15%,85%{background-color:hsla(var(--color-warning),var(--alpha-background-light))}}button.graphiql-toolbar-button{display:flex;align-items:center;justify-content:center;height:var(--toolbar-width);width:var(--toolbar-width)}button.graphiql-toolbar-button.error{background:hsla(var(--color-error),var(--alpha-background-heavy))}.graphiql-execute-button-wrapper{position:relative}button.graphiql-execute-button{background-color:hsl(var(--color-primary));border:none;border-radius:var(--border-radius-8);cursor:pointer;height:var(--toolbar-width);padding:0;width:var(--toolbar-width)}button.graphiql-execute-button:hover{background-color:hsla(var(--color-primary),.9)}button.graphiql-execute-button:active{background-color:hsla(var(--color-primary),.8)}button.graphiql-execute-button:focus{outline:hsla(var(--color-primary),.8) auto 1px}button.graphiql-execute-button>svg{color:#fff;display:block;height:var(--px-16);margin:auto;width:var(--px-16)}.graphiql-toolbar-listbox,button.graphiql-toolbar-menu{display:block;height:var(--toolbar-width);width:var(--toolbar-width)} -/*!*********************************************************************************************************************!*\ - !*** css ../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/postcss-loader/dist/cjs.js!./style.css ***! - \*********************************************************************************************************************/ -/* Everything */ -.graphiql-container { - background-color: hsl(var(--color-base)); - display: flex; - height: 100%; - margin: 0; - overflow: hidden; - width: 100%; -} -/* The sidebar */ -.graphiql-container .graphiql-sidebar { - display: flex; - flex-direction: column; - justify-content: space-between; - padding: var(--px-8); - width: var(--sidebar-width); -} -.graphiql-container .graphiql-sidebar .graphiql-sidebar-section { - display: flex; - flex-direction: column; - gap: var(--px-8); -} -.graphiql-container .graphiql-sidebar button { - display: flex; - align-items: center; - justify-content: center; - color: hsla(var(--color-neutral), var(--alpha-secondary)); - height: calc(var(--sidebar-width) - (2 * var(--px-8))); - width: calc(var(--sidebar-width) - (2 * var(--px-8))); -} -.graphiql-container .graphiql-sidebar button.active { - color: hsla(var(--color-neutral), 1); -} -.graphiql-container .graphiql-sidebar button:not(:first-child) { - margin-top: var(--px-4); -} -.graphiql-container .graphiql-sidebar button > svg { - height: var(--px-20); - width: var(--px-20); -} -/* The main content, i.e. everything except the sidebar */ -.graphiql-container .graphiql-main { - display: flex; - flex: 1; - min-width: 0; -} -/* The current session and tabs */ -.graphiql-container .graphiql-sessions { - background-color: hsla(var(--color-neutral), var(--alpha-background-light)); - /* Adding the 8px of padding to the inner border radius of the query editor */ - border-radius: calc(var(--border-radius-12) + var(--px-8)); - display: flex; - flex-direction: column; - flex: 1; - max-height: 100%; - margin: var(--px-16); - margin-left: 0; - min-width: 0; -} -/* The session header containing tabs and the logo */ -.graphiql-container .graphiql-session-header { - align-items: center; - display: flex; - justify-content: space-between; - height: var(--session-header-height); -} -/* The button to add a new tab */ -button.graphiql-tab-add { - height: 100%; - padding: 0 var(--px-4); -} -button.graphiql-tab-add > svg { - color: hsla(var(--color-neutral), var(--alpha-secondary)); - display: block; - height: var(--px-16); - width: var(--px-16); -} -.graphiql-add-tab-wrapper { - padding: var(--px-12) 0; -} -/* The right-hand-side of the session header */ -.graphiql-container .graphiql-session-header-right { - align-items: stretch; - display: flex; -} -/* The GraphiQL logo */ -.graphiql-container .graphiql-logo { - color: hsla(var(--color-neutral), var(--alpha-secondary)); - font-size: var(--font-size-h4); - font-weight: var(--font-weight-medium); - padding: var(--px-12) var(--px-16); -} -/* Undo default link styling for the default GraphiQL logo link */ -.graphiql-container .graphiql-logo .graphiql-logo-link { - color: hsla(var(--color-neutral), var(--alpha-secondary)); - text-decoration: none; -} -/* The editor of the session */ -.graphiql-container .graphiql-session { - display: flex; - flex: 1; - padding: 0 var(--px-8) var(--px-8); -} -/* All editors (query, variable, headers) */ -.graphiql-container .graphiql-editors { - background-color: hsl(var(--color-base)); - border-radius: calc(var(--border-radius-12)); - box-shadow: var(--popover-box-shadow); - display: flex; - flex: 1; - flex-direction: column; -} -.graphiql-container .graphiql-editors.full-height { - margin-top: calc(var(--px-8) - var(--session-header-height)); -} -/* The query editor and the toolbar */ -.graphiql-container .graphiql-query-editor { - border-bottom: 1px solid - hsla(var(--color-neutral), var(--alpha-background-heavy)); - display: flex; - flex: 1; - padding: var(--px-16); -} -/* The query editor */ -.graphiql-container .graphiql-query-editor-wrapper { - display: flex; - flex: 1; -} -/* The vertical toolbar next to the query editor */ -.graphiql-container .graphiql-toolbar { - margin-left: var(--px-16); - width: var(--toolbar-width); -} -.graphiql-container .graphiql-toolbar > * + * { - margin-top: var(--px-8); -} -/* The toolbar icons */ -.graphiql-toolbar-icon { - color: hsla(var(--color-neutral), var(--alpha-tertiary)); - display: block; - height: calc(var(--toolbar-width) - (var(--px-8) * 2)); - width: calc(var(--toolbar-width) - (var(--px-8) * 2)); -} -/* The tab bar for editor tools */ -.graphiql-container .graphiql-editor-tools { - align-items: center; - cursor: row-resize; - display: flex; - justify-content: space-between; - padding: var(--px-8); -} -.graphiql-container .graphiql-editor-tools button { - color: hsla(var(--color-neutral), var(--alpha-secondary)); -} -.graphiql-container .graphiql-editor-tools button.active { - color: hsla(var(--color-neutral), 1); -} -/* The tab buttons to switch between editor tools */ -.graphiql-container .graphiql-editor-tools-tabs { - cursor: auto; - display: flex; -} -.graphiql-container .graphiql-editor-tools-tabs > button { - padding: var(--px-8) var(--px-12); -} -.graphiql-container .graphiql-editor-tools-tabs > button + button { - margin-left: var(--px-8); -} -/* An editor tool, e.g. variable or header editor */ -.graphiql-container .graphiql-editor-tool { - flex: 1; - padding: var(--px-16); -} -/** - * The way CodeMirror editors are styled they overflow their containing - * element. For some OS-browser-combinations this might cause overlap issues, - * setting the position of this to `relative` makes sure this element will - * always be on top of any editors. - */ -.graphiql-container .graphiql-toolbar, -.graphiql-container .graphiql-editor-tools, -.graphiql-container .graphiql-editor-tool { - position: relative; -} -/* The response view */ -.graphiql-container .graphiql-response { - --editor-background: transparent; - display: flex; - flex: 1; - flex-direction: column; - position: relative; -} -/* The results editor wrapping container */ -.graphiql-container .graphiql-response .result-window { - position: relative; - flex: 1; -} -/* The footer below the response view */ -.graphiql-container .graphiql-footer { - border-top: 1px solid - hsla(var(--color-neutral), var(--alpha-background-heavy)); -} -/* The plugin container */ -.graphiql-container .graphiql-plugin { - border-left: 1px solid - hsla(var(--color-neutral), var(--alpha-background-heavy)); - flex: 1; - overflow-y: auto; - padding: var(--px-16); -} -/* Generic drag bar for horizontal resizing */ -.graphiql-container .graphiql-horizontal-drag-bar { - width: var(--px-12); - cursor: col-resize; -} -.graphiql-container .graphiql-horizontal-drag-bar:hover::after { - border: var(--px-2) solid - hsla(var(--color-neutral), var(--alpha-background-heavy)); - border-radius: var(--border-radius-2); - content: ''; - display: block; - height: 25%; - margin: 0 auto; - position: relative; - /* (100% - 25%) / 2 = 37.5% */ - top: 37.5%; - width: 0; -} -.graphiql-container .graphiql-chevron-icon { - color: hsla(var(--color-neutral), var(--alpha-tertiary)); - display: block; - height: var(--px-12); - margin: var(--px-12); - width: var(--px-12); -} -/* Generic spin animation */ -.graphiql-spin { - animation: spin 0.8s linear 0s infinite; -} -@keyframes spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} -/* The header of the settings dialog */ -reach-portal .graphiql-dialog-header { - align-items: center; - display: flex; - justify-content: space-between; - padding: var(--px-24); -} -/* The title of the settings dialog */ -reach-portal .graphiql-dialog-title { - font-size: var(--font-size-h3); - font-weight: var(--font-weight-medium); -} -/* A section inside the settings dialog */ -reach-portal .graphiql-dialog-section { - align-items: center; - border-top: 1px solid - hsla(var(--color-neutral), var(--alpha-background-heavy)); - display: flex; - justify-content: space-between; - padding: var(--px-24); -} -reach-portal .graphiql-dialog-section > :not(:first-child) { - margin-left: var(--px-24); -} -/* The section title in the settings dialog */ -reach-portal .graphiql-dialog-section-title { - font-size: var(--font-size-h4); - font-weight: var(--font-weight-medium); -} -/* The section caption in the settings dialog */ -reach-portal .graphiql-dialog-section-caption { - color: hsla(var(--color-neutral), var(--alpha-secondary)); -} -reach-portal .graphiql-warning-text { - color: hsl(var(--color-warning)); - font-weight: var(--font-weight-medium); -} -reach-portal .graphiql-table { - border-collapse: collapse; - width: 100%; -} -reach-portal .graphiql-table :is(th, td) { - border: 1px solid hsla(var(--color-neutral), var(--alpha-background-heavy)); - padding: var(--px-8) var(--px-12); -} -/* A single key the short-key dialog */ -reach-portal .graphiql-key { - background-color: hsla(var(--color-neutral), var(--alpha-background-medium)); - border-radius: var(--border-radius-4); - padding: var(--px-4); -} -/* Avoid showing native tooltips for icons with titles */ -.graphiql-container svg { - pointer-events: none; -} - +.graphiql-container{background-color:hsl(var(--color-base));display:flex;height:100%;margin:0;overflow:hidden;width:100%}.graphiql-container .graphiql-sidebar{display:flex;flex-direction:column;justify-content:space-between;padding:var(--px-8);width:var(--sidebar-width)}.graphiql-container .graphiql-sidebar .graphiql-sidebar-section{display:flex;flex-direction:column;gap:var(--px-8)}.graphiql-container .graphiql-sidebar button{align-items:center;color:hsla(var(--color-neutral),var(--alpha-secondary));display:flex;height:calc(var(--sidebar-width) - var(--px-8)*2);justify-content:center;width:calc(var(--sidebar-width) - var(--px-8)*2)}.graphiql-container .graphiql-sidebar button.active{color:hsla(var(--color-neutral),1)}.graphiql-container .graphiql-sidebar button:not(:first-child){margin-top:var(--px-4)}.graphiql-container .graphiql-sidebar button>svg{height:var(--px-20);width:var(--px-20)}.graphiql-container .graphiql-main{display:flex;flex:1;min-width:0}.graphiql-container .graphiql-sessions{background-color:hsla(var(--color-neutral),var(--alpha-background-light));border-radius:calc(var(--border-radius-12) + var(--px-8));display:flex;flex:1;flex-direction:column;margin:var(--px-16);margin-left:0;max-height:100%;min-width:0}.graphiql-container .graphiql-session-header{align-items:center;display:flex;height:var(--session-header-height);justify-content:space-between}button.graphiql-tab-add{height:100%;padding:0 var(--px-4)}button.graphiql-tab-add>svg{color:hsla(var(--color-neutral),var(--alpha-secondary));display:block;height:var(--px-16);width:var(--px-16)}.graphiql-add-tab-wrapper{padding:var(--px-12) 0}.graphiql-container .graphiql-session-header-right{align-items:stretch;display:flex}.graphiql-container .graphiql-logo{color:hsla(var(--color-neutral),var(--alpha-secondary));font-size:var(--font-size-h4);font-weight:var(--font-weight-medium);padding:var(--px-12) var(--px-16)}.graphiql-container .graphiql-logo .graphiql-logo-link{color:hsla(var(--color-neutral),var(--alpha-secondary));text-decoration:none}.graphiql-container .graphiql-session{display:flex;flex:1;padding:0 var(--px-8) var(--px-8)}.graphiql-container .graphiql-editors{background-color:hsl(var(--color-base));border-radius:calc(var(--border-radius-12));box-shadow:var(--popover-box-shadow);display:flex;flex:1;flex-direction:column}.graphiql-container .graphiql-editors.full-height{margin-top:calc(var(--px-8) - var(--session-header-height))}.graphiql-container .graphiql-query-editor{border-bottom:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));display:flex;flex:1;padding:var(--px-16)}.graphiql-container .graphiql-query-editor-wrapper{display:flex;flex:1}.graphiql-container .graphiql-toolbar{margin-left:var(--px-16);width:var(--toolbar-width)}.graphiql-container .graphiql-toolbar>*+*{margin-top:var(--px-8)}.graphiql-toolbar-icon{color:hsla(var(--color-neutral),var(--alpha-tertiary));display:block;height:calc(var(--toolbar-width) - var(--px-8)*2);width:calc(var(--toolbar-width) - var(--px-8)*2)}.graphiql-container .graphiql-editor-tools{align-items:center;cursor:row-resize;display:flex;justify-content:space-between;padding:var(--px-8)}.graphiql-container .graphiql-editor-tools button{color:hsla(var(--color-neutral),var(--alpha-secondary))}.graphiql-container .graphiql-editor-tools button.active{color:hsla(var(--color-neutral),1)}.graphiql-container .graphiql-editor-tools-tabs{cursor:auto;display:flex}.graphiql-container .graphiql-editor-tools-tabs>button{padding:var(--px-8) var(--px-12)}.graphiql-container .graphiql-editor-tools-tabs>button+button{margin-left:var(--px-8)}.graphiql-container .graphiql-editor-tool{flex:1;padding:var(--px-16)}.graphiql-container .graphiql-editor-tool,.graphiql-container .graphiql-editor-tools,.graphiql-container .graphiql-toolbar{position:relative}.graphiql-container .graphiql-response{--editor-background:transparent;display:flex;flex:1;flex-direction:column;position:relative}.graphiql-container .graphiql-response .result-window{flex:1;position:relative}.graphiql-container .graphiql-footer{border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy))}.graphiql-container .graphiql-plugin{border-left:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));flex:1;overflow-y:auto;padding:var(--px-16)}.graphiql-container .graphiql-horizontal-drag-bar{cursor:col-resize;width:var(--px-12)}.graphiql-container .graphiql-horizontal-drag-bar:hover:after{border:var(--px-2) solid hsla(var(--color-neutral),var(--alpha-background-heavy));border-radius:var(--border-radius-2);content:"";display:block;height:25%;margin:0 auto;position:relative;top:37.5%;width:0}.graphiql-container .graphiql-chevron-icon{color:hsla(var(--color-neutral),var(--alpha-tertiary));display:block;height:var(--px-12);margin:var(--px-12);width:var(--px-12)}.graphiql-spin{animation:spin .8s linear 0s infinite}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}reach-portal .graphiql-dialog-header{align-items:center;display:flex;justify-content:space-between;padding:var(--px-24)}reach-portal .graphiql-dialog-title{font-size:var(--font-size-h3);font-weight:var(--font-weight-medium)}reach-portal .graphiql-dialog-section{align-items:center;border-top:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));display:flex;justify-content:space-between;padding:var(--px-24)}reach-portal .graphiql-dialog-section>:not(:first-child){margin-left:var(--px-24)}reach-portal .graphiql-dialog-section-title{font-size:var(--font-size-h4);font-weight:var(--font-weight-medium)}reach-portal .graphiql-dialog-section-caption{color:hsla(var(--color-neutral),var(--alpha-secondary))}reach-portal .graphiql-warning-text{color:hsl(var(--color-warning));font-weight:var(--font-weight-medium)}reach-portal .graphiql-table{border-collapse:collapse;width:100%}reach-portal .graphiql-table :is(th,td){border:1px solid hsla(var(--color-neutral),var(--alpha-background-heavy));padding:var(--px-8) var(--px-12)}reach-portal .graphiql-key{background-color:hsla(var(--color-neutral),var(--alpha-background-medium));border-radius:var(--border-radius-4);padding:var(--px-4)}.graphiql-container svg{pointer-events:none} -/*# sourceMappingURL=graphiql.css.map*/ \ No newline at end of file +/*# sourceMappingURL=graphiql.min.css.map*/ \ No newline at end of file