@vulcanjs/react-ui 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1806,2163 +1806,8 @@ init_esm_shims();
1806
1806
  var import_tslib = __toESM(require_tslib(), 1);
1807
1807
  var { __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __createBinding, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn } = import_tslib.default;
1808
1808
 
1809
- // ../../node_modules/graphql/index.mjs
1810
- init_esm_shims();
1811
-
1812
- // ../../node_modules/graphql/language/parser.mjs
1813
- init_esm_shims();
1814
-
1815
- // ../../node_modules/graphql/error/syntaxError.mjs
1816
- init_esm_shims();
1817
-
1818
- // ../../node_modules/graphql/error/GraphQLError.mjs
1819
- init_esm_shims();
1820
-
1821
- // ../../node_modules/graphql/jsutils/isObjectLike.mjs
1822
- init_esm_shims();
1823
- function _typeof(obj) {
1824
- "@babel/helpers - typeof";
1825
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1826
- _typeof = /* @__PURE__ */ __name(function _typeof5(obj2) {
1827
- return typeof obj2;
1828
- }, "_typeof");
1829
- } else {
1830
- _typeof = /* @__PURE__ */ __name(function _typeof5(obj2) {
1831
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1832
- }, "_typeof");
1833
- }
1834
- return _typeof(obj);
1835
- }
1836
- __name(_typeof, "_typeof");
1837
- function isObjectLike(value) {
1838
- return _typeof(value) == "object" && value !== null;
1839
- }
1840
- __name(isObjectLike, "isObjectLike");
1841
-
1842
- // ../../node_modules/graphql/polyfills/symbols.mjs
1843
- init_esm_shims();
1844
- var SYMBOL_ITERATOR = typeof Symbol === "function" && Symbol.iterator != null ? Symbol.iterator : "@@iterator";
1845
- var SYMBOL_ASYNC_ITERATOR = typeof Symbol === "function" && Symbol.asyncIterator != null ? Symbol.asyncIterator : "@@asyncIterator";
1846
- var SYMBOL_TO_STRING_TAG = typeof Symbol === "function" && Symbol.toStringTag != null ? Symbol.toStringTag : "@@toStringTag";
1847
-
1848
- // ../../node_modules/graphql/language/location.mjs
1849
- init_esm_shims();
1850
- function getLocation(source, position) {
1851
- var lineRegexp = /\r\n|[\n\r]/g;
1852
- var line = 1;
1853
- var column = position + 1;
1854
- var match;
1855
- while ((match = lineRegexp.exec(source.body)) && match.index < position) {
1856
- line += 1;
1857
- column = position + 1 - (match.index + match[0].length);
1858
- }
1859
- return {
1860
- line,
1861
- column
1862
- };
1863
- }
1864
- __name(getLocation, "getLocation");
1865
-
1866
- // ../../node_modules/graphql/language/printLocation.mjs
1867
- init_esm_shims();
1868
- function printLocation(location) {
1869
- return printSourceLocation(location.source, getLocation(location.source, location.start));
1870
- }
1871
- __name(printLocation, "printLocation");
1872
- function printSourceLocation(source, sourceLocation) {
1873
- var firstLineColumnOffset = source.locationOffset.column - 1;
1874
- var body = whitespace(firstLineColumnOffset) + source.body;
1875
- var lineIndex = sourceLocation.line - 1;
1876
- var lineOffset = source.locationOffset.line - 1;
1877
- var lineNum = sourceLocation.line + lineOffset;
1878
- var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
1879
- var columnNum = sourceLocation.column + columnOffset;
1880
- var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n");
1881
- var lines = body.split(/\r\n|[\n\r]/g);
1882
- var locationLine = lines[lineIndex];
1883
- if (locationLine.length > 120) {
1884
- var subLineIndex = Math.floor(columnNum / 80);
1885
- var subLineColumnNum = columnNum % 80;
1886
- var subLines = [];
1887
- for (var i = 0; i < locationLine.length; i += 80) {
1888
- subLines.push(locationLine.slice(i, i + 80));
1889
- }
1890
- return locationStr + printPrefixedLines([["".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function(subLine) {
1891
- return ["", subLine];
1892
- }), [[" ", whitespace(subLineColumnNum - 1) + "^"], ["", subLines[subLineIndex + 1]]]));
1893
- }
1894
- return locationStr + printPrefixedLines([
1895
- ["".concat(lineNum - 1), lines[lineIndex - 1]],
1896
- ["".concat(lineNum), locationLine],
1897
- ["", whitespace(columnNum - 1) + "^"],
1898
- ["".concat(lineNum + 1), lines[lineIndex + 1]]
1899
- ]);
1900
- }
1901
- __name(printSourceLocation, "printSourceLocation");
1902
- function printPrefixedLines(lines) {
1903
- var existingLines = lines.filter(function(_ref) {
1904
- var _ = _ref[0], line = _ref[1];
1905
- return line !== void 0;
1906
- });
1907
- var padLen = Math.max.apply(Math, existingLines.map(function(_ref2) {
1908
- var prefix = _ref2[0];
1909
- return prefix.length;
1910
- }));
1911
- return existingLines.map(function(_ref3) {
1912
- var prefix = _ref3[0], line = _ref3[1];
1913
- return leftPad(padLen, prefix) + (line ? " | " + line : " |");
1914
- }).join("\n");
1915
- }
1916
- __name(printPrefixedLines, "printPrefixedLines");
1917
- function whitespace(len) {
1918
- return Array(len + 1).join(" ");
1919
- }
1920
- __name(whitespace, "whitespace");
1921
- function leftPad(len, str) {
1922
- return whitespace(len - str.length) + str;
1923
- }
1924
- __name(leftPad, "leftPad");
1925
-
1926
- // ../../node_modules/graphql/error/GraphQLError.mjs
1927
- function _typeof2(obj) {
1928
- "@babel/helpers - typeof";
1929
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1930
- _typeof2 = /* @__PURE__ */ __name(function _typeof5(obj2) {
1931
- return typeof obj2;
1932
- }, "_typeof");
1933
- } else {
1934
- _typeof2 = /* @__PURE__ */ __name(function _typeof5(obj2) {
1935
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1936
- }, "_typeof");
1937
- }
1938
- return _typeof2(obj);
1939
- }
1940
- __name(_typeof2, "_typeof");
1941
- function ownKeys(object, enumerableOnly) {
1942
- var keys = Object.keys(object);
1943
- if (Object.getOwnPropertySymbols) {
1944
- var symbols = Object.getOwnPropertySymbols(object);
1945
- if (enumerableOnly)
1946
- symbols = symbols.filter(function(sym) {
1947
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1948
- });
1949
- keys.push.apply(keys, symbols);
1950
- }
1951
- return keys;
1952
- }
1953
- __name(ownKeys, "ownKeys");
1954
- function _objectSpread(target) {
1955
- for (var i = 1; i < arguments.length; i++) {
1956
- var source = arguments[i] != null ? arguments[i] : {};
1957
- if (i % 2) {
1958
- ownKeys(Object(source), true).forEach(function(key) {
1959
- _defineProperty(target, key, source[key]);
1960
- });
1961
- } else if (Object.getOwnPropertyDescriptors) {
1962
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1963
- } else {
1964
- ownKeys(Object(source)).forEach(function(key) {
1965
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1966
- });
1967
- }
1968
- }
1969
- return target;
1970
- }
1971
- __name(_objectSpread, "_objectSpread");
1972
- function _defineProperty(obj, key, value) {
1973
- if (key in obj) {
1974
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
1975
- } else {
1976
- obj[key] = value;
1977
- }
1978
- return obj;
1979
- }
1980
- __name(_defineProperty, "_defineProperty");
1981
- function _classCallCheck(instance, Constructor) {
1982
- if (!(instance instanceof Constructor)) {
1983
- throw new TypeError("Cannot call a class as a function");
1984
- }
1985
- }
1986
- __name(_classCallCheck, "_classCallCheck");
1987
- function _defineProperties(target, props) {
1988
- for (var i = 0; i < props.length; i++) {
1989
- var descriptor = props[i];
1990
- descriptor.enumerable = descriptor.enumerable || false;
1991
- descriptor.configurable = true;
1992
- if ("value" in descriptor)
1993
- descriptor.writable = true;
1994
- Object.defineProperty(target, descriptor.key, descriptor);
1995
- }
1996
- }
1997
- __name(_defineProperties, "_defineProperties");
1998
- function _createClass(Constructor, protoProps, staticProps) {
1999
- if (protoProps)
2000
- _defineProperties(Constructor.prototype, protoProps);
2001
- if (staticProps)
2002
- _defineProperties(Constructor, staticProps);
2003
- return Constructor;
2004
- }
2005
- __name(_createClass, "_createClass");
2006
- function _inherits(subClass, superClass) {
2007
- if (typeof superClass !== "function" && superClass !== null) {
2008
- throw new TypeError("Super expression must either be null or a function");
2009
- }
2010
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
2011
- if (superClass)
2012
- _setPrototypeOf(subClass, superClass);
2013
- }
2014
- __name(_inherits, "_inherits");
2015
- function _createSuper(Derived) {
2016
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
2017
- return /* @__PURE__ */ __name(function _createSuperInternal() {
2018
- var Super = _getPrototypeOf(Derived), result;
2019
- if (hasNativeReflectConstruct) {
2020
- var NewTarget = _getPrototypeOf(this).constructor;
2021
- result = Reflect.construct(Super, arguments, NewTarget);
2022
- } else {
2023
- result = Super.apply(this, arguments);
2024
- }
2025
- return _possibleConstructorReturn(this, result);
2026
- }, "_createSuperInternal");
2027
- }
2028
- __name(_createSuper, "_createSuper");
2029
- function _possibleConstructorReturn(self2, call) {
2030
- if (call && (_typeof2(call) === "object" || typeof call === "function")) {
2031
- return call;
2032
- }
2033
- return _assertThisInitialized(self2);
2034
- }
2035
- __name(_possibleConstructorReturn, "_possibleConstructorReturn");
2036
- function _assertThisInitialized(self2) {
2037
- if (self2 === void 0) {
2038
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2039
- }
2040
- return self2;
2041
- }
2042
- __name(_assertThisInitialized, "_assertThisInitialized");
2043
- function _wrapNativeSuper(Class) {
2044
- var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
2045
- _wrapNativeSuper = /* @__PURE__ */ __name(function _wrapNativeSuper2(Class2) {
2046
- if (Class2 === null || !_isNativeFunction(Class2))
2047
- return Class2;
2048
- if (typeof Class2 !== "function") {
2049
- throw new TypeError("Super expression must either be null or a function");
2050
- }
2051
- if (typeof _cache !== "undefined") {
2052
- if (_cache.has(Class2))
2053
- return _cache.get(Class2);
2054
- _cache.set(Class2, Wrapper);
2055
- }
2056
- function Wrapper() {
2057
- return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
2058
- }
2059
- __name(Wrapper, "Wrapper");
2060
- Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
2061
- return _setPrototypeOf(Wrapper, Class2);
2062
- }, "_wrapNativeSuper");
2063
- return _wrapNativeSuper(Class);
2064
- }
2065
- __name(_wrapNativeSuper, "_wrapNativeSuper");
2066
- function _construct(Parent, args, Class) {
2067
- if (_isNativeReflectConstruct()) {
2068
- _construct = Reflect.construct;
2069
- } else {
2070
- _construct = /* @__PURE__ */ __name(function _construct2(Parent2, args2, Class2) {
2071
- var a = [null];
2072
- a.push.apply(a, args2);
2073
- var Constructor = Function.bind.apply(Parent2, a);
2074
- var instance = new Constructor();
2075
- if (Class2)
2076
- _setPrototypeOf(instance, Class2.prototype);
2077
- return instance;
2078
- }, "_construct");
2079
- }
2080
- return _construct.apply(null, arguments);
2081
- }
2082
- __name(_construct, "_construct");
2083
- function _isNativeReflectConstruct() {
2084
- if (typeof Reflect === "undefined" || !Reflect.construct)
2085
- return false;
2086
- if (Reflect.construct.sham)
2087
- return false;
2088
- if (typeof Proxy === "function")
2089
- return true;
2090
- try {
2091
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {
2092
- }));
2093
- return true;
2094
- } catch (e) {
2095
- return false;
2096
- }
2097
- }
2098
- __name(_isNativeReflectConstruct, "_isNativeReflectConstruct");
2099
- function _isNativeFunction(fn) {
2100
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
2101
- }
2102
- __name(_isNativeFunction, "_isNativeFunction");
2103
- function _setPrototypeOf(o, p) {
2104
- _setPrototypeOf = Object.setPrototypeOf || /* @__PURE__ */ __name(function _setPrototypeOf2(o2, p2) {
2105
- o2.__proto__ = p2;
2106
- return o2;
2107
- }, "_setPrototypeOf");
2108
- return _setPrototypeOf(o, p);
2109
- }
2110
- __name(_setPrototypeOf, "_setPrototypeOf");
2111
- function _getPrototypeOf(o) {
2112
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : /* @__PURE__ */ __name(function _getPrototypeOf2(o2) {
2113
- return o2.__proto__ || Object.getPrototypeOf(o2);
2114
- }, "_getPrototypeOf");
2115
- return _getPrototypeOf(o);
2116
- }
2117
- __name(_getPrototypeOf, "_getPrototypeOf");
2118
- var GraphQLError = /* @__PURE__ */ function(_Error) {
2119
- _inherits(GraphQLError2, _Error);
2120
- var _super = _createSuper(GraphQLError2);
2121
- function GraphQLError2(message, nodes, source, positions, path, originalError, extensions) {
2122
- var _nodeLocations, _nodeLocations2, _nodeLocations3;
2123
- var _this;
2124
- _classCallCheck(this, GraphQLError2);
2125
- _this = _super.call(this, message);
2126
- _this.name = "GraphQLError";
2127
- _this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
2128
- _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0);
2129
- var nodeLocations = [];
2130
- for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
2131
- var _this$nodes;
2132
- var _ref4 = _ref3[_i2];
2133
- var loc = _ref4.loc;
2134
- if (loc != null) {
2135
- nodeLocations.push(loc);
2136
- }
2137
- }
2138
- nodeLocations = undefinedIfEmpty(nodeLocations);
2139
- _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
2140
- _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function(loc2) {
2141
- return loc2.start;
2142
- });
2143
- _this.locations = positions && source ? positions.map(function(pos) {
2144
- return getLocation(source, pos);
2145
- }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function(loc2) {
2146
- return getLocation(loc2.source, loc2.start);
2147
- });
2148
- _this.path = path !== null && path !== void 0 ? path : void 0;
2149
- var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
2150
- if (extensions == null && isObjectLike(originalExtensions)) {
2151
- _this.extensions = _objectSpread({}, originalExtensions);
2152
- } else {
2153
- _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
2154
- }
2155
- Object.defineProperties(_assertThisInitialized(_this), {
2156
- message: {
2157
- enumerable: true
2158
- },
2159
- locations: {
2160
- enumerable: _this.locations != null
2161
- },
2162
- path: {
2163
- enumerable: _this.path != null
2164
- },
2165
- extensions: {
2166
- enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
2167
- },
2168
- name: {
2169
- enumerable: false
2170
- },
2171
- nodes: {
2172
- enumerable: false
2173
- },
2174
- source: {
2175
- enumerable: false
2176
- },
2177
- positions: {
2178
- enumerable: false
2179
- },
2180
- originalError: {
2181
- enumerable: false
2182
- }
2183
- });
2184
- if (originalError !== null && originalError !== void 0 && originalError.stack) {
2185
- Object.defineProperty(_assertThisInitialized(_this), "stack", {
2186
- value: originalError.stack,
2187
- writable: true,
2188
- configurable: true
2189
- });
2190
- return _possibleConstructorReturn(_this);
2191
- }
2192
- if (Error.captureStackTrace) {
2193
- Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError2);
2194
- } else {
2195
- Object.defineProperty(_assertThisInitialized(_this), "stack", {
2196
- value: Error().stack,
2197
- writable: true,
2198
- configurable: true
2199
- });
2200
- }
2201
- return _this;
2202
- }
2203
- __name(GraphQLError2, "GraphQLError");
2204
- _createClass(GraphQLError2, [{
2205
- key: "toString",
2206
- value: /* @__PURE__ */ __name(function toString() {
2207
- return printError(this);
2208
- }, "toString")
2209
- }, {
2210
- key: SYMBOL_TO_STRING_TAG,
2211
- get: /* @__PURE__ */ __name(function get3() {
2212
- return "Object";
2213
- }, "get")
2214
- }]);
2215
- return GraphQLError2;
2216
- }(/* @__PURE__ */ _wrapNativeSuper(Error));
2217
- function undefinedIfEmpty(array) {
2218
- return array === void 0 || array.length === 0 ? void 0 : array;
2219
- }
2220
- __name(undefinedIfEmpty, "undefinedIfEmpty");
2221
- function printError(error) {
2222
- var output = error.message;
2223
- if (error.nodes) {
2224
- for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
2225
- var node = _error$nodes2[_i4];
2226
- if (node.loc) {
2227
- output += "\n\n" + printLocation(node.loc);
2228
- }
2229
- }
2230
- } else if (error.source && error.locations) {
2231
- for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
2232
- var location = _error$locations2[_i6];
2233
- output += "\n\n" + printSourceLocation(error.source, location);
2234
- }
2235
- }
2236
- return output;
2237
- }
2238
- __name(printError, "printError");
2239
-
2240
- // ../../node_modules/graphql/error/syntaxError.mjs
2241
- function syntaxError(source, position, description) {
2242
- return new GraphQLError("Syntax Error: ".concat(description), void 0, source, [position]);
2243
- }
2244
- __name(syntaxError, "syntaxError");
2245
-
2246
- // ../../node_modules/graphql/language/kinds.mjs
2247
- init_esm_shims();
2248
- var Kind = Object.freeze({
2249
- NAME: "Name",
2250
- DOCUMENT: "Document",
2251
- OPERATION_DEFINITION: "OperationDefinition",
2252
- VARIABLE_DEFINITION: "VariableDefinition",
2253
- SELECTION_SET: "SelectionSet",
2254
- FIELD: "Field",
2255
- ARGUMENT: "Argument",
2256
- FRAGMENT_SPREAD: "FragmentSpread",
2257
- INLINE_FRAGMENT: "InlineFragment",
2258
- FRAGMENT_DEFINITION: "FragmentDefinition",
2259
- VARIABLE: "Variable",
2260
- INT: "IntValue",
2261
- FLOAT: "FloatValue",
2262
- STRING: "StringValue",
2263
- BOOLEAN: "BooleanValue",
2264
- NULL: "NullValue",
2265
- ENUM: "EnumValue",
2266
- LIST: "ListValue",
2267
- OBJECT: "ObjectValue",
2268
- OBJECT_FIELD: "ObjectField",
2269
- DIRECTIVE: "Directive",
2270
- NAMED_TYPE: "NamedType",
2271
- LIST_TYPE: "ListType",
2272
- NON_NULL_TYPE: "NonNullType",
2273
- SCHEMA_DEFINITION: "SchemaDefinition",
2274
- OPERATION_TYPE_DEFINITION: "OperationTypeDefinition",
2275
- SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition",
2276
- OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition",
2277
- FIELD_DEFINITION: "FieldDefinition",
2278
- INPUT_VALUE_DEFINITION: "InputValueDefinition",
2279
- INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition",
2280
- UNION_TYPE_DEFINITION: "UnionTypeDefinition",
2281
- ENUM_TYPE_DEFINITION: "EnumTypeDefinition",
2282
- ENUM_VALUE_DEFINITION: "EnumValueDefinition",
2283
- INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition",
2284
- DIRECTIVE_DEFINITION: "DirectiveDefinition",
2285
- SCHEMA_EXTENSION: "SchemaExtension",
2286
- SCALAR_TYPE_EXTENSION: "ScalarTypeExtension",
2287
- OBJECT_TYPE_EXTENSION: "ObjectTypeExtension",
2288
- INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension",
2289
- UNION_TYPE_EXTENSION: "UnionTypeExtension",
2290
- ENUM_TYPE_EXTENSION: "EnumTypeExtension",
2291
- INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"
2292
- });
2293
-
2294
- // ../../node_modules/graphql/language/ast.mjs
2295
- init_esm_shims();
2296
-
2297
- // ../../node_modules/graphql/jsutils/defineInspect.mjs
2298
- init_esm_shims();
2299
-
2300
- // ../../node_modules/graphql/jsutils/invariant.mjs
2301
- init_esm_shims();
2302
- function invariant(condition, message) {
2303
- var booleanCondition = Boolean(condition);
2304
- if (!booleanCondition) {
2305
- throw new Error(message != null ? message : "Unexpected invariant triggered.");
2306
- }
2307
- }
2308
- __name(invariant, "invariant");
2309
-
2310
- // ../../node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs
2311
- init_esm_shims();
2312
- var nodejsCustomInspectSymbol = typeof Symbol === "function" && typeof Symbol.for === "function" ? Symbol.for("nodejs.util.inspect.custom") : void 0;
2313
- var nodejsCustomInspectSymbol_default = nodejsCustomInspectSymbol;
2314
-
2315
- // ../../node_modules/graphql/jsutils/defineInspect.mjs
2316
- function defineInspect(classObject) {
2317
- var fn = classObject.prototype.toJSON;
2318
- typeof fn === "function" || invariant(0);
2319
- classObject.prototype.inspect = fn;
2320
- if (nodejsCustomInspectSymbol_default) {
2321
- classObject.prototype[nodejsCustomInspectSymbol_default] = fn;
2322
- }
2323
- }
2324
- __name(defineInspect, "defineInspect");
2325
-
2326
- // ../../node_modules/graphql/language/ast.mjs
2327
- var Location = /* @__PURE__ */ function() {
2328
- function Location2(startToken, endToken, source) {
2329
- this.start = startToken.start;
2330
- this.end = endToken.end;
2331
- this.startToken = startToken;
2332
- this.endToken = endToken;
2333
- this.source = source;
2334
- }
2335
- __name(Location2, "Location");
2336
- var _proto = Location2.prototype;
2337
- _proto.toJSON = /* @__PURE__ */ __name(function toJSON() {
2338
- return {
2339
- start: this.start,
2340
- end: this.end
2341
- };
2342
- }, "toJSON");
2343
- return Location2;
2344
- }();
2345
- defineInspect(Location);
2346
- var Token = /* @__PURE__ */ function() {
2347
- function Token2(kind, start, end, line, column, prev, value) {
2348
- this.kind = kind;
2349
- this.start = start;
2350
- this.end = end;
2351
- this.line = line;
2352
- this.column = column;
2353
- this.value = value;
2354
- this.prev = prev;
2355
- this.next = null;
2356
- }
2357
- __name(Token2, "Token");
2358
- var _proto2 = Token2.prototype;
2359
- _proto2.toJSON = /* @__PURE__ */ __name(function toJSON() {
2360
- return {
2361
- kind: this.kind,
2362
- value: this.value,
2363
- line: this.line,
2364
- column: this.column
2365
- };
2366
- }, "toJSON");
2367
- return Token2;
2368
- }();
2369
- defineInspect(Token);
2370
-
2371
- // ../../node_modules/graphql/language/tokenKind.mjs
2372
- init_esm_shims();
2373
- var TokenKind = Object.freeze({
2374
- SOF: "<SOF>",
2375
- EOF: "<EOF>",
2376
- BANG: "!",
2377
- DOLLAR: "$",
2378
- AMP: "&",
2379
- PAREN_L: "(",
2380
- PAREN_R: ")",
2381
- SPREAD: "...",
2382
- COLON: ":",
2383
- EQUALS: "=",
2384
- AT: "@",
2385
- BRACKET_L: "[",
2386
- BRACKET_R: "]",
2387
- BRACE_L: "{",
2388
- PIPE: "|",
2389
- BRACE_R: "}",
2390
- NAME: "Name",
2391
- INT: "Int",
2392
- FLOAT: "Float",
2393
- STRING: "String",
2394
- BLOCK_STRING: "BlockString",
2395
- COMMENT: "Comment"
2396
- });
2397
-
2398
- // ../../node_modules/graphql/language/source.mjs
2399
- init_esm_shims();
2400
-
2401
- // ../../node_modules/graphql/jsutils/inspect.mjs
2402
- init_esm_shims();
2403
- function _typeof3(obj) {
2404
- "@babel/helpers - typeof";
2405
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2406
- _typeof3 = /* @__PURE__ */ __name(function _typeof5(obj2) {
2407
- return typeof obj2;
2408
- }, "_typeof");
2409
- } else {
2410
- _typeof3 = /* @__PURE__ */ __name(function _typeof5(obj2) {
2411
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
2412
- }, "_typeof");
2413
- }
2414
- return _typeof3(obj);
2415
- }
2416
- __name(_typeof3, "_typeof");
2417
- var MAX_ARRAY_LENGTH = 10;
2418
- var MAX_RECURSIVE_DEPTH = 2;
2419
- function inspect(value) {
2420
- return formatValue(value, []);
2421
- }
2422
- __name(inspect, "inspect");
2423
- function formatValue(value, seenValues) {
2424
- switch (_typeof3(value)) {
2425
- case "string":
2426
- return JSON.stringify(value);
2427
- case "function":
2428
- return value.name ? "[function ".concat(value.name, "]") : "[function]";
2429
- case "object":
2430
- if (value === null) {
2431
- return "null";
2432
- }
2433
- return formatObjectValue(value, seenValues);
2434
- default:
2435
- return String(value);
2436
- }
2437
- }
2438
- __name(formatValue, "formatValue");
2439
- function formatObjectValue(value, previouslySeenValues) {
2440
- if (previouslySeenValues.indexOf(value) !== -1) {
2441
- return "[Circular]";
2442
- }
2443
- var seenValues = [].concat(previouslySeenValues, [value]);
2444
- var customInspectFn = getCustomFn(value);
2445
- if (customInspectFn !== void 0) {
2446
- var customValue = customInspectFn.call(value);
2447
- if (customValue !== value) {
2448
- return typeof customValue === "string" ? customValue : formatValue(customValue, seenValues);
2449
- }
2450
- } else if (Array.isArray(value)) {
2451
- return formatArray(value, seenValues);
2452
- }
2453
- return formatObject(value, seenValues);
2454
- }
2455
- __name(formatObjectValue, "formatObjectValue");
2456
- function formatObject(object, seenValues) {
2457
- var keys = Object.keys(object);
2458
- if (keys.length === 0) {
2459
- return "{}";
2460
- }
2461
- if (seenValues.length > MAX_RECURSIVE_DEPTH) {
2462
- return "[" + getObjectTag(object) + "]";
2463
- }
2464
- var properties = keys.map(function(key) {
2465
- var value = formatValue(object[key], seenValues);
2466
- return key + ": " + value;
2467
- });
2468
- return "{ " + properties.join(", ") + " }";
2469
- }
2470
- __name(formatObject, "formatObject");
2471
- function formatArray(array, seenValues) {
2472
- if (array.length === 0) {
2473
- return "[]";
2474
- }
2475
- if (seenValues.length > MAX_RECURSIVE_DEPTH) {
2476
- return "[Array]";
2477
- }
2478
- var len = Math.min(MAX_ARRAY_LENGTH, array.length);
2479
- var remaining = array.length - len;
2480
- var items = [];
2481
- for (var i = 0; i < len; ++i) {
2482
- items.push(formatValue(array[i], seenValues));
2483
- }
2484
- if (remaining === 1) {
2485
- items.push("... 1 more item");
2486
- } else if (remaining > 1) {
2487
- items.push("... ".concat(remaining, " more items"));
2488
- }
2489
- return "[" + items.join(", ") + "]";
2490
- }
2491
- __name(formatArray, "formatArray");
2492
- function getCustomFn(object) {
2493
- var customInspectFn = object[String(nodejsCustomInspectSymbol_default)];
2494
- if (typeof customInspectFn === "function") {
2495
- return customInspectFn;
2496
- }
2497
- if (typeof object.inspect === "function") {
2498
- return object.inspect;
2499
- }
2500
- }
2501
- __name(getCustomFn, "getCustomFn");
2502
- function getObjectTag(object) {
2503
- var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
2504
- if (tag === "Object" && typeof object.constructor === "function") {
2505
- var name = object.constructor.name;
2506
- if (typeof name === "string" && name !== "") {
2507
- return name;
2508
- }
2509
- }
2510
- return tag;
2511
- }
2512
- __name(getObjectTag, "getObjectTag");
2513
-
2514
- // ../../node_modules/graphql/jsutils/devAssert.mjs
2515
- init_esm_shims();
2516
- function devAssert(condition, message) {
2517
- var booleanCondition = Boolean(condition);
2518
- if (!booleanCondition) {
2519
- throw new Error(message);
2520
- }
2521
- }
2522
- __name(devAssert, "devAssert");
2523
-
2524
- // ../../node_modules/graphql/jsutils/instanceOf.mjs
2525
- init_esm_shims();
2526
- function _typeof4(obj) {
2527
- "@babel/helpers - typeof";
2528
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2529
- _typeof4 = /* @__PURE__ */ __name(function _typeof5(obj2) {
2530
- return typeof obj2;
2531
- }, "_typeof");
2532
- } else {
2533
- _typeof4 = /* @__PURE__ */ __name(function _typeof5(obj2) {
2534
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
2535
- }, "_typeof");
2536
- }
2537
- return _typeof4(obj);
2538
- }
2539
- __name(_typeof4, "_typeof");
2540
- var instanceOf_default = process.env.NODE_ENV === "production" ? /* @__PURE__ */ __name(function instanceOf(value, constructor) {
2541
- return value instanceof constructor;
2542
- }, "instanceOf") : /* @__PURE__ */ __name(function instanceOf2(value, constructor) {
2543
- if (value instanceof constructor) {
2544
- return true;
2545
- }
2546
- if (_typeof4(value) === "object" && value !== null) {
2547
- var _value$constructor;
2548
- var className = constructor.prototype[Symbol.toStringTag];
2549
- var valueClassName = Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;
2550
- if (className === valueClassName) {
2551
- var stringifiedValue = inspect(value);
2552
- throw new Error("Cannot use ".concat(className, ' "').concat(stringifiedValue, '" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.'));
2553
- }
2554
- }
2555
- return false;
2556
- }, "instanceOf");
2557
-
2558
- // ../../node_modules/graphql/language/source.mjs
2559
- function _defineProperties2(target, props) {
2560
- for (var i = 0; i < props.length; i++) {
2561
- var descriptor = props[i];
2562
- descriptor.enumerable = descriptor.enumerable || false;
2563
- descriptor.configurable = true;
2564
- if ("value" in descriptor)
2565
- descriptor.writable = true;
2566
- Object.defineProperty(target, descriptor.key, descriptor);
2567
- }
2568
- }
2569
- __name(_defineProperties2, "_defineProperties");
2570
- function _createClass2(Constructor, protoProps, staticProps) {
2571
- if (protoProps)
2572
- _defineProperties2(Constructor.prototype, protoProps);
2573
- if (staticProps)
2574
- _defineProperties2(Constructor, staticProps);
2575
- return Constructor;
2576
- }
2577
- __name(_createClass2, "_createClass");
2578
- var Source = /* @__PURE__ */ function() {
2579
- function Source2(body) {
2580
- var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
2581
- var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
2582
- line: 1,
2583
- column: 1
2584
- };
2585
- typeof body === "string" || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), "."));
2586
- this.body = body;
2587
- this.name = name;
2588
- this.locationOffset = locationOffset;
2589
- this.locationOffset.line > 0 || devAssert(0, "line in locationOffset is 1-indexed and must be positive.");
2590
- this.locationOffset.column > 0 || devAssert(0, "column in locationOffset is 1-indexed and must be positive.");
2591
- }
2592
- __name(Source2, "Source");
2593
- _createClass2(Source2, [{
2594
- key: SYMBOL_TO_STRING_TAG,
2595
- get: /* @__PURE__ */ __name(function get3() {
2596
- return "Source";
2597
- }, "get")
2598
- }]);
2599
- return Source2;
2600
- }();
2601
- function isSource(source) {
2602
- return instanceOf_default(source, Source);
2603
- }
2604
- __name(isSource, "isSource");
2605
-
2606
- // ../../node_modules/graphql/language/directiveLocation.mjs
2607
- init_esm_shims();
2608
- var DirectiveLocation = Object.freeze({
2609
- QUERY: "QUERY",
2610
- MUTATION: "MUTATION",
2611
- SUBSCRIPTION: "SUBSCRIPTION",
2612
- FIELD: "FIELD",
2613
- FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION",
2614
- FRAGMENT_SPREAD: "FRAGMENT_SPREAD",
2615
- INLINE_FRAGMENT: "INLINE_FRAGMENT",
2616
- VARIABLE_DEFINITION: "VARIABLE_DEFINITION",
2617
- SCHEMA: "SCHEMA",
2618
- SCALAR: "SCALAR",
2619
- OBJECT: "OBJECT",
2620
- FIELD_DEFINITION: "FIELD_DEFINITION",
2621
- ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION",
2622
- INTERFACE: "INTERFACE",
2623
- UNION: "UNION",
2624
- ENUM: "ENUM",
2625
- ENUM_VALUE: "ENUM_VALUE",
2626
- INPUT_OBJECT: "INPUT_OBJECT",
2627
- INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"
2628
- });
2629
-
2630
- // ../../node_modules/graphql/language/lexer.mjs
2631
- init_esm_shims();
2632
-
2633
- // ../../node_modules/graphql/language/blockString.mjs
2634
- init_esm_shims();
2635
- function dedentBlockStringValue(rawString) {
2636
- var lines = rawString.split(/\r\n|[\n\r]/g);
2637
- var commonIndent = getBlockStringIndentation(rawString);
2638
- if (commonIndent !== 0) {
2639
- for (var i = 1; i < lines.length; i++) {
2640
- lines[i] = lines[i].slice(commonIndent);
2641
- }
2642
- }
2643
- var startLine = 0;
2644
- while (startLine < lines.length && isBlank(lines[startLine])) {
2645
- ++startLine;
2646
- }
2647
- var endLine = lines.length;
2648
- while (endLine > startLine && isBlank(lines[endLine - 1])) {
2649
- --endLine;
2650
- }
2651
- return lines.slice(startLine, endLine).join("\n");
2652
- }
2653
- __name(dedentBlockStringValue, "dedentBlockStringValue");
2654
- function isBlank(str) {
2655
- for (var i = 0; i < str.length; ++i) {
2656
- if (str[i] !== " " && str[i] !== " ") {
2657
- return false;
2658
- }
2659
- }
2660
- return true;
2661
- }
2662
- __name(isBlank, "isBlank");
2663
- function getBlockStringIndentation(value) {
2664
- var _commonIndent;
2665
- var isFirstLine = true;
2666
- var isEmptyLine = true;
2667
- var indent = 0;
2668
- var commonIndent = null;
2669
- for (var i = 0; i < value.length; ++i) {
2670
- switch (value.charCodeAt(i)) {
2671
- case 13:
2672
- if (value.charCodeAt(i + 1) === 10) {
2673
- ++i;
2674
- }
2675
- case 10:
2676
- isFirstLine = false;
2677
- isEmptyLine = true;
2678
- indent = 0;
2679
- break;
2680
- case 9:
2681
- case 32:
2682
- ++indent;
2683
- break;
2684
- default:
2685
- if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {
2686
- commonIndent = indent;
2687
- }
2688
- isEmptyLine = false;
2689
- }
2690
- }
2691
- return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;
2692
- }
2693
- __name(getBlockStringIndentation, "getBlockStringIndentation");
2694
-
2695
- // ../../node_modules/graphql/language/lexer.mjs
2696
- var Lexer = /* @__PURE__ */ function() {
2697
- function Lexer2(source) {
2698
- var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);
2699
- this.source = source;
2700
- this.lastToken = startOfFileToken;
2701
- this.token = startOfFileToken;
2702
- this.line = 1;
2703
- this.lineStart = 0;
2704
- }
2705
- __name(Lexer2, "Lexer");
2706
- var _proto = Lexer2.prototype;
2707
- _proto.advance = /* @__PURE__ */ __name(function advance() {
2708
- this.lastToken = this.token;
2709
- var token = this.token = this.lookahead();
2710
- return token;
2711
- }, "advance");
2712
- _proto.lookahead = /* @__PURE__ */ __name(function lookahead() {
2713
- var token = this.token;
2714
- if (token.kind !== TokenKind.EOF) {
2715
- do {
2716
- var _token$next;
2717
- token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);
2718
- } while (token.kind === TokenKind.COMMENT);
2719
- }
2720
- return token;
2721
- }, "lookahead");
2722
- return Lexer2;
2723
- }();
2724
- function isPunctuatorTokenKind(kind) {
2725
- return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
2726
- }
2727
- __name(isPunctuatorTokenKind, "isPunctuatorTokenKind");
2728
- function printCharCode(code) {
2729
- return isNaN(code) ? TokenKind.EOF : code < 127 ? JSON.stringify(String.fromCharCode(code)) : '"\\u'.concat(("00" + code.toString(16).toUpperCase()).slice(-4), '"');
2730
- }
2731
- __name(printCharCode, "printCharCode");
2732
- function readToken(lexer, prev) {
2733
- var source = lexer.source;
2734
- var body = source.body;
2735
- var bodyLength = body.length;
2736
- var pos = prev.end;
2737
- while (pos < bodyLength) {
2738
- var code = body.charCodeAt(pos);
2739
- var _line = lexer.line;
2740
- var _col = 1 + pos - lexer.lineStart;
2741
- switch (code) {
2742
- case 65279:
2743
- case 9:
2744
- case 32:
2745
- case 44:
2746
- ++pos;
2747
- continue;
2748
- case 10:
2749
- ++pos;
2750
- ++lexer.line;
2751
- lexer.lineStart = pos;
2752
- continue;
2753
- case 13:
2754
- if (body.charCodeAt(pos + 1) === 10) {
2755
- pos += 2;
2756
- } else {
2757
- ++pos;
2758
- }
2759
- ++lexer.line;
2760
- lexer.lineStart = pos;
2761
- continue;
2762
- case 33:
2763
- return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);
2764
- case 35:
2765
- return readComment(source, pos, _line, _col, prev);
2766
- case 36:
2767
- return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);
2768
- case 38:
2769
- return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);
2770
- case 40:
2771
- return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);
2772
- case 41:
2773
- return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);
2774
- case 46:
2775
- if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {
2776
- return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);
2777
- }
2778
- break;
2779
- case 58:
2780
- return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);
2781
- case 61:
2782
- return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);
2783
- case 64:
2784
- return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);
2785
- case 91:
2786
- return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);
2787
- case 93:
2788
- return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);
2789
- case 123:
2790
- return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);
2791
- case 124:
2792
- return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);
2793
- case 125:
2794
- return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);
2795
- case 34:
2796
- if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {
2797
- return readBlockString(source, pos, _line, _col, prev, lexer);
2798
- }
2799
- return readString(source, pos, _line, _col, prev);
2800
- case 45:
2801
- case 48:
2802
- case 49:
2803
- case 50:
2804
- case 51:
2805
- case 52:
2806
- case 53:
2807
- case 54:
2808
- case 55:
2809
- case 56:
2810
- case 57:
2811
- return readNumber(source, pos, code, _line, _col, prev);
2812
- case 65:
2813
- case 66:
2814
- case 67:
2815
- case 68:
2816
- case 69:
2817
- case 70:
2818
- case 71:
2819
- case 72:
2820
- case 73:
2821
- case 74:
2822
- case 75:
2823
- case 76:
2824
- case 77:
2825
- case 78:
2826
- case 79:
2827
- case 80:
2828
- case 81:
2829
- case 82:
2830
- case 83:
2831
- case 84:
2832
- case 85:
2833
- case 86:
2834
- case 87:
2835
- case 88:
2836
- case 89:
2837
- case 90:
2838
- case 95:
2839
- case 97:
2840
- case 98:
2841
- case 99:
2842
- case 100:
2843
- case 101:
2844
- case 102:
2845
- case 103:
2846
- case 104:
2847
- case 105:
2848
- case 106:
2849
- case 107:
2850
- case 108:
2851
- case 109:
2852
- case 110:
2853
- case 111:
2854
- case 112:
2855
- case 113:
2856
- case 114:
2857
- case 115:
2858
- case 116:
2859
- case 117:
2860
- case 118:
2861
- case 119:
2862
- case 120:
2863
- case 121:
2864
- case 122:
2865
- return readName(source, pos, _line, _col, prev);
2866
- }
2867
- throw syntaxError(source, pos, unexpectedCharacterMessage(code));
2868
- }
2869
- var line = lexer.line;
2870
- var col = 1 + pos - lexer.lineStart;
2871
- return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);
2872
- }
2873
- __name(readToken, "readToken");
2874
- function unexpectedCharacterMessage(code) {
2875
- if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
2876
- return "Cannot contain the invalid character ".concat(printCharCode(code), ".");
2877
- }
2878
- if (code === 39) {
2879
- return `Unexpected single quote character ('), did you mean to use a double quote (")?`;
2880
- }
2881
- return "Cannot parse the unexpected character ".concat(printCharCode(code), ".");
2882
- }
2883
- __name(unexpectedCharacterMessage, "unexpectedCharacterMessage");
2884
- function readComment(source, start, line, col, prev) {
2885
- var body = source.body;
2886
- var code;
2887
- var position = start;
2888
- do {
2889
- code = body.charCodeAt(++position);
2890
- } while (!isNaN(code) && (code > 31 || code === 9));
2891
- return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));
2892
- }
2893
- __name(readComment, "readComment");
2894
- function readNumber(source, start, firstCode, line, col, prev) {
2895
- var body = source.body;
2896
- var code = firstCode;
2897
- var position = start;
2898
- var isFloat = false;
2899
- if (code === 45) {
2900
- code = body.charCodeAt(++position);
2901
- }
2902
- if (code === 48) {
2903
- code = body.charCodeAt(++position);
2904
- if (code >= 48 && code <= 57) {
2905
- throw syntaxError(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), "."));
2906
- }
2907
- } else {
2908
- position = readDigits(source, position, code);
2909
- code = body.charCodeAt(position);
2910
- }
2911
- if (code === 46) {
2912
- isFloat = true;
2913
- code = body.charCodeAt(++position);
2914
- position = readDigits(source, position, code);
2915
- code = body.charCodeAt(position);
2916
- }
2917
- if (code === 69 || code === 101) {
2918
- isFloat = true;
2919
- code = body.charCodeAt(++position);
2920
- if (code === 43 || code === 45) {
2921
- code = body.charCodeAt(++position);
2922
- }
2923
- position = readDigits(source, position, code);
2924
- code = body.charCodeAt(position);
2925
- }
2926
- if (code === 46 || isNameStart(code)) {
2927
- throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
2928
- }
2929
- return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));
2930
- }
2931
- __name(readNumber, "readNumber");
2932
- function readDigits(source, start, firstCode) {
2933
- var body = source.body;
2934
- var position = start;
2935
- var code = firstCode;
2936
- if (code >= 48 && code <= 57) {
2937
- do {
2938
- code = body.charCodeAt(++position);
2939
- } while (code >= 48 && code <= 57);
2940
- return position;
2941
- }
2942
- throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
2943
- }
2944
- __name(readDigits, "readDigits");
2945
- function readString(source, start, line, col, prev) {
2946
- var body = source.body;
2947
- var position = start + 1;
2948
- var chunkStart = position;
2949
- var code = 0;
2950
- var value = "";
2951
- while (position < body.length && !isNaN(code = body.charCodeAt(position)) && code !== 10 && code !== 13) {
2952
- if (code === 34) {
2953
- value += body.slice(chunkStart, position);
2954
- return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);
2955
- }
2956
- if (code < 32 && code !== 9) {
2957
- throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
2958
- }
2959
- ++position;
2960
- if (code === 92) {
2961
- value += body.slice(chunkStart, position - 1);
2962
- code = body.charCodeAt(position);
2963
- switch (code) {
2964
- case 34:
2965
- value += '"';
2966
- break;
2967
- case 47:
2968
- value += "/";
2969
- break;
2970
- case 92:
2971
- value += "\\";
2972
- break;
2973
- case 98:
2974
- value += "\b";
2975
- break;
2976
- case 102:
2977
- value += "\f";
2978
- break;
2979
- case 110:
2980
- value += "\n";
2981
- break;
2982
- case 114:
2983
- value += "\r";
2984
- break;
2985
- case 116:
2986
- value += " ";
2987
- break;
2988
- case 117: {
2989
- var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));
2990
- if (charCode < 0) {
2991
- var invalidSequence = body.slice(position + 1, position + 5);
2992
- throw syntaxError(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, "."));
2993
- }
2994
- value += String.fromCharCode(charCode);
2995
- position += 4;
2996
- break;
2997
- }
2998
- default:
2999
- throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), "."));
3000
- }
3001
- ++position;
3002
- chunkStart = position;
3003
- }
3004
- }
3005
- throw syntaxError(source, position, "Unterminated string.");
3006
- }
3007
- __name(readString, "readString");
3008
- function readBlockString(source, start, line, col, prev, lexer) {
3009
- var body = source.body;
3010
- var position = start + 3;
3011
- var chunkStart = position;
3012
- var code = 0;
3013
- var rawValue = "";
3014
- while (position < body.length && !isNaN(code = body.charCodeAt(position))) {
3015
- if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
3016
- rawValue += body.slice(chunkStart, position);
3017
- return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));
3018
- }
3019
- if (code < 32 && code !== 9 && code !== 10 && code !== 13) {
3020
- throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
3021
- }
3022
- if (code === 10) {
3023
- ++position;
3024
- ++lexer.line;
3025
- lexer.lineStart = position;
3026
- } else if (code === 13) {
3027
- if (body.charCodeAt(position + 1) === 10) {
3028
- position += 2;
3029
- } else {
3030
- ++position;
3031
- }
3032
- ++lexer.line;
3033
- lexer.lineStart = position;
3034
- } else if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
3035
- rawValue += body.slice(chunkStart, position) + '"""';
3036
- position += 4;
3037
- chunkStart = position;
3038
- } else {
3039
- ++position;
3040
- }
3041
- }
3042
- throw syntaxError(source, position, "Unterminated string.");
3043
- }
3044
- __name(readBlockString, "readBlockString");
3045
- function uniCharCode(a, b, c, d) {
3046
- return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);
3047
- }
3048
- __name(uniCharCode, "uniCharCode");
3049
- function char2hex(a) {
3050
- return a >= 48 && a <= 57 ? a - 48 : a >= 65 && a <= 70 ? a - 55 : a >= 97 && a <= 102 ? a - 87 : -1;
3051
- }
3052
- __name(char2hex, "char2hex");
3053
- function readName(source, start, line, col, prev) {
3054
- var body = source.body;
3055
- var bodyLength = body.length;
3056
- var position = start + 1;
3057
- var code = 0;
3058
- while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) {
3059
- ++position;
3060
- }
3061
- return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));
3062
- }
3063
- __name(readName, "readName");
3064
- function isNameStart(code) {
3065
- return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
3066
- }
3067
- __name(isNameStart, "isNameStart");
3068
-
3069
- // ../../node_modules/graphql/language/parser.mjs
3070
- function parse(source, options) {
3071
- var parser = new Parser(source, options);
3072
- return parser.parseDocument();
3073
- }
3074
- __name(parse, "parse");
3075
- var Parser = /* @__PURE__ */ function() {
3076
- function Parser2(source, options) {
3077
- var sourceObj = isSource(source) ? source : new Source(source);
3078
- this._lexer = new Lexer(sourceObj);
3079
- this._options = options;
3080
- }
3081
- __name(Parser2, "Parser");
3082
- var _proto = Parser2.prototype;
3083
- _proto.parseName = /* @__PURE__ */ __name(function parseName() {
3084
- var token = this.expectToken(TokenKind.NAME);
3085
- return {
3086
- kind: Kind.NAME,
3087
- value: token.value,
3088
- loc: this.loc(token)
3089
- };
3090
- }, "parseName");
3091
- _proto.parseDocument = /* @__PURE__ */ __name(function parseDocument2() {
3092
- var start = this._lexer.token;
3093
- return {
3094
- kind: Kind.DOCUMENT,
3095
- definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),
3096
- loc: this.loc(start)
3097
- };
3098
- }, "parseDocument");
3099
- _proto.parseDefinition = /* @__PURE__ */ __name(function parseDefinition() {
3100
- if (this.peek(TokenKind.NAME)) {
3101
- switch (this._lexer.token.value) {
3102
- case "query":
3103
- case "mutation":
3104
- case "subscription":
3105
- return this.parseOperationDefinition();
3106
- case "fragment":
3107
- return this.parseFragmentDefinition();
3108
- case "schema":
3109
- case "scalar":
3110
- case "type":
3111
- case "interface":
3112
- case "union":
3113
- case "enum":
3114
- case "input":
3115
- case "directive":
3116
- return this.parseTypeSystemDefinition();
3117
- case "extend":
3118
- return this.parseTypeSystemExtension();
3119
- }
3120
- } else if (this.peek(TokenKind.BRACE_L)) {
3121
- return this.parseOperationDefinition();
3122
- } else if (this.peekDescription()) {
3123
- return this.parseTypeSystemDefinition();
3124
- }
3125
- throw this.unexpected();
3126
- }, "parseDefinition");
3127
- _proto.parseOperationDefinition = /* @__PURE__ */ __name(function parseOperationDefinition() {
3128
- var start = this._lexer.token;
3129
- if (this.peek(TokenKind.BRACE_L)) {
3130
- return {
3131
- kind: Kind.OPERATION_DEFINITION,
3132
- operation: "query",
3133
- name: void 0,
3134
- variableDefinitions: [],
3135
- directives: [],
3136
- selectionSet: this.parseSelectionSet(),
3137
- loc: this.loc(start)
3138
- };
3139
- }
3140
- var operation = this.parseOperationType();
3141
- var name;
3142
- if (this.peek(TokenKind.NAME)) {
3143
- name = this.parseName();
3144
- }
3145
- return {
3146
- kind: Kind.OPERATION_DEFINITION,
3147
- operation,
3148
- name,
3149
- variableDefinitions: this.parseVariableDefinitions(),
3150
- directives: this.parseDirectives(false),
3151
- selectionSet: this.parseSelectionSet(),
3152
- loc: this.loc(start)
3153
- };
3154
- }, "parseOperationDefinition");
3155
- _proto.parseOperationType = /* @__PURE__ */ __name(function parseOperationType() {
3156
- var operationToken = this.expectToken(TokenKind.NAME);
3157
- switch (operationToken.value) {
3158
- case "query":
3159
- return "query";
3160
- case "mutation":
3161
- return "mutation";
3162
- case "subscription":
3163
- return "subscription";
3164
- }
3165
- throw this.unexpected(operationToken);
3166
- }, "parseOperationType");
3167
- _proto.parseVariableDefinitions = /* @__PURE__ */ __name(function parseVariableDefinitions() {
3168
- return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
3169
- }, "parseVariableDefinitions");
3170
- _proto.parseVariableDefinition = /* @__PURE__ */ __name(function parseVariableDefinition() {
3171
- var start = this._lexer.token;
3172
- return {
3173
- kind: Kind.VARIABLE_DEFINITION,
3174
- variable: this.parseVariable(),
3175
- type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
3176
- defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : void 0,
3177
- directives: this.parseDirectives(true),
3178
- loc: this.loc(start)
3179
- };
3180
- }, "parseVariableDefinition");
3181
- _proto.parseVariable = /* @__PURE__ */ __name(function parseVariable() {
3182
- var start = this._lexer.token;
3183
- this.expectToken(TokenKind.DOLLAR);
3184
- return {
3185
- kind: Kind.VARIABLE,
3186
- name: this.parseName(),
3187
- loc: this.loc(start)
3188
- };
3189
- }, "parseVariable");
3190
- _proto.parseSelectionSet = /* @__PURE__ */ __name(function parseSelectionSet() {
3191
- var start = this._lexer.token;
3192
- return {
3193
- kind: Kind.SELECTION_SET,
3194
- selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),
3195
- loc: this.loc(start)
3196
- };
3197
- }, "parseSelectionSet");
3198
- _proto.parseSelection = /* @__PURE__ */ __name(function parseSelection() {
3199
- return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
3200
- }, "parseSelection");
3201
- _proto.parseField = /* @__PURE__ */ __name(function parseField() {
3202
- var start = this._lexer.token;
3203
- var nameOrAlias = this.parseName();
3204
- var alias;
3205
- var name;
3206
- if (this.expectOptionalToken(TokenKind.COLON)) {
3207
- alias = nameOrAlias;
3208
- name = this.parseName();
3209
- } else {
3210
- name = nameOrAlias;
3211
- }
3212
- return {
3213
- kind: Kind.FIELD,
3214
- alias,
3215
- name,
3216
- arguments: this.parseArguments(false),
3217
- directives: this.parseDirectives(false),
3218
- selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
3219
- loc: this.loc(start)
3220
- };
3221
- }, "parseField");
3222
- _proto.parseArguments = /* @__PURE__ */ __name(function parseArguments(isConst) {
3223
- var item = isConst ? this.parseConstArgument : this.parseArgument;
3224
- return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
3225
- }, "parseArguments");
3226
- _proto.parseArgument = /* @__PURE__ */ __name(function parseArgument() {
3227
- var start = this._lexer.token;
3228
- var name = this.parseName();
3229
- this.expectToken(TokenKind.COLON);
3230
- return {
3231
- kind: Kind.ARGUMENT,
3232
- name,
3233
- value: this.parseValueLiteral(false),
3234
- loc: this.loc(start)
3235
- };
3236
- }, "parseArgument");
3237
- _proto.parseConstArgument = /* @__PURE__ */ __name(function parseConstArgument() {
3238
- var start = this._lexer.token;
3239
- return {
3240
- kind: Kind.ARGUMENT,
3241
- name: this.parseName(),
3242
- value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),
3243
- loc: this.loc(start)
3244
- };
3245
- }, "parseConstArgument");
3246
- _proto.parseFragment = /* @__PURE__ */ __name(function parseFragment() {
3247
- var start = this._lexer.token;
3248
- this.expectToken(TokenKind.SPREAD);
3249
- var hasTypeCondition = this.expectOptionalKeyword("on");
3250
- if (!hasTypeCondition && this.peek(TokenKind.NAME)) {
3251
- return {
3252
- kind: Kind.FRAGMENT_SPREAD,
3253
- name: this.parseFragmentName(),
3254
- directives: this.parseDirectives(false),
3255
- loc: this.loc(start)
3256
- };
3257
- }
3258
- return {
3259
- kind: Kind.INLINE_FRAGMENT,
3260
- typeCondition: hasTypeCondition ? this.parseNamedType() : void 0,
3261
- directives: this.parseDirectives(false),
3262
- selectionSet: this.parseSelectionSet(),
3263
- loc: this.loc(start)
3264
- };
3265
- }, "parseFragment");
3266
- _proto.parseFragmentDefinition = /* @__PURE__ */ __name(function parseFragmentDefinition() {
3267
- var _this$_options;
3268
- var start = this._lexer.token;
3269
- this.expectKeyword("fragment");
3270
- if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {
3271
- return {
3272
- kind: Kind.FRAGMENT_DEFINITION,
3273
- name: this.parseFragmentName(),
3274
- variableDefinitions: this.parseVariableDefinitions(),
3275
- typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
3276
- directives: this.parseDirectives(false),
3277
- selectionSet: this.parseSelectionSet(),
3278
- loc: this.loc(start)
3279
- };
3280
- }
3281
- return {
3282
- kind: Kind.FRAGMENT_DEFINITION,
3283
- name: this.parseFragmentName(),
3284
- typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
3285
- directives: this.parseDirectives(false),
3286
- selectionSet: this.parseSelectionSet(),
3287
- loc: this.loc(start)
3288
- };
3289
- }, "parseFragmentDefinition");
3290
- _proto.parseFragmentName = /* @__PURE__ */ __name(function parseFragmentName() {
3291
- if (this._lexer.token.value === "on") {
3292
- throw this.unexpected();
3293
- }
3294
- return this.parseName();
3295
- }, "parseFragmentName");
3296
- _proto.parseValueLiteral = /* @__PURE__ */ __name(function parseValueLiteral(isConst) {
3297
- var token = this._lexer.token;
3298
- switch (token.kind) {
3299
- case TokenKind.BRACKET_L:
3300
- return this.parseList(isConst);
3301
- case TokenKind.BRACE_L:
3302
- return this.parseObject(isConst);
3303
- case TokenKind.INT:
3304
- this._lexer.advance();
3305
- return {
3306
- kind: Kind.INT,
3307
- value: token.value,
3308
- loc: this.loc(token)
3309
- };
3310
- case TokenKind.FLOAT:
3311
- this._lexer.advance();
3312
- return {
3313
- kind: Kind.FLOAT,
3314
- value: token.value,
3315
- loc: this.loc(token)
3316
- };
3317
- case TokenKind.STRING:
3318
- case TokenKind.BLOCK_STRING:
3319
- return this.parseStringLiteral();
3320
- case TokenKind.NAME:
3321
- this._lexer.advance();
3322
- switch (token.value) {
3323
- case "true":
3324
- return {
3325
- kind: Kind.BOOLEAN,
3326
- value: true,
3327
- loc: this.loc(token)
3328
- };
3329
- case "false":
3330
- return {
3331
- kind: Kind.BOOLEAN,
3332
- value: false,
3333
- loc: this.loc(token)
3334
- };
3335
- case "null":
3336
- return {
3337
- kind: Kind.NULL,
3338
- loc: this.loc(token)
3339
- };
3340
- default:
3341
- return {
3342
- kind: Kind.ENUM,
3343
- value: token.value,
3344
- loc: this.loc(token)
3345
- };
3346
- }
3347
- case TokenKind.DOLLAR:
3348
- if (!isConst) {
3349
- return this.parseVariable();
3350
- }
3351
- break;
3352
- }
3353
- throw this.unexpected();
3354
- }, "parseValueLiteral");
3355
- _proto.parseStringLiteral = /* @__PURE__ */ __name(function parseStringLiteral() {
3356
- var token = this._lexer.token;
3357
- this._lexer.advance();
3358
- return {
3359
- kind: Kind.STRING,
3360
- value: token.value,
3361
- block: token.kind === TokenKind.BLOCK_STRING,
3362
- loc: this.loc(token)
3363
- };
3364
- }, "parseStringLiteral");
3365
- _proto.parseList = /* @__PURE__ */ __name(function parseList(isConst) {
3366
- var _this = this;
3367
- var start = this._lexer.token;
3368
- var item = /* @__PURE__ */ __name(function item2() {
3369
- return _this.parseValueLiteral(isConst);
3370
- }, "item");
3371
- return {
3372
- kind: Kind.LIST,
3373
- values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
3374
- loc: this.loc(start)
3375
- };
3376
- }, "parseList");
3377
- _proto.parseObject = /* @__PURE__ */ __name(function parseObject(isConst) {
3378
- var _this2 = this;
3379
- var start = this._lexer.token;
3380
- var item = /* @__PURE__ */ __name(function item2() {
3381
- return _this2.parseObjectField(isConst);
3382
- }, "item");
3383
- return {
3384
- kind: Kind.OBJECT,
3385
- fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),
3386
- loc: this.loc(start)
3387
- };
3388
- }, "parseObject");
3389
- _proto.parseObjectField = /* @__PURE__ */ __name(function parseObjectField(isConst) {
3390
- var start = this._lexer.token;
3391
- var name = this.parseName();
3392
- this.expectToken(TokenKind.COLON);
3393
- return {
3394
- kind: Kind.OBJECT_FIELD,
3395
- name,
3396
- value: this.parseValueLiteral(isConst),
3397
- loc: this.loc(start)
3398
- };
3399
- }, "parseObjectField");
3400
- _proto.parseDirectives = /* @__PURE__ */ __name(function parseDirectives(isConst) {
3401
- var directives = [];
3402
- while (this.peek(TokenKind.AT)) {
3403
- directives.push(this.parseDirective(isConst));
3404
- }
3405
- return directives;
3406
- }, "parseDirectives");
3407
- _proto.parseDirective = /* @__PURE__ */ __name(function parseDirective(isConst) {
3408
- var start = this._lexer.token;
3409
- this.expectToken(TokenKind.AT);
3410
- return {
3411
- kind: Kind.DIRECTIVE,
3412
- name: this.parseName(),
3413
- arguments: this.parseArguments(isConst),
3414
- loc: this.loc(start)
3415
- };
3416
- }, "parseDirective");
3417
- _proto.parseTypeReference = /* @__PURE__ */ __name(function parseTypeReference() {
3418
- var start = this._lexer.token;
3419
- var type;
3420
- if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
3421
- type = this.parseTypeReference();
3422
- this.expectToken(TokenKind.BRACKET_R);
3423
- type = {
3424
- kind: Kind.LIST_TYPE,
3425
- type,
3426
- loc: this.loc(start)
3427
- };
3428
- } else {
3429
- type = this.parseNamedType();
3430
- }
3431
- if (this.expectOptionalToken(TokenKind.BANG)) {
3432
- return {
3433
- kind: Kind.NON_NULL_TYPE,
3434
- type,
3435
- loc: this.loc(start)
3436
- };
3437
- }
3438
- return type;
3439
- }, "parseTypeReference");
3440
- _proto.parseNamedType = /* @__PURE__ */ __name(function parseNamedType() {
3441
- var start = this._lexer.token;
3442
- return {
3443
- kind: Kind.NAMED_TYPE,
3444
- name: this.parseName(),
3445
- loc: this.loc(start)
3446
- };
3447
- }, "parseNamedType");
3448
- _proto.parseTypeSystemDefinition = /* @__PURE__ */ __name(function parseTypeSystemDefinition() {
3449
- var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;
3450
- if (keywordToken.kind === TokenKind.NAME) {
3451
- switch (keywordToken.value) {
3452
- case "schema":
3453
- return this.parseSchemaDefinition();
3454
- case "scalar":
3455
- return this.parseScalarTypeDefinition();
3456
- case "type":
3457
- return this.parseObjectTypeDefinition();
3458
- case "interface":
3459
- return this.parseInterfaceTypeDefinition();
3460
- case "union":
3461
- return this.parseUnionTypeDefinition();
3462
- case "enum":
3463
- return this.parseEnumTypeDefinition();
3464
- case "input":
3465
- return this.parseInputObjectTypeDefinition();
3466
- case "directive":
3467
- return this.parseDirectiveDefinition();
3468
- }
3469
- }
3470
- throw this.unexpected(keywordToken);
3471
- }, "parseTypeSystemDefinition");
3472
- _proto.peekDescription = /* @__PURE__ */ __name(function peekDescription() {
3473
- return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
3474
- }, "peekDescription");
3475
- _proto.parseDescription = /* @__PURE__ */ __name(function parseDescription() {
3476
- if (this.peekDescription()) {
3477
- return this.parseStringLiteral();
3478
- }
3479
- }, "parseDescription");
3480
- _proto.parseSchemaDefinition = /* @__PURE__ */ __name(function parseSchemaDefinition() {
3481
- var start = this._lexer.token;
3482
- var description = this.parseDescription();
3483
- this.expectKeyword("schema");
3484
- var directives = this.parseDirectives(true);
3485
- var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
3486
- return {
3487
- kind: Kind.SCHEMA_DEFINITION,
3488
- description,
3489
- directives,
3490
- operationTypes,
3491
- loc: this.loc(start)
3492
- };
3493
- }, "parseSchemaDefinition");
3494
- _proto.parseOperationTypeDefinition = /* @__PURE__ */ __name(function parseOperationTypeDefinition() {
3495
- var start = this._lexer.token;
3496
- var operation = this.parseOperationType();
3497
- this.expectToken(TokenKind.COLON);
3498
- var type = this.parseNamedType();
3499
- return {
3500
- kind: Kind.OPERATION_TYPE_DEFINITION,
3501
- operation,
3502
- type,
3503
- loc: this.loc(start)
3504
- };
3505
- }, "parseOperationTypeDefinition");
3506
- _proto.parseScalarTypeDefinition = /* @__PURE__ */ __name(function parseScalarTypeDefinition() {
3507
- var start = this._lexer.token;
3508
- var description = this.parseDescription();
3509
- this.expectKeyword("scalar");
3510
- var name = this.parseName();
3511
- var directives = this.parseDirectives(true);
3512
- return {
3513
- kind: Kind.SCALAR_TYPE_DEFINITION,
3514
- description,
3515
- name,
3516
- directives,
3517
- loc: this.loc(start)
3518
- };
3519
- }, "parseScalarTypeDefinition");
3520
- _proto.parseObjectTypeDefinition = /* @__PURE__ */ __name(function parseObjectTypeDefinition() {
3521
- var start = this._lexer.token;
3522
- var description = this.parseDescription();
3523
- this.expectKeyword("type");
3524
- var name = this.parseName();
3525
- var interfaces = this.parseImplementsInterfaces();
3526
- var directives = this.parseDirectives(true);
3527
- var fields = this.parseFieldsDefinition();
3528
- return {
3529
- kind: Kind.OBJECT_TYPE_DEFINITION,
3530
- description,
3531
- name,
3532
- interfaces,
3533
- directives,
3534
- fields,
3535
- loc: this.loc(start)
3536
- };
3537
- }, "parseObjectTypeDefinition");
3538
- _proto.parseImplementsInterfaces = /* @__PURE__ */ __name(function parseImplementsInterfaces() {
3539
- var _this$_options2;
3540
- if (!this.expectOptionalKeyword("implements")) {
3541
- return [];
3542
- }
3543
- if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
3544
- var types = [];
3545
- this.expectOptionalToken(TokenKind.AMP);
3546
- do {
3547
- types.push(this.parseNamedType());
3548
- } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));
3549
- return types;
3550
- }
3551
- return this.delimitedMany(TokenKind.AMP, this.parseNamedType);
3552
- }, "parseImplementsInterfaces");
3553
- _proto.parseFieldsDefinition = /* @__PURE__ */ __name(function parseFieldsDefinition() {
3554
- var _this$_options3;
3555
- if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {
3556
- this._lexer.advance();
3557
- this._lexer.advance();
3558
- return [];
3559
- }
3560
- return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
3561
- }, "parseFieldsDefinition");
3562
- _proto.parseFieldDefinition = /* @__PURE__ */ __name(function parseFieldDefinition() {
3563
- var start = this._lexer.token;
3564
- var description = this.parseDescription();
3565
- var name = this.parseName();
3566
- var args = this.parseArgumentDefs();
3567
- this.expectToken(TokenKind.COLON);
3568
- var type = this.parseTypeReference();
3569
- var directives = this.parseDirectives(true);
3570
- return {
3571
- kind: Kind.FIELD_DEFINITION,
3572
- description,
3573
- name,
3574
- arguments: args,
3575
- type,
3576
- directives,
3577
- loc: this.loc(start)
3578
- };
3579
- }, "parseFieldDefinition");
3580
- _proto.parseArgumentDefs = /* @__PURE__ */ __name(function parseArgumentDefs() {
3581
- return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
3582
- }, "parseArgumentDefs");
3583
- _proto.parseInputValueDef = /* @__PURE__ */ __name(function parseInputValueDef() {
3584
- var start = this._lexer.token;
3585
- var description = this.parseDescription();
3586
- var name = this.parseName();
3587
- this.expectToken(TokenKind.COLON);
3588
- var type = this.parseTypeReference();
3589
- var defaultValue;
3590
- if (this.expectOptionalToken(TokenKind.EQUALS)) {
3591
- defaultValue = this.parseValueLiteral(true);
3592
- }
3593
- var directives = this.parseDirectives(true);
3594
- return {
3595
- kind: Kind.INPUT_VALUE_DEFINITION,
3596
- description,
3597
- name,
3598
- type,
3599
- defaultValue,
3600
- directives,
3601
- loc: this.loc(start)
3602
- };
3603
- }, "parseInputValueDef");
3604
- _proto.parseInterfaceTypeDefinition = /* @__PURE__ */ __name(function parseInterfaceTypeDefinition() {
3605
- var start = this._lexer.token;
3606
- var description = this.parseDescription();
3607
- this.expectKeyword("interface");
3608
- var name = this.parseName();
3609
- var interfaces = this.parseImplementsInterfaces();
3610
- var directives = this.parseDirectives(true);
3611
- var fields = this.parseFieldsDefinition();
3612
- return {
3613
- kind: Kind.INTERFACE_TYPE_DEFINITION,
3614
- description,
3615
- name,
3616
- interfaces,
3617
- directives,
3618
- fields,
3619
- loc: this.loc(start)
3620
- };
3621
- }, "parseInterfaceTypeDefinition");
3622
- _proto.parseUnionTypeDefinition = /* @__PURE__ */ __name(function parseUnionTypeDefinition() {
3623
- var start = this._lexer.token;
3624
- var description = this.parseDescription();
3625
- this.expectKeyword("union");
3626
- var name = this.parseName();
3627
- var directives = this.parseDirectives(true);
3628
- var types = this.parseUnionMemberTypes();
3629
- return {
3630
- kind: Kind.UNION_TYPE_DEFINITION,
3631
- description,
3632
- name,
3633
- directives,
3634
- types,
3635
- loc: this.loc(start)
3636
- };
3637
- }, "parseUnionTypeDefinition");
3638
- _proto.parseUnionMemberTypes = /* @__PURE__ */ __name(function parseUnionMemberTypes() {
3639
- return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
3640
- }, "parseUnionMemberTypes");
3641
- _proto.parseEnumTypeDefinition = /* @__PURE__ */ __name(function parseEnumTypeDefinition() {
3642
- var start = this._lexer.token;
3643
- var description = this.parseDescription();
3644
- this.expectKeyword("enum");
3645
- var name = this.parseName();
3646
- var directives = this.parseDirectives(true);
3647
- var values = this.parseEnumValuesDefinition();
3648
- return {
3649
- kind: Kind.ENUM_TYPE_DEFINITION,
3650
- description,
3651
- name,
3652
- directives,
3653
- values,
3654
- loc: this.loc(start)
3655
- };
3656
- }, "parseEnumTypeDefinition");
3657
- _proto.parseEnumValuesDefinition = /* @__PURE__ */ __name(function parseEnumValuesDefinition() {
3658
- return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
3659
- }, "parseEnumValuesDefinition");
3660
- _proto.parseEnumValueDefinition = /* @__PURE__ */ __name(function parseEnumValueDefinition() {
3661
- var start = this._lexer.token;
3662
- var description = this.parseDescription();
3663
- var name = this.parseName();
3664
- var directives = this.parseDirectives(true);
3665
- return {
3666
- kind: Kind.ENUM_VALUE_DEFINITION,
3667
- description,
3668
- name,
3669
- directives,
3670
- loc: this.loc(start)
3671
- };
3672
- }, "parseEnumValueDefinition");
3673
- _proto.parseInputObjectTypeDefinition = /* @__PURE__ */ __name(function parseInputObjectTypeDefinition() {
3674
- var start = this._lexer.token;
3675
- var description = this.parseDescription();
3676
- this.expectKeyword("input");
3677
- var name = this.parseName();
3678
- var directives = this.parseDirectives(true);
3679
- var fields = this.parseInputFieldsDefinition();
3680
- return {
3681
- kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
3682
- description,
3683
- name,
3684
- directives,
3685
- fields,
3686
- loc: this.loc(start)
3687
- };
3688
- }, "parseInputObjectTypeDefinition");
3689
- _proto.parseInputFieldsDefinition = /* @__PURE__ */ __name(function parseInputFieldsDefinition() {
3690
- return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
3691
- }, "parseInputFieldsDefinition");
3692
- _proto.parseTypeSystemExtension = /* @__PURE__ */ __name(function parseTypeSystemExtension() {
3693
- var keywordToken = this._lexer.lookahead();
3694
- if (keywordToken.kind === TokenKind.NAME) {
3695
- switch (keywordToken.value) {
3696
- case "schema":
3697
- return this.parseSchemaExtension();
3698
- case "scalar":
3699
- return this.parseScalarTypeExtension();
3700
- case "type":
3701
- return this.parseObjectTypeExtension();
3702
- case "interface":
3703
- return this.parseInterfaceTypeExtension();
3704
- case "union":
3705
- return this.parseUnionTypeExtension();
3706
- case "enum":
3707
- return this.parseEnumTypeExtension();
3708
- case "input":
3709
- return this.parseInputObjectTypeExtension();
3710
- }
3711
- }
3712
- throw this.unexpected(keywordToken);
3713
- }, "parseTypeSystemExtension");
3714
- _proto.parseSchemaExtension = /* @__PURE__ */ __name(function parseSchemaExtension() {
3715
- var start = this._lexer.token;
3716
- this.expectKeyword("extend");
3717
- this.expectKeyword("schema");
3718
- var directives = this.parseDirectives(true);
3719
- var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
3720
- if (directives.length === 0 && operationTypes.length === 0) {
3721
- throw this.unexpected();
3722
- }
3723
- return {
3724
- kind: Kind.SCHEMA_EXTENSION,
3725
- directives,
3726
- operationTypes,
3727
- loc: this.loc(start)
3728
- };
3729
- }, "parseSchemaExtension");
3730
- _proto.parseScalarTypeExtension = /* @__PURE__ */ __name(function parseScalarTypeExtension() {
3731
- var start = this._lexer.token;
3732
- this.expectKeyword("extend");
3733
- this.expectKeyword("scalar");
3734
- var name = this.parseName();
3735
- var directives = this.parseDirectives(true);
3736
- if (directives.length === 0) {
3737
- throw this.unexpected();
3738
- }
3739
- return {
3740
- kind: Kind.SCALAR_TYPE_EXTENSION,
3741
- name,
3742
- directives,
3743
- loc: this.loc(start)
3744
- };
3745
- }, "parseScalarTypeExtension");
3746
- _proto.parseObjectTypeExtension = /* @__PURE__ */ __name(function parseObjectTypeExtension() {
3747
- var start = this._lexer.token;
3748
- this.expectKeyword("extend");
3749
- this.expectKeyword("type");
3750
- var name = this.parseName();
3751
- var interfaces = this.parseImplementsInterfaces();
3752
- var directives = this.parseDirectives(true);
3753
- var fields = this.parseFieldsDefinition();
3754
- if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
3755
- throw this.unexpected();
3756
- }
3757
- return {
3758
- kind: Kind.OBJECT_TYPE_EXTENSION,
3759
- name,
3760
- interfaces,
3761
- directives,
3762
- fields,
3763
- loc: this.loc(start)
3764
- };
3765
- }, "parseObjectTypeExtension");
3766
- _proto.parseInterfaceTypeExtension = /* @__PURE__ */ __name(function parseInterfaceTypeExtension() {
3767
- var start = this._lexer.token;
3768
- this.expectKeyword("extend");
3769
- this.expectKeyword("interface");
3770
- var name = this.parseName();
3771
- var interfaces = this.parseImplementsInterfaces();
3772
- var directives = this.parseDirectives(true);
3773
- var fields = this.parseFieldsDefinition();
3774
- if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
3775
- throw this.unexpected();
3776
- }
3777
- return {
3778
- kind: Kind.INTERFACE_TYPE_EXTENSION,
3779
- name,
3780
- interfaces,
3781
- directives,
3782
- fields,
3783
- loc: this.loc(start)
3784
- };
3785
- }, "parseInterfaceTypeExtension");
3786
- _proto.parseUnionTypeExtension = /* @__PURE__ */ __name(function parseUnionTypeExtension() {
3787
- var start = this._lexer.token;
3788
- this.expectKeyword("extend");
3789
- this.expectKeyword("union");
3790
- var name = this.parseName();
3791
- var directives = this.parseDirectives(true);
3792
- var types = this.parseUnionMemberTypes();
3793
- if (directives.length === 0 && types.length === 0) {
3794
- throw this.unexpected();
3795
- }
3796
- return {
3797
- kind: Kind.UNION_TYPE_EXTENSION,
3798
- name,
3799
- directives,
3800
- types,
3801
- loc: this.loc(start)
3802
- };
3803
- }, "parseUnionTypeExtension");
3804
- _proto.parseEnumTypeExtension = /* @__PURE__ */ __name(function parseEnumTypeExtension() {
3805
- var start = this._lexer.token;
3806
- this.expectKeyword("extend");
3807
- this.expectKeyword("enum");
3808
- var name = this.parseName();
3809
- var directives = this.parseDirectives(true);
3810
- var values = this.parseEnumValuesDefinition();
3811
- if (directives.length === 0 && values.length === 0) {
3812
- throw this.unexpected();
3813
- }
3814
- return {
3815
- kind: Kind.ENUM_TYPE_EXTENSION,
3816
- name,
3817
- directives,
3818
- values,
3819
- loc: this.loc(start)
3820
- };
3821
- }, "parseEnumTypeExtension");
3822
- _proto.parseInputObjectTypeExtension = /* @__PURE__ */ __name(function parseInputObjectTypeExtension() {
3823
- var start = this._lexer.token;
3824
- this.expectKeyword("extend");
3825
- this.expectKeyword("input");
3826
- var name = this.parseName();
3827
- var directives = this.parseDirectives(true);
3828
- var fields = this.parseInputFieldsDefinition();
3829
- if (directives.length === 0 && fields.length === 0) {
3830
- throw this.unexpected();
3831
- }
3832
- return {
3833
- kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,
3834
- name,
3835
- directives,
3836
- fields,
3837
- loc: this.loc(start)
3838
- };
3839
- }, "parseInputObjectTypeExtension");
3840
- _proto.parseDirectiveDefinition = /* @__PURE__ */ __name(function parseDirectiveDefinition() {
3841
- var start = this._lexer.token;
3842
- var description = this.parseDescription();
3843
- this.expectKeyword("directive");
3844
- this.expectToken(TokenKind.AT);
3845
- var name = this.parseName();
3846
- var args = this.parseArgumentDefs();
3847
- var repeatable = this.expectOptionalKeyword("repeatable");
3848
- this.expectKeyword("on");
3849
- var locations = this.parseDirectiveLocations();
3850
- return {
3851
- kind: Kind.DIRECTIVE_DEFINITION,
3852
- description,
3853
- name,
3854
- arguments: args,
3855
- repeatable,
3856
- locations,
3857
- loc: this.loc(start)
3858
- };
3859
- }, "parseDirectiveDefinition");
3860
- _proto.parseDirectiveLocations = /* @__PURE__ */ __name(function parseDirectiveLocations() {
3861
- return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
3862
- }, "parseDirectiveLocations");
3863
- _proto.parseDirectiveLocation = /* @__PURE__ */ __name(function parseDirectiveLocation() {
3864
- var start = this._lexer.token;
3865
- var name = this.parseName();
3866
- if (DirectiveLocation[name.value] !== void 0) {
3867
- return name;
3868
- }
3869
- throw this.unexpected(start);
3870
- }, "parseDirectiveLocation");
3871
- _proto.loc = /* @__PURE__ */ __name(function loc(startToken) {
3872
- var _this$_options4;
3873
- if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {
3874
- return new Location(startToken, this._lexer.lastToken, this._lexer.source);
3875
- }
3876
- }, "loc");
3877
- _proto.peek = /* @__PURE__ */ __name(function peek(kind) {
3878
- return this._lexer.token.kind === kind;
3879
- }, "peek");
3880
- _proto.expectToken = /* @__PURE__ */ __name(function expectToken(kind) {
3881
- var token = this._lexer.token;
3882
- if (token.kind === kind) {
3883
- this._lexer.advance();
3884
- return token;
3885
- }
3886
- throw syntaxError(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(kind), ", found ").concat(getTokenDesc(token), "."));
3887
- }, "expectToken");
3888
- _proto.expectOptionalToken = /* @__PURE__ */ __name(function expectOptionalToken(kind) {
3889
- var token = this._lexer.token;
3890
- if (token.kind === kind) {
3891
- this._lexer.advance();
3892
- return token;
3893
- }
3894
- return void 0;
3895
- }, "expectOptionalToken");
3896
- _proto.expectKeyword = /* @__PURE__ */ __name(function expectKeyword(value) {
3897
- var token = this._lexer.token;
3898
- if (token.kind === TokenKind.NAME && token.value === value) {
3899
- this._lexer.advance();
3900
- } else {
3901
- throw syntaxError(this._lexer.source, token.start, 'Expected "'.concat(value, '", found ').concat(getTokenDesc(token), "."));
3902
- }
3903
- }, "expectKeyword");
3904
- _proto.expectOptionalKeyword = /* @__PURE__ */ __name(function expectOptionalKeyword(value) {
3905
- var token = this._lexer.token;
3906
- if (token.kind === TokenKind.NAME && token.value === value) {
3907
- this._lexer.advance();
3908
- return true;
3909
- }
3910
- return false;
3911
- }, "expectOptionalKeyword");
3912
- _proto.unexpected = /* @__PURE__ */ __name(function unexpected(atToken) {
3913
- var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
3914
- return syntaxError(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token), "."));
3915
- }, "unexpected");
3916
- _proto.any = /* @__PURE__ */ __name(function any(openKind, parseFn, closeKind) {
3917
- this.expectToken(openKind);
3918
- var nodes = [];
3919
- while (!this.expectOptionalToken(closeKind)) {
3920
- nodes.push(parseFn.call(this));
3921
- }
3922
- return nodes;
3923
- }, "any");
3924
- _proto.optionalMany = /* @__PURE__ */ __name(function optionalMany(openKind, parseFn, closeKind) {
3925
- if (this.expectOptionalToken(openKind)) {
3926
- var nodes = [];
3927
- do {
3928
- nodes.push(parseFn.call(this));
3929
- } while (!this.expectOptionalToken(closeKind));
3930
- return nodes;
3931
- }
3932
- return [];
3933
- }, "optionalMany");
3934
- _proto.many = /* @__PURE__ */ __name(function many(openKind, parseFn, closeKind) {
3935
- this.expectToken(openKind);
3936
- var nodes = [];
3937
- do {
3938
- nodes.push(parseFn.call(this));
3939
- } while (!this.expectOptionalToken(closeKind));
3940
- return nodes;
3941
- }, "many");
3942
- _proto.delimitedMany = /* @__PURE__ */ __name(function delimitedMany(delimiterKind, parseFn) {
3943
- this.expectOptionalToken(delimiterKind);
3944
- var nodes = [];
3945
- do {
3946
- nodes.push(parseFn.call(this));
3947
- } while (this.expectOptionalToken(delimiterKind));
3948
- return nodes;
3949
- }, "delimitedMany");
3950
- return Parser2;
3951
- }();
3952
- function getTokenDesc(token) {
3953
- var value = token.value;
3954
- return getTokenKindDesc(token.kind) + (value != null ? ' "'.concat(value, '"') : "");
3955
- }
3956
- __name(getTokenDesc, "getTokenDesc");
3957
- function getTokenKindDesc(kind) {
3958
- return isPunctuatorTokenKind(kind) ? '"'.concat(kind, '"') : kind;
3959
- }
3960
- __name(getTokenKindDesc, "getTokenKindDesc");
3961
-
3962
- // ../../node_modules/graphql/language/index.mjs
3963
- init_esm_shims();
3964
-
3965
1809
  // ../../node_modules/graphql-tag/lib/index.js
1810
+ import { parse } from "graphql";
3966
1811
  var docCache = /* @__PURE__ */ new Map();
3967
1812
  var fragmentSourceMap = /* @__PURE__ */ new Map();
3968
1813
  var printFragmentWarnings = true;